diff --git a/src/client/agents/http_agent.py b/src/client/agents/http_agent.py index 677f668c..d21f1c92 100644 --- a/src/client/agents/http_agent.py +++ b/src/client/agents/http_agent.py @@ -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.")