mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
test bedrock tool call names
This commit is contained in:
parent
43ff70348d
commit
42617c207a
1 changed files with 13 additions and 1 deletions
|
|
@ -1006,7 +1006,7 @@ def test_bedrock_tool_calling():
|
|||
"type": "function",
|
||||
"function": {
|
||||
"name": "-DoSomethingVeryCool-forLitellm_Testin999229291-0293993",
|
||||
"description": "do something very cool",
|
||||
"description": "use this to get the current weather",
|
||||
"parameters": {"type": "object", "properties": {}},
|
||||
},
|
||||
}
|
||||
|
|
@ -1016,6 +1016,18 @@ def test_bedrock_tool_calling():
|
|||
print("bedrock response")
|
||||
print(response)
|
||||
|
||||
# Assert that the tools in response have the same function name as the input
|
||||
_choice_1 = response.choices[0]
|
||||
if _choice_1.message.tool_calls is not None:
|
||||
print(_choice_1.message.tool_calls)
|
||||
for tool_call in _choice_1.message.tool_calls:
|
||||
_tool_Call_name = tool_call.function.name
|
||||
if _tool_Call_name is not None and "DoSomethingVeryCool" in _tool_Call_name:
|
||||
assert (
|
||||
_tool_Call_name
|
||||
== "-DoSomethingVeryCool-forLitellm_Testin999229291-0293993"
|
||||
)
|
||||
|
||||
|
||||
def test_bedrock_tools_pt_valid_names():
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue