feat(tools): run_python, web search/fetch, market data, options, portfolio
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016DvdRZkyCy9NJpHYDdPqmS
This commit is contained in:
1 parent
f41cf75d8a
commit
63085113ed
6 files changed
+552
No files matched your search
@@ -0,0 +1,25 @@
|
||||
"""Tool registry. All personas get the full core toolset; a persona's `tool_emphasis`
|
||||
is a prompt hint (which tools to lean on), not a hard restriction. get_portfolio is bound
|
||||
per-persona so each agent sees only its own account.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from config.personas import Persona
|
||||
from tools.market_data import get_bars, get_fundamentals, get_news, get_quote
|
||||
from tools.options import get_option_chain, get_option_quote
|
||||
from tools.portfolio import make_get_portfolio
|
||||
from tools.python_exec import run_python
|
||||
from tools.web import web_fetch, web_search
|
||||
|
||||
# Tools that are the same for every persona (portfolio is added per-persona below).
|
||||
BASE_TOOLS = [
|
||||
run_python, web_search, web_fetch, get_quote, get_bars, get_news, get_fundamentals,
|
||||
get_option_chain, get_option_quote,
|
||||
]
|
||||
|
||||
|
||||
def build_toolset(persona: Persona | None = None) -> list:
|
||||
"""Return the tool list for an agent, including a portfolio tool bound to its account."""
|
||||
account = persona.id if persona is not None else ""
|
||||
return [*BASE_TOOLS, make_get_portfolio(account)]
|
||||
Reference in new issue
Block a user