mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 13:36:15 +00:00
core[patch]: support bedrock converse -> openai tool (#27754)
This commit is contained in:
@@ -230,6 +230,30 @@ def anthropic_tool() -> dict:
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def bedrock_converse_tool() -> dict:
|
||||
return {
|
||||
"toolSpec": {
|
||||
"name": "dummy_function",
|
||||
"description": "dummy function",
|
||||
"inputSchema": {
|
||||
"json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arg1": {"description": "foo", "type": "integer"},
|
||||
"arg2": {
|
||||
"description": "one of 'bar', 'baz'",
|
||||
"enum": ["bar", "baz"],
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"required": ["arg1", "arg2"],
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Dummy:
|
||||
def dummy_function(self, arg1: int, arg2: Literal["bar", "baz"]) -> None:
|
||||
"""dummy function
|
||||
@@ -258,6 +282,7 @@ def test_convert_to_openai_function(
|
||||
dummy_tool: BaseTool,
|
||||
json_schema: dict,
|
||||
anthropic_tool: dict,
|
||||
bedrock_converse_tool: dict,
|
||||
annotated_function: Callable,
|
||||
dummy_pydantic: type[BaseModel],
|
||||
runnable: Runnable,
|
||||
@@ -290,6 +315,7 @@ def test_convert_to_openai_function(
|
||||
dummy_tool,
|
||||
json_schema,
|
||||
anthropic_tool,
|
||||
bedrock_converse_tool,
|
||||
expected,
|
||||
Dummy.dummy_function,
|
||||
DummyWithClassMethod.dummy_function,
|
||||
|
Reference in New Issue
Block a user