feat: implement conversational AI agent with tool-calling #52

Merged
shoko merged 1 commits from feat/conversational-agent-with-tools into main 2026-04-10 09:39:45 +02:00
Owner

Summary

Prototype implementation that allows:

  1. Normal conversation with the AI (no forced JSON output)
  2. Tool-calling to update trading strategies when user provides specific parameters

Changes

New File: conversational.py

Created ConversationalAgent using CrewAI with tools:

  • : Check current bot strategy
  • : Update bot's trading configuration

Updated: bots.py

Simplified chat endpoint to always use ConversationalAgent instead of TradingCrew

How it works

Normal Conversation

User: "What is this bot?"
AI: Responds conversationally about the trading platform

Strategy Update (Tool Calling)

User: "I want take profit at 200%"
AI: Calls update_trading_strategy tool → Updates bot config

Testing

Tested basic chat:

Note

This is a prototype. The tools (get_current_strategy, update_trading_strategy)
need proper database session handling for production use.

Refs #51

## Summary Prototype implementation that allows: 1. Normal conversation with the AI (no forced JSON output) 2. Tool-calling to update trading strategies when user provides specific parameters ## Changes ### New File: conversational.py Created ConversationalAgent using CrewAI with tools: - : Check current bot strategy - : Update bot's trading configuration ### Updated: bots.py Simplified chat endpoint to always use ConversationalAgent instead of TradingCrew ## How it works ### Normal Conversation User: "What is this bot?" AI: Responds conversationally about the trading platform ### Strategy Update (Tool Calling) User: "I want take profit at 200%" AI: Calls update_trading_strategy tool → Updates bot config ## Testing Tested basic chat: ## Note This is a prototype. The tools (get_current_strategy, update_trading_strategy) need proper database session handling for production use. Refs #51
shoko added 1 commit 2026-04-10 07:00:36 +02:00
Prototype implementation that allows:
1. Normal conversation with the AI
2. Tool-calling to update trading strategies

Created new ConversationalAgent that uses CrewAI with tools:
- get_current_strategy: Check current bot strategy
- update_trading_strategy: Update bot's trading configuration

The agent can now respond to questions like 'What is this?' without
forcing JSON output, and can update strategies when user provides
specific parameters.

Refs #51
han approved these changes 2026-04-10 09:37:47 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 32cd7184ea into main 2026-04-10 09:39:45 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#52