Replies: 1 comment 3 replies
-
you can implement your own export type StopCondition<TOOLS extends ToolSet> = (options: {
steps: Array<StepResult<TOOLS>>;
}) => PromiseLike<boolean> | boolean; |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I provided the model with a web search tool, but some models use the tool excessively (e.g., searching more than 10 times in one session), which affects the user experience. So, I want to limit the search to a maximum of 5 times in one Q&A session and then respond based on those 5 search results.
I tried
stopWhen: stepCountIs(5)
, but this stops after 5 searches. I also tried usingprepareStep
, returning an emptyactiveTools
after step>=5, but that didn't work either.Has anyone ever done something like this?
Beta Was this translation helpful? Give feedback.
All reactions