Skip to content

Commit

Permalink
Merge branch 'main' into feat/langchainCallbackHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
csgulati09 committed Jun 22, 2024
2 parents 244b7fe + c06ded6 commit 7ebd68b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions portkey_ai/api_resources/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
http_client: Optional[httpx.Client] = None,
request_timeout: Optional[int] = None,
**kwargs,
) -> None:
self.api_key = api_key or default_api_key()
Expand All @@ -99,6 +100,7 @@ def __init__(
self.azure_deployment_id = azure_deployment_id
self.azure_api_version = azure_api_version
self.cache_namespace = cache_namespace
self.request_timeout = request_timeout
self.kwargs = kwargs

self.custom_headers = createHeaders(
Expand All @@ -125,6 +127,7 @@ def __init__(
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
cache_namespace=cache_namespace,
request_timeout=request_timeout,
**kwargs,
)

Expand Down Expand Up @@ -544,6 +547,7 @@ def __init__(
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
http_client: Optional[httpx.AsyncClient] = None,
request_timeout: Optional[int] = None,
**kwargs,
) -> None:
self.api_key = api_key or default_api_key()
Expand All @@ -570,6 +574,7 @@ def __init__(
self.azure_deployment_id = azure_deployment_id
self.azure_api_version = azure_api_version
self.cache_namespace = cache_namespace
self.request_timeout = request_timeout
self.kwargs = kwargs

self.custom_headers = createHeaders(
Expand All @@ -596,6 +601,7 @@ def __init__(
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
cache_namespace=cache_namespace,
request_timeout=request_timeout,
**kwargs,
)

Expand Down
9 changes: 9 additions & 0 deletions portkey_ai/api_resources/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
http_client: Optional[httpx.Client] = None,
request_timeout: Optional[int] = None,
**kwargs,
) -> None:
super().__init__(
Expand Down Expand Up @@ -92,6 +93,7 @@ def __init__(
azure_api_version=azure_api_version,
cache_namespace=cache_namespace,
http_client=http_client,
request_timeout=request_timeout,
**kwargs,
)

Expand Down Expand Up @@ -145,6 +147,7 @@ def copy(
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
http_client: Optional[httpx.Client] = None,
request_timeout: Optional[int] = None,
**kwargs,
) -> Portkey:
return self.__class__(
Expand Down Expand Up @@ -173,6 +176,7 @@ def copy(
azure_api_version=azure_api_version or self.azure_api_version,
cache_namespace=cache_namespace or self.cache_namespace,
http_client=http_client or self._client,
request_timeout=request_timeout or self.request_timeout,
**self.kwargs,
**kwargs,
)
Expand Down Expand Up @@ -236,6 +240,7 @@ def __init__(
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
http_client: Optional[httpx.AsyncClient] = None,
request_timeout: Optional[int] = None,
**kwargs,
) -> None:
super().__init__(
Expand Down Expand Up @@ -263,6 +268,8 @@ def __init__(
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
cache_namespace=cache_namespace,
http_client=http_client,
request_timeout=request_timeout,
**kwargs,
)

Expand Down Expand Up @@ -316,6 +323,7 @@ def copy(
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
http_client: Optional[httpx.AsyncClient] = None,
request_timeout: Optional[int] = None,
**kwargs,
) -> AsyncPortkey:
return self.__class__(
Expand Down Expand Up @@ -344,6 +352,7 @@ def copy(
azure_api_version=azure_api_version or self.azure_api_version,
cache_namespace=cache_namespace or self.cache_namespace,
http_client=http_client or self._client,
request_timeout=request_timeout or self.request_timeout,
**self.kwargs,
**kwargs,
)
Expand Down
1 change: 1 addition & 0 deletions portkey_ai/api_resources/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ class Constructs(BaseModel):
azure_deployment_id: Optional[str] = None
azure_api_version: Optional[str] = None
cache_namespace: Optional[str] = None
request_timeout: Optional[int] = None


class LLMOptions(Constructs, ConversationInput, ModelParams):
Expand Down

0 comments on commit 7ebd68b

Please sign in to comment.