Skip to content

Commit a119214

Browse files
committed
Pick fix from #359 and revert max_steps = 1.
Signed-off-by: Peter Jin <[email protected]>
1 parent 35d5445 commit a119214

File tree

2 files changed

+5
-2
lines changed
  • responses_api_agents/simple_agent
  • responses_api_models/vllm_model

2 files changed

+5
-2
lines changed

responses_api_agents/simple_agent/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class 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

5049
class 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"

responses_api_models/vllm_model/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)