Skip to content

errors on stream recommandation when performing non-stream request with large max token #194

Description

@jingkaihe

Way to reproduce

  • Build a normal claude sdk request
  • on the message params set the max token to a high number (e.g. the highest 64000)
  • Make the request

Expected behaviour

Despite it's not recommended by Anthropic, the request is fired off.

Actual behaviour

The go sdk returns error streaming is strongly recommended for operations that may take longer than 10 minutes. coming from https://github.com/anthropics/anthropic-sdk-go/blob/v1.2.0/message.go#L4462-L4476

As it turned out it is fairly trivial to switch to the stream api, nonetheless the error message is very confusing from UX point of view, as the message appears to be purely advisory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAn issue with the APIenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions