Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add huggingface_base_url parameter to support autocompletions for x-portkey-huggingface-base-url header #209

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -72,6 +72,7 @@ def __init__(
azure_resource_name: Optional[str] = None,
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
huggingface_base_url: Optional[str] = None,
http_client: Optional[httpx.Client] = None,
request_timeout: Optional[int] = None,
strict_open_ai_compliance: Optional[bool] = None,
Expand Down Expand Up @@ -100,6 +101,7 @@ def __init__(
self.azure_resource_name = azure_resource_name
self.azure_deployment_id = azure_deployment_id
self.azure_api_version = azure_api_version
self.huggingface_base_url = huggingface_base_url
self.cache_namespace = cache_namespace
self.request_timeout = request_timeout
self.strict_open_ai_compliance = strict_open_ai_compliance
Expand Down Expand Up @@ -128,6 +130,7 @@ def __init__(
azure_resource_name=azure_resource_name,
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
huggingface_base_url=huggingface_base_url,
cache_namespace=cache_namespace,
request_timeout=request_timeout,
strict_open_ai_compliance=strict_open_ai_compliance,
Expand Down Expand Up @@ -559,6 +562,7 @@ def __init__(
azure_resource_name: Optional[str] = None,
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
huggingface_base_url: Optional[str] = None,
http_client: Optional[httpx.AsyncClient] = None,
request_timeout: Optional[int] = None,
strict_open_ai_compliance: Optional[bool] = None,
Expand Down Expand Up @@ -587,6 +591,7 @@ def __init__(
self.azure_resource_name = azure_resource_name
self.azure_deployment_id = azure_deployment_id
self.azure_api_version = azure_api_version
self.huggingface_base_url = huggingface_base_url
self.cache_namespace = cache_namespace
self.request_timeout = request_timeout
self.strict_open_ai_compliance = strict_open_ai_compliance
Expand Down Expand Up @@ -615,6 +620,7 @@ def __init__(
azure_resource_name=azure_resource_name,
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
huggingface_base_url=huggingface_base_url,
cache_namespace=cache_namespace,
request_timeout=request_timeout,
strict_open_ai_compliance=strict_open_ai_compliance,
Expand Down
8 changes: 8 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_resource_name: Optional[str] = None,
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
huggingface_base_url: Optional[str] = None,
http_client: Optional[httpx.Client] = None,
request_timeout: Optional[int] = None,
strict_open_ai_compliance: Optional[bool] = None,
Expand Down Expand Up @@ -93,6 +94,7 @@ def __init__(
azure_resource_name=azure_resource_name,
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
huggingface_base_url=huggingface_base_url,
cache_namespace=cache_namespace,
http_client=http_client,
request_timeout=request_timeout,
Expand Down Expand Up @@ -150,6 +152,7 @@ def copy(
azure_resource_name: Optional[str] = None,
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
huggingface_base_url: Optional[str] = None,
http_client: Optional[httpx.Client] = None,
request_timeout: Optional[int] = None,
strict_open_ai_compliance: Optional[bool] = None,
Expand Down Expand Up @@ -179,6 +182,7 @@ def copy(
azure_resource_name=azure_resource_name or self.azure_resource_name,
azure_deployment_id=azure_deployment_id or self.azure_deployment_id,
azure_api_version=azure_api_version or self.azure_api_version,
huggingface_base_url=huggingface_base_url or self.huggingface_base_url,
cache_namespace=cache_namespace or self.cache_namespace,
http_client=http_client or self._client,
request_timeout=request_timeout or self.request_timeout,
Expand Down Expand Up @@ -246,6 +250,7 @@ def __init__(
azure_resource_name: Optional[str] = None,
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
huggingface_base_url: Optional[str] = None,
http_client: Optional[httpx.AsyncClient] = None,
request_timeout: Optional[int] = None,
strict_open_ai_compliance: Optional[bool] = None,
Expand Down Expand Up @@ -275,6 +280,7 @@ def __init__(
azure_resource_name=azure_resource_name,
azure_deployment_id=azure_deployment_id,
azure_api_version=azure_api_version,
huggingface_base_url=huggingface_base_url,
cache_namespace=cache_namespace,
http_client=http_client,
request_timeout=request_timeout,
Expand Down Expand Up @@ -332,6 +338,7 @@ def copy(
azure_resource_name: Optional[str] = None,
azure_deployment_id: Optional[str] = None,
azure_api_version: Optional[str] = None,
huggingface_base_url: Optional[str] = None,
http_client: Optional[httpx.AsyncClient] = None,
request_timeout: Optional[int] = None,
strict_open_ai_compliance: Optional[bool] = None,
Expand Down Expand Up @@ -361,6 +368,7 @@ def copy(
azure_resource_name=azure_resource_name or self.azure_resource_name,
azure_deployment_id=azure_deployment_id or self.azure_deployment_id,
azure_api_version=azure_api_version or self.azure_api_version,
huggingface_base_url=huggingface_base_url or self.huggingface_base_url,
cache_namespace=cache_namespace or self.cache_namespace,
http_client=http_client or self._client,
request_timeout=request_timeout or self.request_timeout,
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_resource_name: Optional[str] = None
azure_deployment_id: Optional[str] = None
azure_api_version: Optional[str] = None
huggingface_base_url: Optional[str] = None
cache_namespace: Optional[str] = None
request_timeout: Optional[int] = None

Expand Down
Loading