-
Notifications
You must be signed in to change notification settings - Fork 931
refactor: clean up LLM generate methods and improve type safety #5865
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
base: main
Are you sure you want to change the base?
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 2af1f3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Major refactoring of LLM-related code to improve type safety and reduce duplication, focusing on code organization and type definitions.
- Created new
packages/core/src/llm/model/base.types.ts
to centralize LLM-related type definitions and improve type organization - Consolidated duplicate code in Agent class by extracting
prepareLLMOptions()
fromgenerate()
andstream()
methods - Enhanced type safety by adding proper generic constraints and improving callback type definitions in
packages/core/src/llm/model/base.ts
- Warning: Found potentially unintended
console.log
statement inpackages/core/src/agent/index.ts
that should be removed - Fixed type annotations in test files to properly handle
MockLanguageModelV1
instances
13 files reviewed, 6 comments
Edit PR Review Bot Settings | Greptile
faae086
to
7dbfa8e
Compare
f1e0630
to
ebc03bb
Compare
@greptile-apps |
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.
PR Summary
Comprehensive implementation of agent working memory and UI improvements across the platform.
- Added working memory management UI with new
agent-working-memory-context.tsx
context provider and hook-based state management - Implemented working memory API endpoints in server and deployer packages with proper validation and error handling
- Replaced legacy Cohere client with direct API calls in
CohereRelevanceScorer
, improving error handling and reducing dependencies - Enhanced model settings UI with new provider-specific configuration options and JSON editor in
agent-advanced-settings.tsx
- Added comprehensive icon set for different LLM providers including Anthropic, Azure, OpenAI, Groq and others with consistent styling
145 files reviewed, 6 comments
Edit PR Review Bot Settings | Greptile
126c04f
to
fd6e316
Compare
Braintrust eval reportNo experiments to report |
fd6e316
to
ff82fd3
Compare
ff82fd3
to
2af1f3a
Compare
Summary
Changes Made
generate()
andstream()
methods by extracting common logic intoprepareLLMOptions()
base.types.ts
for better modularityTest plan
🤖 Generated with Claude Code