Skip to content

Empty args/inputs when turning streaming on and setting tool choice to any #658

Closed
@kwnath

Description

@kwnath

Description

When calling the Anthropic client with streaming=True and tool_choice={"type": "any"/"tool" } the output returns a tool call but with empty args.

This is problematic for a few other reasons beyond no args being returned. For example, quite a few packages rely on the anthropic-sdk, one of which is langchain-anthropic (ref).

Expected response

I would expect that the output includes the inputs/args required for the tool call when streaming.

Reproduction steps

I've added a notebook to highlight some things:
https://gist.github.com/kwnath/f42737c023767d5effdcca20cb5bd0a6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions