aws-samples / bedrock-access-gateway

OpenAI-Compatible RESTful APIs for Amazon Bedrock
MIT No Attribution
124 stars 24 forks source link

Tools calling in bedrock #29

Open swosty opened 3 days ago

swosty commented 3 days ago

Describe the bug In the schema AssistantMessage(BaseModel): role: Literal["assistant"] = "assistant" content: str |list | None tool_calls: list[ToolCall] | None = None.

The content should be a str or a list (for bedrock models) cause when we send the message and get the tool use request from response the assistant message has a list in the content s which can be passed as is. Same can be done for UserMessage

Please complete the following information:

To Reproduce Steps to reproduce the behavior. If possible, please share an example request.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).

Additional context Add any other context about the problem here.