feat(crypto): implement hybrid approach with real-time DexScreener tools

- Add crypto_realtime.py with get_live_token_price and get_live_token_data tools
- Register real-time tools in registry.py (no dependencies required)
- Export tool factories in __init__.py
- Create LiveTokenPriceToolUI component for real-time price display
- Create LiveTokenDataToolUI component for comprehensive market data
- Register tool-ui components in new-chat page

Hybrid Architecture:
- RAG (search_knowledge_base): Historical context, trends from indexed data
- Real-time tools: Current prices, live market data via direct API calls
- AI agent decides which to use based on query intent
This commit is contained in:
API Test Bot 2026-02-04 00:12:32 +07:00
parent f2e38c52a1
commit d20cb8a538
9 changed files with 979 additions and 125 deletions

View file

@ -0,0 +1,130 @@
/**
* Crypto Tool UI Components
*
* These components render rich UI for crypto-related AI tools in the chat interface.
* They follow the conversational UX paradigm where all crypto features are
* AI-callable tools that render inline in the chat.
*/
// Token Analysis - displays comprehensive token analysis
export {
TokenAnalysisToolUI,
TokenAnalysisArgsSchema,
TokenAnalysisResultSchema,
type TokenAnalysisArgs,
type TokenAnalysisResult,
} from "./token-analysis";
// Watchlist Display - shows user's watchlist inline
export {
WatchlistDisplayToolUI,
WatchlistDisplayArgsSchema,
WatchlistDisplayResultSchema,
type WatchlistDisplayArgs,
type WatchlistDisplayResult,
} from "./watchlist-display";
// Action Confirmation - confirms executed actions
export {
ActionConfirmationToolUI,
ActionConfirmationArgsSchema,
ActionConfirmationResultSchema,
type ActionConfirmationArgs,
type ActionConfirmationResult,
} from "./action-confirmation";
// Alert Configuration - displays/edits alert settings
export {
AlertConfigurationToolUI,
AlertConfigurationArgsSchema,
AlertConfigurationResultSchema,
type AlertConfigurationArgs,
type AlertConfigurationResult,
} from "./alert-configuration";
// Proactive Alert - AI-initiated alerts
export {
ProactiveAlertToolUI,
ProactiveAlertArgsSchema,
ProactiveAlertResultSchema,
type ProactiveAlertArgs,
type ProactiveAlertResult,
} from "./proactive-alert";
// Trending Tokens - displays hot/trending tokens
export {
TrendingTokensToolUI,
TrendingTokensArgsSchema,
TrendingTokensResultSchema,
type TrendingTokensArgs,
type TrendingTokensResult,
} from "./trending-tokens";
// Whale Activity - displays whale transactions
export {
WhaleActivityToolUI,
WhaleActivityArgsSchema,
WhaleActivityResultSchema,
type WhaleActivityArgs,
type WhaleActivityResult,
} from "./whale-activity";
// Market Overview - displays market summary
export {
MarketOverviewToolUI,
MarketOverviewArgsSchema,
MarketOverviewResultSchema,
type MarketOverviewArgs,
type MarketOverviewResult,
} from "./market-overview-tool";
// Holder Analysis - displays holder distribution
export {
HolderAnalysisToolUI,
HolderAnalysisArgsSchema,
HolderAnalysisResultSchema,
type HolderAnalysisArgs,
type HolderAnalysisResult,
} from "./holder-analysis";
// Portfolio Display - displays user's portfolio
export {
PortfolioDisplayToolUI,
PortfolioDisplayArgsSchema,
PortfolioDisplayResultSchema,
type PortfolioDisplayArgs,
type PortfolioDisplayResult,
} from "./portfolio-display";
// User Profile - displays user's investment profile
export {
UserProfileToolUI,
UserProfileArgsSchema,
UserProfileResultSchema,
type UserProfileArgs,
type UserProfileResult,
} from "./user-profile";
// =========================================================================
// REAL-TIME CRYPTO TOOLS - Hybrid approach (RAG + Real-time)
// =========================================================================
// These components render results from real-time DexScreener API calls.
// Used alongside RAG-based tools for comprehensive crypto analysis.
// Live Token Price - displays real-time price from DexScreener
export {
LiveTokenPriceToolUI,
LiveTokenPriceArgsSchema,
LiveTokenPriceResultSchema,
type LiveTokenPriceArgs,
type LiveTokenPriceResult,
} from "./live-token-price";
// Live Token Data - displays comprehensive real-time market data
export {
LiveTokenDataToolUI,
LiveTokenDataArgsSchema,
LiveTokenDataResultSchema,
type LiveTokenDataArgs,
type LiveTokenDataResult,
} from "./live-token-data";