Skip to content
Source
Sign inSign up
TanStack/ai

Anthropic Adapter does not always return valid JSON #282

Send to my agent
ClosedLeftwitch(GitHub profile, opens in a new tab) opened this issue 4 comments

TanStack AI version

0.4.2

Framework/Library version

bun 1.3.6

Describe the bug and the steps to reproduce it

With some prompts you get malformed JSON so zod cannot validate it. However Anthropic itself offers structured outputs, we should use those insteadof forcing the LLM to use a tool for responding.

none

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I am also opening a PR that solves the problem along side this issue

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. is this still an issue as of today with the latest versions?

  2. github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: author

  3. Thanks for the report, @Leftwitch! To help us reproduce this, could you add a minimal reproduction?

    A runnable example makes fixes dramatically faster — you can fork one of the official examples, or use StackBlitz / CodeSandbox. For TypeScript-only issues, a TS Playground link works too.

    Automated triage — a maintainer will follow up.
  4. I'm closing this. It's not repeatable on latest versions

  5. tombeckenham closed this

Sign in to join this conversation.