Skip to content

Add support to claude 3.7 sonnet with extended output#489

Description

@rafaelfbs

Hi 馃憢馃徎, first of all, I'm loving this project! Keep up the great work on this awesome project.

Anthropic recently released Claude 3.7 Sonnet, which supports an output of up to 128K tokens. I鈥檇 love to use this extended output in srcbook. What changes would be needed to support this?

I made a naive solution by updating the generateText call to set maxTokens: 128000 and modifying the createAnthropic call to add the anthropic-beta header when using claude-3.7-sonnet models.

Would this be the right approach, or are there other places that need updates?
I think the best solution would be a configuration for max tokens and maybe a check for values > 8192 (the original maxTokens).

Happy to help with implementation if needed! 馃殌

Here is the list of Anthropic models.
Image

And this is the info for the extended output header.
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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