[Backend] Chat Interface + CrewAI Integration #17
Reference in New Issue
Block a user
Delete Branch "fix/issue-6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement chat interface with CrewAI for natural language to strategy config parsing as described in issue #6.
Changes Made
Modified files:
src/backend/app/services/ai_agent/llm_connector.py- MiniMax LLM connector:MiniMaxLLMclass extending CrewAI LLM base classMiniMaxConnectorclass withchat()andparse_strategy()methodssrc/backend/app/services/ai_agent/crew.py- CrewAI crew implementation:StrategyValidatorclass validating conditions and actionsStrategyExplainerclass generating user-friendly explanationsTradingCrewclass orchestrating the agentscreate_trading_designer_agent(),create_strategy_validator_agent(),create_strategy_explainer_agent()get_trading_crew()factory functionsrc/backend/app/api/bots.py- Chat endpoint update:POST /api/bots/{id}/chatwith CrewAI integrationBotChatResponsewith response, strategy_config, and success flagsrc/backend/app/db/schemas.py- New schemas:BotChatRequest- Request schema for chat endpointBotChatResponse- Response schema with response, strategy_config, successFeatures Implemented
strategy_configJSONSupported Conditions (MVP)
price_drop- Token price drops by X%price_rise- Token price rises by X%volume_spike- Trading volume increases X%price_level- Price crosses above/below XDependencies
Related Issue
Fixes #6
lgtm