-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(max-tokens): anthropic models streaming vs non-streaming #2999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile OverviewGreptile SummaryThis PR implements differentiated token limits for Anthropic models based on whether requests are streaming or non-streaming, addressing timeout issues with non-streaming requests. Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Agent
participant Provider as Anthropic/Bedrock Provider
participant Models as models.ts
participant API as Anthropic/Bedrock API
User->>Agent: Configure agent with model & maxTokens
Agent->>Provider: executeRequest(model, stream, maxTokens)
alt maxTokens provided by user
Provider->>Provider: Use Number.parseInt(request.maxTokens)
else maxTokens not provided
Provider->>Models: getMaxOutputTokensForModel(model, stream)
alt Streaming request
Models-->>Provider: Return maxOutputTokens.max (e.g., 64000)
else Non-streaming request
Models-->>Provider: Return maxOutputTokens.default (e.g., 4096)
end
end
Provider->>API: API call with determined max_tokens
API-->>Provider: Response (within token limit)
Provider-->>Agent: ProviderResponse
Agent-->>User: Generated content
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Summary
Anthropic models streaming vs non-streaming token limits.
Type of Change
Testing
Tested manually with @Sg312
Checklist