diff --git a/agent/predict.py b/agent/predict.py index 1308aad..1158b64 100644 --- a/agent/predict.py +++ b/agent/predict.py @@ -79,8 +79,8 @@ def serve(port): pass # тихо _ensure_loaded() - print(f"tablet-agent слушает http://127.0.0.1:{port} (порог {THRESHOLD})") - HTTPServer(("127.0.0.1", port), Handler).serve_forever() + print(f"tablet-agent слушает http://0.0.0.0:{port} (порог {THRESHOLD})") + HTTPServer(("0.0.0.0", port), Handler).serve_forever() def main(): diff --git a/app/api/voice/chat/route.ts b/app/api/voice/chat/route.ts index c8b6c39..cacc585 100644 --- a/app/api/voice/chat/route.ts +++ b/app/api/voice/chat/route.ts @@ -81,7 +81,7 @@ function historyToAnthropicMessages(history: HistoryMessage[]): any[] { if (msg.content) content.push({ type: 'text', text: msg.content }) for (const tc of msg.tool_calls) { let input: any = {} - try { input = JSON.parse(tc.function.arguments) } catch {} + try { const _p = JSON.parse(tc.function.arguments); if (_p && typeof _p === 'object' && !Array.isArray(_p)) input = _p } catch {} content.push({ type: 'tool_use', id: tc.id, name: tc.function.name, input }) } result.push({ role: 'assistant', content })