Skip to content

Commit 8469f4d

Browse files
committed
fix(llm): fix boto3 metadata endpoint
1 parent 4a54ac0 commit 8469f4d

File tree

4 files changed

+444
-431
lines changed

4 files changed

+444
-431
lines changed

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-langchain"
3-
version = "0.5.10"
3+
version = "0.5.11"
44
description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath_langchain/agent/tools/extraction_tool.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Process tool creation for UiPath process execution."""
22

3-
from typing import Any
3+
from typing import Any, Optional
44

55
from langchain_core.tools import StructuredTool
66
from langgraph.types import interrupt
7+
from pydantic import BaseModel, Field
78
from uipath.agent.models.agent import AgentIxpExtractionResourceConfig
89
from uipath.eval.mocks import mockable
910
from uipath.platform.attachments import Attachment
@@ -14,6 +15,18 @@
1415
from .utils import sanitize_tool_name
1516

1617

18+
class ExtractionToolInput(BaseModel):
19+
"""Input for extraction tool."""
20+
21+
id: Optional[str] = Field(None, alias="ID")
22+
full_name: str = Field(..., alias="FullName")
23+
mime_type: str = Field(..., alias="MimeType")
24+
metadata: Optional[dict[str, Any]] = Field(None, alias="Metadata")
25+
26+
class Config:
27+
populate_by_name = True
28+
29+
1730
def create_ixp_extraction_tool(
1831
resource: AgentIxpExtractionResourceConfig,
1932
) -> StructuredTool:
@@ -58,7 +71,7 @@ async def extraction_tool_fn(**kwargs: Any) -> ExtractionResponseIXP:
5871
tool = StructuredToolWithOutputType(
5972
name=tool_name,
6073
description=resource.description,
61-
args_schema=Attachment,
74+
args_schema=ExtractionToolInput,
6275
coroutine=extraction_tool_fn,
6376
output_type=ExtractionResponseIXP,
6477
)

src/uipath_langchain/chat/bedrock.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def _check_bedrock_dependencies() -> None:
4444
_check_bedrock_dependencies()
4545

4646
import boto3
47-
import botocore.config
47+
from botocore import UNSIGNED
48+
from botocore.config import Config
4849
from langchain_aws import (
4950
ChatBedrock,
5051
ChatBedrockConverse,
@@ -97,10 +98,11 @@ def get_client(self):
9798
region_name="none",
9899
aws_access_key_id="none",
99100
aws_secret_access_key="none",
100-
config=botocore.config.Config(
101+
config=Config(
102+
signature_version=UNSIGNED,
101103
retries={
102104
"total_max_attempts": 1,
103-
}
105+
},
104106
),
105107
)
106108
client.meta.events.register(
@@ -183,6 +185,7 @@ def __init__(
183185
client = passthrough_client.get_client()
184186
kwargs["client"] = client
185187
kwargs["model"] = model_name
188+
kwargs.setdefault("region_name", "none")
186189
super().__init__(**kwargs)
187190
self.model = model_name
188191
self.retryer = retryer
@@ -244,6 +247,7 @@ def __init__(
244247
client = passthrough_client.get_client()
245248
kwargs["client"] = client
246249
kwargs["model"] = model_name
250+
kwargs.setdefault("region_name", "none")
247251
super().__init__(**kwargs)
248252
self.model = model_name
249253
self.retryer = retryer

0 commit comments

Comments
 (0)