Skip to content

Claude: Tools without arguments #238

@pintonunes

Description

@pintonunes

When using Claude with Tools that dont have arguments, the eino tool component fails with "failed to unmarshal arguments in json" (empty string)

This happens cause the empty json string is stripped from the arguments.
https://github.com/cloudwego/eino-ext/blame/a2545a66f5cf63a9a582182fbff72bf752ec38c9/components/model/claude/claude.go#L625

This only happens when streaming and I understand why you removing the {}.

I dont really know where to fix this. But probably add here:
https://github.com/cloudwego/eino/blob/e17d69d5a166100226cd1213c9069879438a55d5/components/tool/utils/invokable_func.go#L135

a check like, if arguments == "" then arguments == "{}"

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