feat: add advisory product comparison tool

This commit is contained in:
Windows
2026-09-11 19:20:32 +08:00
parent 6757ca047d
commit b6429e0e9c
8 changed files with 227 additions and 3 deletions
+10
View File
@@ -10,6 +10,7 @@ from app.core.errors import RecoverableAgentError
from app.core.fund_contracts import FundQuoteQuery
from app.core.investment_goal_contracts import InvestmentGoalQuery
from app.core.portfolio_analysis_contracts import PortfolioAnalysisQuery
from app.core.product_comparison_contracts import ProductComparisonQuery
from app.core.product_recommendation_contracts import ProductRecommendationQuery
from app.infrastructure.fund_quote_cache import FundQuoteCache
from app.infrastructure.memory_cache import MemoryCacheAdapter
@@ -31,6 +32,7 @@ from app.service.model_gateway import (
ModelGenerationService,
)
from app.service.portfolio_analysis_service import portfolio_analysis_tool
from app.service.product_comparison_service import product_comparison_tool
from app.service.product_recommendation_service import product_recommendation_tool
from app.service.runtime_config_service import load_active_intent_configs
from app.service.suitability_service import SuitabilityToolInput, suitability_tool_handler
@@ -183,6 +185,14 @@ def get_agent_factory() -> AgentFactory:
allowed_roles=("customer", "advisor", "operator", "admin"),
timeout_seconds=15,
))
registry.register(ToolDefinition(
name="compare_products",
input_model=ProductComparisonQuery,
handler=cast(Any, product_comparison_tool),
required_permission="product-comparison:read:self",
allowed_roles=("customer", "advisor", "operator", "admin"),
timeout_seconds=10,
))
model_service = get_model_service()
endpoint_resolver = DatabaseModelEndpointResolver()
factory = AgentFactory(