Commit Graph

103 Commits

Author SHA1 Message Date
d328d801f4 fix: mock LLM clients in test_llm_factory to avoid API key requirement
- Add mock_chat_anthropic and mock_chat_deepseek fixtures to conftest.py
- Update test_llm_factory to use monkeypatch and mock fixtures
- Import ChatAnthropic and ChatDeepSeek in conftest.py for spec creation
- Tests now pass without requiring ANTHROPIC_API_KEY or DEEPSEEK_API_KEY
- Execution time reduced from failing after 0.12s to passing in 0.01s

This change allows factory tests to run in isolation without external
dependencies, making them consistent with the API test approach and
suitable for any development environment or CI/CD pipeline.
2026-06-10 16:16:14 -05:00
34053b3fc1 fix: use in-memory checkpointer for API tests to avoid database dependency
- Replace PostgreSQL AsyncPostgresSaver with MemorySaver in test fixtures
- Create test_app fixture with test_lifespan using in-memory dependencies
- Mock LLM model to avoid requiring API keys during tests
- Update test_api.py to use test_app fixture instead of production app
- Fix test_root endpoint URL to match root_path configuration
- All API tests now pass without requiring external services (0.06s vs 30s+ timeout)

This change allows tests to run in isolation without PostgreSQL or API keys,
making them faster and more reliable for CI/CD and local development.
2026-06-10 16:06:10 -05:00
7fa4d12e30 fix: test 2026-06-10 15:37:37 -05:00
8dffd91bd7 fix: url hook 2026-06-10 15:34:32 -05:00
eb0f03ab7e fix: Update host ip 2026-04-07 02:41:29 -05:00
b02b102b95 feat(prompt): Update prompt products detail 2026-04-07 02:39:36 -05:00
6bb47db492 fix: hardcode server_url on send message 2026-04-05 11:03:35 -05:00
2bae089e80 Load MCP server config from environment variables 2026-04-05 10:47:56 -05:00
e10b7f1dec fix: Hardcode server_url 2026-04-05 10:27:11 -05:00
bd0be9845f feat: improve docker containerization and add LLM timeout 2026-04-05 00:30:59 -05:00
c985b357b7 docs: add docker build and push instructions to README 2026-04-03 10:00:19 -05:00
1ddf27b2f1 fix: add formatting guidelines for presenting options as bullet lists 2026-03-19 22:01:33 -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
12822784b0 fix: clean up system prompt rules and reorder available tools 2026-03-19 18:43:50 -05:00
f4bdfc62ab fix: improve Naliia system prompt with corrections and new instructions 2026-03-19 18:28:12 -05:00
abb46c9547 fix: access checkpointer state via channel_values to resolve KeyError 2026-03-19 18:14:19 -05:00
e9b8b21807 revert: re-enable identify_customer node in agent graph
- Move test.ipynb to tests/notebooks for RPC testing
2026-03-18 22:38:05 -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
9b1108da5c refactor: rename DockerfileTest back to Dockerfile 2026-03-18 12:24:13 -05:00
ca1045effb refactor: create DockerfileTest with hot-reload support and volume mounts
- Rename Dockerfile to DockerfileTest for development variant
- Remove poetry.lock from COPY (regenerated during build)
- Add --reload flag to uvicorn for development
- Add src volume mount in docker-compose for hot-reload
- Update docker-compose to use DockerfileTest
2026-03-18 12:20:19 -05:00
bb8ea790f5 fix: origin party 2026-03-13 13:36:45 -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
f90da6a14b fix: restore 'party.' key in customer identification 2026-03-11 00:13:59 -05:00
6eb381080a refactor: move customer identification to agent node
- Add identify_customer_node to Agent class for customer lookup
- Webhook now only passes customer_phone to agent state
- Customer identification happens in agent flow: START -> identify_customer -> llm_call -> tool_node -> END
2026-03-11 00:08:58 -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
4669ae2289 fix: use async aget method for AsyncPostgresSaver checkpointer 2026-03-10 23:02:08 -05:00
4b2cf1e568 feat: add customer phone to agent state on new conversations 2026-03-09 21:10:31 -05:00
f78908ad88 feat: improve tool documentation and timezone handling 2026-03-09 20:46:16 -05:00
15c8589826 fix: update Dockerfile for poetry installation and fix pyproject.toml 2026-03-09 13:39:38 -05:00
f3d9e452e2 fix: Delete unncesary file INDEX.md 2026-03-08 01:06:28 -05:00
f336da0cee fix: Delete mcp dir 2026-03-08 00:56:36 -05:00
c21de5b049 fix: Update dependencies 2026-03-08 00:56:10 -05:00
992ae0219d fix: add mcp dependency required by fastmcp 2026-03-08 00:45:11 -05:00
c9ddbc4126 fix: set PYTHONPATH for module discovery in Docker 2026-03-08 00:40:56 -05:00
8a999bcc6e fix: use --no-root to skip package installation in Docker 2026-03-08 00:38:20 -05:00
ac0596183c fix: allow README.md in Docker build context 2026-03-08 00:24:44 -05:00
a168b20988 fix: copy README.md for Poetry package installation 2026-03-08 00:22:20 -05:00
546b63eb7b fix: use correct Poetry flag --without dev 2026-03-08 00:21:10 -05:00
3431a37119 feat: add Docker deployment for the bot
- Add Dockerfile for Python 3.13 container
- Update docker-compose with naliia_bot service
- Add DB_HOST config for container networking
- Add .dockerignore for build optimization
- Update README with Docker documentation
2026-03-08 00:18:51 -05:00
c5022ff210 docs: update README with current project structure 2026-03-08 00:09:45 -05:00
0a157288b7 docs: add AGENTS.md for agent documentation guidelines 2026-03-08 00:07:44 -05:00
074da750d0 feat: update dependencies 2026-03-07 22:52:05 -05:00
d0d451829e feat: Add tools 2026-03-07 22:51:40 -05:00
133c54c4d0 feat: Add Tools with the objetive to create schedules 2026-03-07 22:50:24 -05:00
0dc1b4990c chore: Se usa deepseek modelo 2026-03-05 20:12:30 -05:00
c59169ac7d chore: Parametro del Modelo. 2026-03-05 20:12:15 -05:00
9910fb3023 feat: Tool para calcular la fecha del dia siguiente. 2026-03-05 20:11:45 -05:00
1e5fa373ff feat: Se ajusta el prompt para que sea mas conciso y corto. 2026-03-05 20:10:41 -05:00