本页还没有译文
本页 11 段还没译成Tiếng Việt,下面显示的是英文原文。untilFinishReason
还没翻译译自英文(tanstack.com)本页 11 段都还没译
function untilFinishReason(stopReasons): AgentLoopStrategy;Defined in: packages/ai/src/activities/chat/agent-loop-strategies.ts:47
Creates a strategy that continues until a specific finish reason is encountered
Parameters
stopReasons
string[]
Finish reasons that should stop the loop
Returns
AgentLoopStrategy that stops on specific finish reasons
Example
const stream = chat({
adapter: openaiText(),
model: "gpt-4o",
messages: [...],
tools: [weatherTool],
agentLoopStrategy: untilFinishReason(["stop", "length"]),
});AI 翻译查看英文原文