Spaces:
Sleeping
Sleeping
Deploy None agent
Browse files
main.py
CHANGED
|
@@ -50,7 +50,7 @@ class ChatRequest(BaseModel):
|
|
| 50 |
|
| 51 |
class ChatResponse(BaseModel):
|
| 52 |
status: str
|
| 53 |
-
agent_name: str
|
| 54 |
user_message: str
|
| 55 |
agent_response: str
|
| 56 |
tools_available: List[str]
|
|
@@ -207,7 +207,7 @@ async def root():
|
|
| 207 |
"""Health check and agent info"""
|
| 208 |
return {
|
| 209 |
"status": "online",
|
| 210 |
-
"agent_name": AGENT_CONFIG.get("name"),
|
| 211 |
"agent_id": AGENT_CONFIG.get("agent_id"),
|
| 212 |
"business": AGENT_CONFIG.get("business_context", {}).get("business_name"),
|
| 213 |
"domain": AGENT_CONFIG.get("business_context", {}).get("domain"),
|
|
@@ -235,7 +235,7 @@ async def run_agent(request: ChatRequest) -> ChatResponse:
|
|
| 235 |
|
| 236 |
return ChatResponse(
|
| 237 |
status="success",
|
| 238 |
-
agent_name=AGENT_CONFIG.get("name"),
|
| 239 |
user_message=request.message,
|
| 240 |
agent_response=final_output,
|
| 241 |
tools_available=[tool.__name__ if hasattr(tool, '__name__') else str(tool) for tool in AGENT_TOOLS],
|
|
|
|
| 50 |
|
| 51 |
class ChatResponse(BaseModel):
|
| 52 |
status: str
|
| 53 |
+
agent_name: Optional[str] = None # May be missing in config
|
| 54 |
user_message: str
|
| 55 |
agent_response: str
|
| 56 |
tools_available: List[str]
|
|
|
|
| 207 |
"""Health check and agent info"""
|
| 208 |
return {
|
| 209 |
"status": "online",
|
| 210 |
+
"agent_name": AGENT_CONFIG.get("name", "GenericAgent"),
|
| 211 |
"agent_id": AGENT_CONFIG.get("agent_id"),
|
| 212 |
"business": AGENT_CONFIG.get("business_context", {}).get("business_name"),
|
| 213 |
"domain": AGENT_CONFIG.get("business_context", {}).get("domain"),
|
|
|
|
| 235 |
|
| 236 |
return ChatResponse(
|
| 237 |
status="success",
|
| 238 |
+
agent_name=AGENT_CONFIG.get("name", "GenericAgent"),
|
| 239 |
user_message=request.message,
|
| 240 |
agent_response=final_output,
|
| 241 |
tools_available=[tool.__name__ if hasattr(tool, '__name__') else str(tool) for tool in AGENT_TOOLS],
|