Skip to content

Commit f3e999e

Browse files
authored
Merge pull request #328 from UiPath/fix/uipath-openai-auth-bearer-header
fix(llms): use Authorization Bearer header in UiPathOpenAI
2 parents 7b3cfaa + 4d428d4 commit f3e999e

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/uipath-llamaindex/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.5.12"
3+
version = "0.5.13"
44
description = "Python SDK that enables developers to build and deploy LlamaIndex agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath-llamaindex/src/uipath_llamaindex/llms/_openai.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def __init__(
5050
api_version: str = "2024-10-21",
5151
**kwargs: Any,
5252
):
53+
token = os.environ.get("UIPATH_ACCESS_TOKEN")
5354
default_headers_dict = {
55+
"Authorization": f"Bearer {token}",
5456
"X-UiPath-LlmGateway-ApiFlavor": "auto",
5557
"X-UiPath-LlmGateway-RequestingProduct": "uipath-python-sdk",
5658
"X-UiPath-LlmGateway-RequestingFeature": "llama-index-agent",
@@ -74,7 +76,7 @@ def __init__(
7476
"model": model_value,
7577
"deployment_name": model_value,
7678
"azure_endpoint": f"{base_url}/{vendor_endpoint}",
77-
"api_key": os.environ.get("UIPATH_ACCESS_TOKEN"),
79+
"api_key": "uipath-gateway",
7880
"api_version": api_version,
7981
"is_chat_model": True,
8082
"default_headers": default_headers_dict,

packages/uipath-llamaindex/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)