File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
responses_api_agents/simple_agent
responses_api_models/vllm_model Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 4343class SimpleAgentConfig (BaseResponsesAPIAgentConfig ):
4444 resources_server : ResourcesServerRef
4545 model_server : ModelServerRef
46- # max_steps: int = None
47- max_steps : int = 1
46+ max_steps : int = None
4847
4948
5049class SimpleAgentRunRequest (BaseRunRequest ):
@@ -102,6 +101,9 @@ async def responses(
102101 output = model_response .output
103102 new_outputs .extend (output )
104103
104+ if model_response .incomplete_details and model_response .incomplete_details .reason == "max_output_tokens" :
105+ break
106+
105107 all_fn_calls : List [NeMoGymResponseFunctionToolCall ] = [o for o in output if o .type == "function_call" ]
106108 all_output_messages : List [NeMoGymResponseOutputMessage ] = [
107109 o for o in output if o .type == "message" and o .role == "assistant"
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ async def responses(
132132 metadata = body .metadata ,
133133 instructions = body .instructions ,
134134 user = body .user ,
135+ incomplete_details = {"reason" : "max_output_tokens" } if choice .finish_reason == "length" else None ,
135136 )
136137
137138 async def chat_completions (
You can’t perform that action at this time.
0 commit comments