Commit Graph

14 Commits

Author SHA1 Message Date
2bae089e80 Load MCP server config from environment variables 2026-04-05 10:47:56 -05:00
30345538f7 fix: add MCP result validation, improve agent error handling and state management
- Add `_extract_mcp_content_text()` helper in naliia_tools.py to safely
  extract text from MCP results, preventing IndexError on empty content
- Replace all direct `result.content[0].text` accesses with safe helper
- Improve customer identification with preservation of existing state
- Add proper JSON parsing with fallback and error handling
- Simplify webhook state management (use agent's checkpointer internally)
- Update system prompt to remove check_mcp_connection tool reference
- Fix tests to use async mocks and correct expected values
2026-03-19 21:11:28 -05:00
949dacd59c enhance: auto-identify customers and add new tools
- Agent now auto-calls find_customer_by_identifier when user provides identifier
- Added register_customer and check_mcp_connection tools
- Refactored chat_hook to resume existing conversations from state
- Reduced default max_iterations (100) and timeout (15s)
2026-03-18 22:30:02 -05:00
ea3da00b95 fix: use TestClient as context manager to trigger lifespan 2026-03-18 15:05:01 -05:00
8d20656a37 fix: pass customer_id directly to tools instead of state
- Avoids JSON serialization errors with HumanMessage objects
- schedule_appointment now receives customer_id as direct parameter
2026-03-11 00:29:03 -05:00
e92cb969e9 feat: personalize agent interaction with customer name
- Update prompt to use customer name for personalized greetings
- Pass state to tools via agent execution
- schedule_appointment now gets customer_id from state if not provided
2026-03-11 00:21:55 -05:00
5de87b7c8f feat: add find_customer_by_identifier tool and customer state fields
- Add find_customer_by_identifier tool to NaliiaTools
- Add customer_name and customer_id to MessagesState schema
- Update NALIIA_PROMPT template with new tools
- Integrate customer lookup in chat webhook using phone number
2026-03-11 00:02:56 -05:00
f78908ad88 feat: improve tool documentation and timezone handling 2026-03-09 20:46:16 -05:00
133c54c4d0 feat: Add Tools with the objetive to create schedules 2026-03-07 22:50:24 -05:00
9910fb3023 feat: Tool para calcular la fecha del dia siguiente. 2026-03-05 20:11:45 -05:00
91b3ed4070 chore: Update timezone America/Bogota 2026-03-05 10:08:29 -05:00
6fc6338413 fix: PEP8 Style 2026-03-04 16:20:56 -05:00
66fe0a2a13 feat: Add NaliiaTools 2026-02-16 16:35:15 -05:00
20ff3dc8c9 feat: Add tools strategy 2026-02-16 10:50:40 -05:00