-
Notifications
You must be signed in to change notification settings - Fork 442
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
feat: allow max context length #2710
base: main
Are you sure you want to change the base?
feat: allow max context length #2710
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 93c3df4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 46 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 |
@parkersm1th-magical is attempting to deploy a commit to the Mastra Team on Vercel. A member of the Team first needs to authorize it. |
📝 Documentation updates detected! You can review documentation updates here |
897b605
to
93c3df4
Compare
This would be super helpful for us |
I'm not sure we should add it. Shouldn't we throw an error instead that the message got to big? If we cut the message from the start, we might not get the expected result. |
Ah i understand now, this trims the context between System (instructions) and user prompt. |
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.
Ok i misread it, it's just context being sliced. Let's remove the dynamic function.
Thank you for contributing!
__updateMaxContextLength(newMaxContextLength: number) { | ||
this.maxContextLength = newMaxContextLength; | ||
this.logger.debug(`[Agents:${this.name}] Max context length updated.`, { | ||
model: this.model, | ||
name: this.name, | ||
}); | ||
} |
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.
Let's remove dynamic updatinhg of max length for now
__updateMaxContextLength(newMaxContextLength: number) { | |
this.maxContextLength = newMaxContextLength; | |
this.logger.debug(`[Agents:${this.name}] Max context length updated.`, { | |
model: this.model, | |
name: this.name, | |
}); | |
} |
Summary
maxContextLength
toAgent
This is a feature that existed in LangChain + LangSmith workflow, allowing for a sticky
systemMessage
(instructions in Mastra terms). Adding this allows for devs to utilize this without having to self implementTests Added