MCPcopy Create free account

hub / github.com/TauricResearch/TradingAgents / functions

Functions1,297 in github.com/TauricResearch/TradingAgents

↓ 44 callersMethodstore_decision
Append pending entry at end of propagate(). No LLM call.
tradingagents/agents/utils/memory.py:30
↓ 40 callersMethodload_entries
Parse all entries from log. Returns list of dicts.
tradingagents/agents/utils/memory.py:56
↓ 40 callersFunctionmake_log
(tmp_path, filename="trading_memory.md")
tests/test_memory_log.py:34
↓ 29 callersFunctionget_capabilities
Resolve capabilities by exact ID, then pattern, then default.
tradingagents/llm_clients/capabilities.py:119
↓ 28 callersFunctionnormalize_symbol
Map a user/broker symbol to its canonical Yahoo Finance symbol. Resolution order (first match wins): 1. Explicit alias table (metals, energ
tradingagents/dataflows/symbol_utils.py:110
↓ 26 callersMethodget_llm
(self)
tests/test_model_validation.py:16
↓ 23 callersFunctionset_config
Update the configuration with custom values. Dict-valued keys (e.g. ``data_vendors``) are merged one level deep so a partial update like ``{"
tradingagents/dataflows/config.py:16
↓ 18 callersMethodinvoke
(self, prompt, *a, **k)
tests/test_prompt_integrity.py:64
↓ 17 callersMethodget_past_context
Return formatted past context string for agent prompt injection. When ``as_of`` (yyyy-mm-dd) is given, only lessons whose outcome was
tradingagents/agents/utils/memory.py:73
↓ 16 callersFunctionget_instrument_context_from_state
Return the instrument context for the current run. Prefers the identity-resolved context computed once at run start and stored on the state (
tradingagents/agents/utils/agent_utils.py:201
↓ 15 callersFunctionsafe_ticker_component
Validate ``value`` is safe to interpolate into a filesystem path. Tickers come from user CLI input or from LLM tool calls, both of which can
tradingagents/dataflows/utils.py:14
↓ 15 callersMethodupdate_with_outcome
Replace pending tag and append REFLECTION section using atomic write. Finds the first pending entry matching (trade_date, ticker), updates
tradingagents/agents/utils/memory.py:114
↓ 14 callersFunctioncreate_llm_client
Create an LLM client for the specified provider. Provider modules are imported lazily so that simply importing this factory (e.g. during test
tradingagents/llm_clients/factory.py:5
↓ 14 callersFunctionget_language_instruction
Return a prompt instruction for the configured output language. Returns empty string when English (default), so no extra tokens are used. App
tradingagents/agents/utils/agent_utils.py:54
↓ 12 callersFunctionget_config
Get the current configuration.
tradingagents/dataflows/config.py:33
↓ 12 callersFunctionparse_rating
Extract a 5-tier rating, or ``REVIEW`` when the decision has none. For callers that need a string for every decision, such as the memory log's
tradingagents/agents/utils/rating.py:81
↓ 12 callersMethodwith_structured_output
(self, *a, **k)
tests/test_prompt_integrity.py:68
↓ 11 callersMethod_get_provider_kwargs
Get provider-specific kwargs for LLM client creation.
tradingagents/graph/trading_graph.py:182
↓ 11 callersFunctionas_of
The date a tool serves: the model's date, but never later than the run's. A model can omit the date or pass today's instead of the analysis date,
tradingagents/dataflows/date_window.py:69
↓ 11 callersMethodinvoke
(self, input, config=None, **kwargs)
tradingagents/llm_clients/openai_client.py:35
↓ 11 callersFunctionroute_to_vendor
Route method calls to appropriate vendor implementation with fallback support.
tradingagents/dataflows/interface.py:177
↓ 11 callersFunctionvalidate_model
Check if model name is valid for the given provider. For ollama, openrouter, and openai_compatible - any model is accepted.
tradingagents/llm_clients/validators.py:20
↓ 10 callersFunctionextract_rating
Extract a 5-tier rating from prose, or ``None`` if none is present. Two-pass strategy on the NFKC-normalized text (so fullwidth punctuation like
tradingagents/agents/utils/rating.py:49
↓ 10 callersFunctionin_window
Whether an item belongs in the half-open window ``[start, end + 1 day)``. ``pub_dt`` None means undated: kept only when the window reaches the pr
tradingagents/dataflows/date_window.py:24
↓ 9 callersFunction_make_api_request
Helper function to make API requests and handle responses. Raises: AlphaVantageRateLimitError: When API rate limit is exceeded
tradingagents/dataflows/alpha_vantage_common.py:67
↓ 9 callersFunctionbuild_analyst_execution_plan
( selected_analysts: Iterable[str], )
tradingagents/graph/analyst_execution.py:56
↓ 9 callersFunctionget_api_key_env
Return the env var name for `provider`'s API key, or None if not applicable. Unknown providers also return None — callers should treat that as
tradingagents/llm_clients/api_key_env.py:47
↓ 9 callersMethodrender
(self)
tests/test_cli_commands.py:77
↓ 9 callersFunctionthread_id
Deterministic thread ID for a ticker+date pair. ``signature`` folds in graph-shape-affecting run choices so a resume under a different graph
tradingagents/graph/checkpointer.py:28
↓ 9 callersFunctionyf_retry
Execute a yfinance call with exponential backoff on rate limits. yfinance raises YFRateLimitError on HTTP 429 responses but does not retry th
tradingagents/dataflows/stockstats_utils.py:43
↓ 8 callersFunction_epoch
Epoch seconds for UTC midnight of ``date_str`` (host-timezone independent).
tests/test_news_lookahead.py:17
↓ 8 callersMethod_fetch_returns
Fetch raw and alpha return for ticker over holding_days from trade_date. ``benchmark`` is the index used as the alpha baseline (resolved by t
tradingagents/graph/trading_graph.py:291
↓ 8 callersFunction_reload_with_env
Set/clear env vars then reload default_config to re-evaluate DEFAULT_CONFIG.
tests/test_env_overrides.py:12
↓ 8 callersMethod_resolve_benchmark
Pick the benchmark ticker for alpha calculation against ``ticker``. ``config["benchmark_ticker"]`` overrides everything when set; otherwise
tradingagents/graph/trading_graph.py:266
↓ 8 callersFunction_resolve_entry
Store a decision then immediately resolve it via the API.
tests/test_memory_log.py:51
↓ 8 callersFunctionbuild_instrument_context
Describe the exact instrument so agents preserve identity and ticker. When ``identity`` is provided (resolved deterministically via :func:`re
tradingagents/agents/utils/agent_utils.py:138
↓ 8 callersFunctionrun_backtest
Analyze every ticker on every date, into a decision log of this run's own. The live log stays untouched: a sweep would otherwise flood the contex
tradingagents/backtest.py:127
↓ 8 callersFunctionsummarize
Score the settled decisions in a log, by rating.
tradingagents/backtest.py:177
↓ 7 callersFunction_asks
(value)
tests/test_openrouter_model_select.py:12
↓ 7 callersFunction_capture_kwargs
(monkeypatch)
tests/test_anthropic_effort.py:14
↓ 7 callersFunction_captured_kwargs
(model, **kwargs)
tests/test_google_thinking_level.py:15
↓ 7 callersFunction_config
(tmp_path)
tests/test_backtest.py:73
↓ 7 callersMethod_resolve_pending_entries
Resolve pending log entries for ticker at the start of a new run. Fetches returns for each same-ticker pending entry, generates reflections,
tradingagents/graph/trading_graph.py:346
↓ 7 callersFunctioncreate_portfolio_manager
(llm)
tradingagents/agents/managers/portfolio_manager.py:26
↓ 7 callersFunctioncreate_sentiment_analyst
Create a sentiment analyst node for the trading graph. Pre-fetches news + StockTwits + Reddit data, injects them into the prompt as structure
tradingagents/agents/analysts/sentiment_analyst.py:55
↓ 7 callersFunctioncreate_trader
(llm)
tradingagents/agents/trader/trader.py:22
↓ 7 callersFunctionget_portfolio_context_from_state
Return the caller's portfolio block, or a notice that none was given. A run without portfolio context must not read as a flat book: the agents
tradingagents/agents/utils/agent_utils.py:233
↓ 7 callersFunctionload_last_run
The previous run's answers, or an empty dict when there is nothing usable. Convenience state: an unreadable or corrupt file means no defaults, ne
cli/prefs.py:35
↓ 6 callersFunction_assert_ohlcv_not_stale
Reject OHLCV whose latest row is far older than curr_date. Raises NoMarketDataError (with a stale-specific detail) so the router treats it li
tradingagents/dataflows/stockstats_utils.py:144
↓ 6 callersFunction_bound_kwargs
Extract bind() kwargs from a with_structured_output result.
tests/test_deepseek_reasoning.py:123
↓ 6 callersMethod_client
(self, model)
tests/test_deepseek_reasoning.py:139
↓ 6 callersFunction_coerce_max_retries
Validate an ``llm_max_retries`` value to a non-negative int. Accepts an int or a numeric string (env vars arrive as strings). Rejects boolean
tradingagents/graph/trading_graph.py:62
↓ 6 callersFunction_coerce_max_tokens
Validate a ``max_tokens`` value to a positive int (env vars are strings).
tradingagents/graph/trading_graph.py:80
↓ 6 callersFunction_ohlcv
OHLCV frame whose date column is named `date_col`.
tests/test_stockstats_date_column.py:15
↓ 6 callersFunction_reload_client
()
tests/test_ollama_base_url.py:41
↓ 6 callersMethod_run_signature
Graph-shape inputs that must invalidate a checkpoint if changed. Keyed into the checkpoint thread ID so a resume under a different analyst
tradingagents/graph/trading_graph.py:420
↓ 6 callersFunction_write
(tmp_path, name="AAPL-YFin-data.csv", age_seconds=0.0, last_date="2026-07-17")
tests/test_ohlcv_cache_freshness.py:21
↓ 6 callersFunction_yf
(curr_date, info=_INFO, today=_TODAY)
tests/test_fundamentals_lookahead.py:43
↓ 6 callersFunctioncoverage_gap
Placeholder for a window a feed did not fully observe, else None. Yahoo news and the Reddit and StockTwits feeds return their latest items wh
tradingagents/dataflows/date_window.py:35
↓ 6 callersFunctioncrypto_base
Return the crypto base (e.g. ``BTC``) for a known USD/USDT/USDC-quoted crypto symbol in any form the pipeline may hold — ``BTC-USD``, ``BTCUSD``,
tradingagents/dataflows/symbol_utils.py:89
↓ 6 callersFunctionget_checkpointer
Context manager yielding a SqliteSaver backed by a per-ticker DB.
tradingagents/graph/checkpointer.py:42
↓ 6 callersFunctionget_current_date
()
tradingagents/dataflows/utils.py:42
↓ 6 callersMethodget_pending_entries
Return entries with outcome:pending (for Phase B).
tradingagents/agents/utils/memory.py:69
↓ 6 callersFunctionopponent_argument_or_opening
Opponent's latest argument, or an explicit opening marker when empty. The first speaker in each debate round receives an empty opponent response;
tradingagents/agents/utils/agent_utils.py:70
↓ 6 callersFunctionraise_for_empty
Report an empty Yahoo result as an absence, or as an outage if it is one. yfinance returns an empty frame for a failed request rather than raisin
tradingagents/dataflows/stockstats_utils.py:32
↓ 6 callersFunctionresolve_instrument_identity
Resolve deterministic identity metadata (company name, sector, …) for a ticker. This exists to stop the pipeline from hallucinating a *different*
tradingagents/agents/utils/agent_utils.py:95
↓ 6 callersFunctionsanitize
Keep only the remembered answers that are still choosable now.
cli/prefs.py:62
↓ 6 callersMethodwarn_if_unknown_model
Warn when the model is outside the known list for the provider.
tradingagents/llm_clients/base_client.py:40
↓ 5 callersFunction_atom_resp
()
tests/test_reddit_fallback.py:45
↓ 5 callersFunction_bare_graph
(config)
tests/test_llm_max_tokens.py:49
↓ 5 callersFunction_client
(model: str = "MiniMax-M2.7")
tests/test_minimax.py:17
↓ 5 callersFunction_console_out
(capsys)
tests/test_ollama_base_url.py:17
↓ 5 callersMethod_get_request_payload
(self, input_, *, stop=None, **kwargs)
tradingagents/llm_clients/openai_client.py:153
↓ 5 callersFunction_log
(tmp_path)
tests/test_memory_pointintime.py:16
↓ 5 callersFunction_log_with
(tmp_path, rows)
tests/test_backtest.py:117
↓ 5 callersFunction_make_sentiment_state
()
tests/test_structured_agents.py:407
↓ 5 callersFunction_make_trader_state
()
tests/test_structured_agents.py:170
↓ 5 callersFunction_request_stub
Build a _request replacement that dispatches on the endpoint path.
tests/test_fred.py:39
↓ 5 callersMethod_route
(self, vendors_for_get_stock_data)
tests/test_vendor_routing.py:51
↓ 5 callersFunction_run_load
Drive load_ohlcv against a pre-seeded cache frame (no network).
tests/test_ohlcv_latest_bar.py:89
↓ 5 callersFunction_sample_ohlcv
()
tests/test_market_data_validator.py:11
↓ 5 callersFunction_seed_completed
Write a completed entry directly to file, bypassing the API.
tests/test_memory_log.py:39
↓ 5 callersFunctioncreate_research_manager
(llm)
tradingagents/agents/managers/research_manager.py:17
↓ 5 callersFunctionget_model_options
Return shared model options for a provider and selection mode.
tradingagents/llm_clients/model_catalog.py:227
↓ 5 callersFunctioninvoke_structured_or_freetext
Run the structured call and render to markdown; fall back to free-text on any failure. ``prompt`` is whatever the underlying LLM accepts (a strin
tradingagents/agents/utils/structured.py:59
↓ 5 callersFunctionnormalize_content
Normalize LLM response content to a plain string. Multiple providers (OpenAI Responses API, Google Gemini 3) return content as a list of type
tradingagents/llm_clients/base_client.py:6
↓ 5 callersMethodraise_for_status
(self)
tests/test_alpha_vantage_hardening.py:25
↓ 5 callersMethodreflect_on_final_decision
Single reflection call on the final trade decision with outcome context. Used by Phase B deferred reflection. The final_trade_decision alread
tradingagents/graph/reflection.py:36
↓ 5 callersFunctionreport_or_absent
An analyst's report, or a marker saying it was never produced. A report is empty when its analyst was not selected, refused, or returned noth
tradingagents/agents/utils/agent_utils.py:219
↓ 5 callersFunctionsave_last_run
Record the answers worth offering next time; failure is never fatal.
cli/prefs.py:48
↓ 4 callersFunction_bare_graph
(config)
tests/test_llm_max_retries.py:47
↓ 4 callersFunction_bare_graph
(tmpdir, *, enabled=True)
tests/test_checkpoint_lifecycle.py:48
↓ 4 callersFunction_base_url
(mod, provider, **kwargs)
tests/test_ollama_base_url.py:46
↓ 4 callersFunction_build_graph
()
tests/test_checkpoint_resume.py:35
↓ 4 callersFunction_capturing_llm
LLM whose structured binding records the prompt it was handed.
tests/test_structured_agent_prompts.py:25
↓ 4 callersFunction_capturing_llm
(captured: dict)
tests/test_debate_opening.py:29
↓ 4 callersFunction_epoch
(date_str)
tests/test_social_lookahead.py:98
↓ 4 callersFunction_input_to_messages
Normalise a langchain LLM input to a list of message objects. Accepts a list of messages, a ``ChatPromptValue`` (from a ChatPromptTemplate),
tradingagents/llm_clients/openai_client.py:71
↓ 4 callersFunction_is_native_openai_base_url
True when ``base_url`` is unset or points at api.openai.com. The Responses API (/v1/responses) only exists on native OpenAI. A custom base_ur
tradingagents/llm_clients/openai_client.py:242
↓ 4 callersMethod_kwargs_for
(self, temperature)
tests/test_temperature_config.py:66
next →1–100 of 1,297, ranked by callers