{"id":24625347,"url":"https://github.com/oscarcitoz/conversation-engine","last_synced_at":"2026-04-17T17:31:20.320Z","repository":{"id":273945083,"uuid":"921396681","full_name":"oscarcitoz/conversation-engine","owner":"oscarcitoz","description":"Conversation Engine API is a Python-based microservice built with FastAPI, integrating with AI providers via LangChain. It communicates with an external Agent Config service to retrieve dynamic agent configurations, enabling intelligent, context-aware conversations for various tasks like product inquiries and currency conversions.","archived":false,"fork":false,"pushed_at":"2025-02-02T22:51:11.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T08:49:29.815Z","etag":null,"topics":["agent-configuration","ai-integration","chatbot","conversational-ai","fastapi","langchain","microservice","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oscarcitoz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-23T21:47:17.000Z","updated_at":"2025-02-02T22:51:14.000Z","dependencies_parsed_at":"2025-01-30T23:23:44.268Z","dependency_job_id":null,"html_url":"https://github.com/oscarcitoz/conversation-engine","commit_stats":null,"previous_names":["oscarcitoz/conversation-engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oscarcitoz/conversation-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarcitoz%2Fconversation-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarcitoz%2Fconversation-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarcitoz%2Fconversation-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarcitoz%2Fconversation-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarcitoz","download_url":"https://codeload.github.com/oscarcitoz/conversation-engine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarcitoz%2Fconversation-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31938598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-configuration","ai-integration","chatbot","conversational-ai","fastapi","langchain","microservice","python"],"created_at":"2025-01-25T04:33:03.170Z","updated_at":"2026-04-17T17:31:20.297Z","avatar_url":"https://github.com/oscarcitoz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conversational Engine Microservice\n\nThis microservice is built using Python with FastAPI and communicates with external services like `agent-config` and AI providers to handle user queries. It utilizes the LangChain library to interact with the AI models and generate appropriate responses based on the agent configuration.\n\n## Construcción y Ejecución con Docker\n\n### Usando Docker\n\n1. Construir la imagen:\n```bash\ndocker build -t conversational-agent .\n```\n\n2. Ejecutar el contenedor:\n```bash\ndocker run -p 8000:8000 conversational-agent\n```\n\nLa API estará disponible en `http://localhost:8000`\n\n\n## Setup Local\n\n1. Clone this repository.\n2. Install the necessary dependencies using pip:\n\n```bash\npip install -r requirements.txt\n```\n\n3. Run the FastAPI application:\n\n```bash\nuvicorn app:app --reload\n```\n\n4. The service will be running on `http://localhost:8000`.\n\n## Documentación API\n\n### Colección Postman\nPuedes encontrar todos los endpoints y ejemplos en nuestra colección de Postman:\n[Colección Postman](https://sumer-07062021.postman.co/workspace/SUMER~148b538f-9145-4526-8806-bb1cc611d3bd/collection/16642082-01b51a02-01f6-4a39-959e-d1f4675e4bd2?action=share\u0026creator=16642082\u0026active-environment=16640760-5fde9fd8-7328-4098-8d82-c9d5fa254624)\n\n### Documentación Swagger\nUna vez que el servidor esté corriendo, puedes acceder a la documentación Swagger en:\n`http://localhost:8000/docs`\n\n## Features\n\n- **Handles User Queries:** The microservice receives a query from a user and processes it by calling the external `agent-config` service to retrieve the configuration of the agent.\n- **Agent Configuration:** The microservice integrates with an external service (`agent-config`) to fetch the agent configuration based on the query context.\n- **AI Interaction:** Once the agent configuration is retrieved, it uses LangChain to communicate with AI models and provides responses to user queries.\n- **Handles Multiple Agent Types:** The service supports different types of agents, which can be configured according to the query context.\n\n## API Endpoints\n\n### `POST /api/ms/conversational-engine/handle-message`\n\nThis endpoint is used to send a user query to the conversational agent and get a response based on the agent configuration.\n\n#### Request Body\n\n```json\n{\n  \"query\": \"string\", \n  \"agent_id\": \"string (optional)\",\n  \"parameter_prompt\": \"object (optional)\",\n  \"conversation_id\": \"string (optional)\",\n  \"metadata_filter\": \"object (optional)\"\n}\n```\n\n#### Example cURL Commands\n\n1. **Query: \"hola que vendes\"**\n\n```bash\ncurl --location 'http://localhost:8000/api/ms/conversational-engine/handle-message' --header 'Content-Type: application/json' --data-raw '{\n    \"query\": \"hola que vendes\",\n    \"agent_id\": \"mi_primer_agente_base_seller_chat\",\n    \"parameter_prompt\": {\n        \"detail\": {\n            \"store_name\": \"Tienda MundoTech\",\n            \"store_phone\": \"+1-800-555-1234\",\n            \"store_email\": \"contacto@mundotech.com\",\n            \"store_website\": \"https://www.mundotech.com\",\n            \"store_address\": \"Av. Principal 123, Ciudad Tecno, País Tech\",\n            \"store_hours\": {\n                \"monday_to_friday\": \"9:00 AM - 8:00 PM\",\n                \"saturday\": \"10:00 AM - 6:00 PM\",\n                \"sunday\": \"Cerrado\"\n            },\n            \"products\": [\n                {\n                    \"category\": \"Electrónicos\",\n                    \"items\": [\"Laptops\", \"Tablets\", \"Smartphones\", \"Smartwatches\", \"Auriculares Bluetooth\"]\n                },\n                {\n                    \"category\": \"Accesorios de Computación\",\n                    \"items\": [\"Teclados mecánicos\", \"Ratones inalámbricos\", \"Monitores 4K\", \"Cables HDMI\", \"Bases de refrigeración\"]\n                },\n                {\n                    \"category\": \"Hogar Inteligente\",\n                    \"items\": [\"Asistentes de voz\", \"Cámaras de seguridad\", \"Enchufes inteligentes\", \"Luces LED inteligentes\", \"Termostatos inteligentes\"]\n                }\n            ],\n            \"promotions\": [\n                \"10% de descuento en laptops seleccionadas\",\n                \"2x1 en auriculares Bluetooth\",\n                \"Envío gratis en compras mayores a $100\"\n            ],\n            \"return_policy\": \"Aceptamos devoluciones dentro de los 30 días posteriores a la compra con recibo original. Los productos deben estar en condiciones originales.\",\n            \"customer_service_hours\": \"Lunes a viernes de 9:00 AM a 6:00 PM\",\n            \"social_media\": {\n                \"facebook\": \"https://facebook.com/mundotech\",\n                \"instagram\": \"https://instagram.com/mundotech\",\n                \"twitter\": \"https://twitter.com/mundotech\"\n            }\n        }\n    },\n    \"conversation_id\": \"\",\n    \"metadata_filter\": null\n}'\n```\n\n2. **Query: \"ayudame con info para zapatos super start\"**\n\n```bash\ncurl --location 'http://localhost:8000/api/ms/conversational-engine/handle-message' --header 'Content-Type: application/json' --data '{\n    \"query\": \"ayudame con info para zapatos super start\",\n    \"agent_id\": \"mi_primer_agente_info\",\n    \"parameter_prompt\": null,\n    \"conversation_id\": \"\",\n    \"metadata_filter\": null\n}'\n```\n\n3. **Query: \"quiero cambiar 2000mxn a usd\"**\n\n```bash\ncurl --location 'http://localhost:8000/api/ms/conversational-engine/handle-message' --header 'Content-Type: application/json' --data '{\n    \"query\": \"quiero cambiar 2000mxn a usd\",\n    \"agent_id\": null,\n    \"parameter_prompt\": null,\n    \"conversation_id\": \"\",\n    \"metadata_filter\": null\n}'\n```\n\n4. **Query: \"cual es el precio de las supertart dolares en mxn son 200000\"**\n\n```bash\ncurl --location 'http://localhost:8000/api/ms/conversational-engine/handle-message' --header 'Content-Type: application/json' --data '{\n    \"query\": \"cual es el precio de las supertart dolares en mxn son 200000\",\n    \"agent_id\": \"mi_primer_agente_deporte\",\n    \"parameter_prompt\": null,\n    \"conversation_id\": \"\",\n    \"metadata_filter\": null\n}'\n```\n\n## External Services\n\n- **Agent Config Service:** The `agent-config` microservice is responsible for retrieving the configuration of the agent based on the query type. This information is used to customize the response generation.\n- **AI Providers:** The service utilizes LangChain to interact with various AI models and generate answers to user queries based on the agent configuration.\n\n## Dependencies\n\n- FastAPI\n- LangChain\n- Uvicorn\n- Requests\n- JSON\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarcitoz%2Fconversation-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarcitoz%2Fconversation-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarcitoz%2Fconversation-engine/lists"}