Skip to content

Commit

Permalink
add tool choice body
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-science committed Aug 14, 2024
1 parent 4f5bc5f commit 25ce96d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class AnthropicClaudeChatAdapter(BedrockModelChatAdapter):
"top_k",
"system",
"tools",
"tool_choice",
]

def __init__(self, truncate: Optional[bool], generation_kwargs: Dict[str, Any]):
Expand Down
2 changes: 1 addition & 1 deletion integrations/amazon_bedrock/tests/test_chat_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_tools_use(self, model_name):
messages = []
messages.append(ChatMessage.from_user("What is the most popular song on WZPZ?"))
client = AmazonBedrockChatGenerator(model=model_name)
response = client.run(messages=messages, generation_kwargs={"tools": tools})
response = client.run(messages=messages, generation_kwargs={"tools": tools, "tool_choice": {"type": "any"}})
replies = response["replies"]
assert isinstance(replies, list), "Replies is not a list"
assert len(replies) > 0, "No replies received"
Expand Down

0 comments on commit 25ce96d

Please sign in to comment.