@@ -4414,6 +4414,8 @@ components:
44144414 example:
44154415 - |+
44164416
4417+ stop_server_tools_when:
4418+ $ref: '#/components/schemas/StopServerToolsWhen'
44174419 stream:
44184420 default: false
44194421 description: Enable streaming response
@@ -9831,6 +9833,8 @@ components:
98319833 items:
98329834 type: string
98339835 type: array
9836+ stop_server_tools_when:
9837+ $ref: '#/components/schemas/StopServerToolsWhen'
98349838 stream:
98359839 type: boolean
98369840 system:
@@ -16931,6 +16935,8 @@ components:
1693116935 precedence. Maximum of 256 characters.
1693216936 maxLength: 256
1693316937 type: string
16938+ stop_server_tools_when:
16939+ $ref: '#/components/schemas/StopServerToolsWhen'
1693416940 store:
1693516941 const: false
1693616942 default: false
@@ -17305,6 +17311,121 @@ components:
1730517311 - input
1730617312 - voice
1730717313 type: object
17314+ StopServerToolsWhen:
17315+ description: >-
17316+ Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this
17317+ overrides `max_tool_calls`.
17318+ example:
17319+ - step_count: 5
17320+ type: step_count_is
17321+ - max_cost_in_dollars: 0.5
17322+ type: max_cost
17323+ items:
17324+ $ref: '#/components/schemas/StopServerToolsWhenCondition'
17325+ minItems: 1
17326+ type: array
17327+ StopServerToolsWhenCondition:
17328+ description: A single condition that, when met, halts the server-tool agent loop.
17329+ discriminator:
17330+ mapping:
17331+ finish_reason_is: '#/components/schemas/StopServerToolsWhenFinishReasonIs'
17332+ has_tool_call: '#/components/schemas/StopServerToolsWhenHasToolCall'
17333+ max_cost: '#/components/schemas/StopServerToolsWhenMaxCost'
17334+ max_tokens_used: '#/components/schemas/StopServerToolsWhenMaxTokensUsed'
17335+ step_count_is: '#/components/schemas/StopServerToolsWhenStepCountIs'
17336+ propertyName: type
17337+ example:
17338+ step_count: 5
17339+ type: step_count_is
17340+ oneOf:
17341+ - $ref: '#/components/schemas/StopServerToolsWhenStepCountIs'
17342+ - $ref: '#/components/schemas/StopServerToolsWhenHasToolCall'
17343+ - $ref: '#/components/schemas/StopServerToolsWhenMaxTokensUsed'
17344+ - $ref: '#/components/schemas/StopServerToolsWhenMaxCost'
17345+ - $ref: '#/components/schemas/StopServerToolsWhenFinishReasonIs'
17346+ StopServerToolsWhenFinishReasonIs:
17347+ description: Stop when the upstream model emits this finish reason (e.g. `length`).
17348+ example:
17349+ reason: length
17350+ type: finish_reason_is
17351+ properties:
17352+ reason:
17353+ minLength: 1
17354+ type: string
17355+ type:
17356+ enum:
17357+ - finish_reason_is
17358+ type: string
17359+ required:
17360+ - type
17361+ - reason
17362+ type: object
17363+ StopServerToolsWhenHasToolCall:
17364+ description: Stop after a tool with this name has been called.
17365+ example:
17366+ tool_name: finalize
17367+ type: has_tool_call
17368+ properties:
17369+ tool_name:
17370+ minLength: 1
17371+ type: string
17372+ type:
17373+ enum:
17374+ - has_tool_call
17375+ type: string
17376+ required:
17377+ - type
17378+ - tool_name
17379+ type: object
17380+ StopServerToolsWhenMaxCost:
17381+ description: Stop once cumulative cost across the loop exceeds this dollar threshold.
17382+ example:
17383+ max_cost_in_dollars: 0.5
17384+ type: max_cost
17385+ properties:
17386+ max_cost_in_dollars:
17387+ format: double
17388+ type: number
17389+ type:
17390+ enum:
17391+ - max_cost
17392+ type: string
17393+ required:
17394+ - type
17395+ - max_cost_in_dollars
17396+ type: object
17397+ StopServerToolsWhenMaxTokensUsed:
17398+ description: Stop once cumulative token usage across the loop exceeds this threshold.
17399+ example:
17400+ max_tokens: 10000
17401+ type: max_tokens_used
17402+ properties:
17403+ max_tokens:
17404+ type: integer
17405+ type:
17406+ enum:
17407+ - max_tokens_used
17408+ type: string
17409+ required:
17410+ - type
17411+ - max_tokens
17412+ type: object
17413+ StopServerToolsWhenStepCountIs:
17414+ description: Stop after the agent loop has executed this many steps.
17415+ example:
17416+ step_count: 5
17417+ type: step_count_is
17418+ properties:
17419+ step_count:
17420+ type: integer
17421+ type:
17422+ enum:
17423+ - step_count_is
17424+ type: string
17425+ required:
17426+ - type
17427+ - step_count
17428+ type: object
1730817429 StoredPromptTemplate:
1730917430 example:
1731017431 id: prompt-abc123
0 commit comments