Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/client/agents/http_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ def inference(self, history: List[dict]) -> str:
pass
else:
resp = resp.json()

# Extract content from OpenAI-compatible API response (vLLM)
if isinstance(resp, dict) and "choices" in resp and len(resp["choices"]) > 0:
message = resp["choices"][0].get("message", {})
content = message.get("content", "")
if content:
return content

# Fallback to return_format if not OpenAI format
return self.return_format.format(response=resp)
time.sleep(_ + 2)
raise Exception("Failed.")