-
Notifications
You must be signed in to change notification settings - Fork 88
Add CallSettings properties to DurableAgent for parity with AI SDK Agent #251
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
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Port easier properties from AI SDK Agent class (temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed) to bring DurableAgent closer to functional parity with ToolLoopAgent/Agent class. Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Add examples showing the new CallSettings properties (temperature, maxOutputTokens, topP, etc.) in the DurableAgent documentation. Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
| tools: {}, | ||
| }); | ||
|
|
||
| expect(agent).toBeDefined(); |
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.
@copilot This (and all similar ones in the rest of the tests) is a weak assertion. Can we test that the relevant property actually exists on the class instance?
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.
Updated in cb5acbd. Tests now verify that each property value is correctly stored on the class instance using type assertions (as any) to access the private properties.
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.
@copilot Instead of casting to any, how about we just drop the private statements on the class definition itself. private in TS is kind of dumb anyways.
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.
Done in 528f3ed. Removed private modifiers from all DurableAgent properties and updated tests to access properties directly without type assertions.
Instead of just checking that the agent is defined, tests now verify that each property value is correctly stored on the class instance using type assertions to access private properties. Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Remove private modifiers from class properties and update tests to access properties directly without type assertions, per code review feedback. Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Port easier properties from AI SDK Agent class to DurableAgent class
Plan:
Summary
Successfully ported 8 CallSettings properties from the AI SDK's Agent class to the DurableAgent class:
Properties Added:
temperature- Temperature setting for model output randomnessmaxOutputTokens- Maximum number of tokens to generatetopP- Nucleus sampling parametertopK- Top-K sampling parameterpresencePenalty- Penalty for repeating information from promptfrequencyPenalty- Penalty for repeating words/phrasesstopSequences- Sequences that stop generationseed- Seed for deterministic generationImplementation:
These properties are properly threaded through the call chain from DurableAgent → streamTextIterator → doStreamStep → model.doStream()
Testing:
Documentation:
Security Summary
No security vulnerabilities were discovered during the security scan.
Future Enhancements
This PR focused on the simpler properties (primitives that pass through directly). Additional properties from AgentSettings that could be added in future PRs:
maxRetries- retry configurationtoolChoice- tool selection strategyactiveTools- subset of tools to enableOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.