debug: check result keys in main.py

This commit is contained in:
opencode committed 2026-03-23 18:05:36 +01:00
1 parent b22297a5d4
commit e7cd792954
1 file changed
+2
+2
View File
@@ -1139,6 +1139,7 @@ def main():
result = agent.invoke({"messages": [HumanMessage(content=user_input)]})
# Extract the AI's response (works for both simple and tool agent)
print(f"MAIN: result keys={result.keys()}")
if "response" in result:
# OllamaToolAgent returns a separate response field
response_text = result["response"]
@@ -1146,6 +1147,7 @@ def main():
# Simple agent returns the last message
ai_message = result["messages"][-1]
response_text = ai_message.content if hasattr(ai_message, 'content') else str(ai_message)
print(f"MAIN: response_text={response_text[:100] if response_text else 'EMPTY'}...")
print(f"\n🤖 LangCode: {response_text}")
except Exception as e: