Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bedrock: "Parameter 'tools' is not allowed and will be ignored." #975

Closed
lambda-science opened this issue Aug 13, 2024 · 0 comments · Fixed by #976
Closed

Bedrock: "Parameter 'tools' is not allowed and will be ignored." #975

lambda-science opened this issue Aug 13, 2024 · 0 comments · Fixed by #976
Assignees
Labels
bug Something isn't working P3

Comments

@lambda-science
Copy link
Contributor

Describe the bug
When trying to use function calling with AWS Bedrock, the current integration ignore the tools keyword argument.

generator_json = AmazonBedrockChatGenerator(
    model="anthropic.claude-3-haiku-20240307-v1:0",
    aws_region_name=Secret.from_token("eu-west-3"),
    generation_kwargs={"temperature": 0, "max_tokens": 4096}, aws_profile_name=Secret.from_token("sandbox")
)
response = generator_json.run(
    messages=messages,
    generation_kwargs={"tools":tools}
)

08/13/2024 01:25:03 PM Parameter 'tools' is not allowed and will be ignored.
Lines responsible of this error:

Describe your environment (please complete the following information):

  • OS: [e.g. iOS]: Linux Docker
  • Haystack version: 2.3.1
  • Integration version: amazon-bedrock-haystack==0.9.3

Additional infos:
Also this integration could be modernized with the new "Converse" API from Bedrock, that allow cross-model integration (same API for all providers), thus making easier tools calling.
https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html

To use tools with a model you can use the Converse API (Converse or ConverseStream). The example code in this topic uses the Converse API to show how to use a tool that gets the most popular song for a radio station. For general information about calling the Converse API, see Use the Converse API.

It is possible to use tools with the base inference operations (InvokeModel or InvokeModelWithResponseStream).

The current integration with the kwargs tools is part of the old InvokeModel inference operation. But this would be a futur concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3
Projects
None yet
3 participants