TradingAgents API configuration

Updated 2026-09-06

Documented model client connect করুন, তারপর research graph independently validate করুন। এই source-reviewed guide provider configuration, financial data dependency ও bounded first experiment cover করে।

Versioned research question দিয়ে শুরু করুন

Compatible provider, custom backend URL ও দুইটি model role set করুন, তারপর নির্দিষ্ট research date-এ একটি company test করুন। TradingAgents analyst, opposing research argument ও risk review organize করে, তাই প্রথম useful task হলো একই source packet এই role-গুলো কীভাবে explain করে দেখা। Model বদলানোর আগে company ও information cutoff বেছে নিন। প্রথম run-এর underlying fact ও unresolved item রাখুন, যাতে পরের model comparison একই question ব্যবহার করে। নিচের field service revision 9dee508c অনুসরণ করে।

Compatible provider ও দুই model role configure করুন

Reviewed default_config.py llm_provider, backend_url, deep_think_llm ও quick_think_llm expose করে। Compatible client supplied endpoint ব্যবহার করে; authentication আলাদা environment setting। দুই role slot-এ chosen endpoint ও project client গ্রহণ করে এমন exact model identifier দরকার। Example source field adapt করে, কেবল configuration construct করে। Required capability check করার পরে current catalog থেকে RESEARCH_MODEL_ID ও SUMMARY_MODEL_ID set করুন। এগুলো local environment slot, model ID বা TradingAgents default নয়। Credential script-এ নয়, process environment-এ রাখুন।

import os
from copy import deepcopy
from tradingagents.default_config import DEFAULT_CONFIG

config = deepcopy(DEFAULT_CONFIG)
config.update({
    "llm_provider": "openai_compatible",
    "backend_url": "https://api.apisrouter.com/v1",
    "deep_think_llm": os.environ["RESEARCH_MODEL_ID"],
    "quick_think_llm": os.environ["SUMMARY_MODEL_ID"],
    "max_debate_rounds": 1,
    "max_risk_discuss_rounds": 1,
})
assert os.environ["OPENAI_COMPATIBLE_API_KEY"]
# Configuration only. This does not start a research run.

Model route ও financial data আলাদা রাখুন

Financial-data vendor model endpoint থেকে independentভাবে configure করুন। International equity-তে collection-এর আগে issuer ও exchange-specific symbol resolve করুন। Trading currency, reporting currency, market timezone ও benchmark choice preserve করুন। US-listed depositary receipt ও underlying ordinary share price series তুলনা করার আগে explicit conversion rule দরকার। Diagram model setting কীভাবে connect করে দেখায়; financial-data tool নিজস্ব credential, coverage ও source timestamp রাখে। Missing research input-কে LLM failure বলার আগে ওই tool check করুন।

Compatible provider দিয়ে TradingAgents model configuration route research ও summary model slot-এ যায়।TradingAgents routes through openai_compatible + backend_url to the APIsRouter gateway (api.apisrouter.com/v1), which fans out to: Research model slot, Summary model slot.TradingAgentsviaopenai_compatible +backend_urlAPIsRouterapi.apisrouter.com/v1Research model slotSummary model slot
Documented model-client route। Market-data configuration আলাদা থাকে।

Task contract অনুযায়ী role বেছে নিন

প্রতিটি role যে capability সত্যিই ব্যবহার করে তা test করুন। Text reply tool-call parsing, long-context handling বা structured-output behavior establish করে না। Model family বদলালে endpoint identifier accept করলেও provider adapter behavior বদলাতে পারে। Smallest useful role set দিয়ে শুরু করুন; Unsupported claim বা useful counterevidence identify করলেই debate যোগ করুন। Longer report-কে better research না ধরে একই source packet-এর বিরুদ্ধে final artifact evaluate করুন।

RoleRequired evidenceযে failure inspect করতে হবে
AnalystTool result ও source locatorData error-এর পরে invented fact
Research debateAnalyst evidence-এ linked argumentRepeated claim-কে corroboration বলা
Risk reviewExplicit assumption ও unresolved itemVerified input ছাড়া confident position

Staged first-run acceptance test ব্যবহার করুন

প্রথমে key print না করে resolved configuration inspect করুন। এরপর authorized execution environment-এ selected model দিয়ে project client exercise করে redacted request record রাখুন। তারপর required tool interaction ও তার error path test করুন। শেষে bounded source set দিয়ে TradingAgentsGraph run করে resulting state, cited fact ও final research output inspect করুন। Repository revision, dependency version, input hash ও role setting save করুন। Factory response কেবল client stage pass করে; usable research artifact হিসেবে ধরার আগে complete report-এর source ও numerical review দরকার।

import os
from research_config import config
from tradingagents.graph.trading_graph import TradingAgentsGraph

graph = TradingAgentsGraph(debug=False, config=config)
state, decision = graph.propagate(
    os.environ["RESEARCH_TICKER"],
    os.environ["RESEARCH_DATE"],
)
# Inspect state and decision against the source packet.
# Running this template makes model and data requests.

Later information থেকে historical research protect করুন

Requested analysis date vendor response point-in-time এমন প্রমাণ নয়। Cutoff-এর আগে fundamental সত্যিই available ছিল কি না, article পরে correct হয়েছে কি না এবং cached data অন্য experiment থেকে এসেছে কি না check করুন। Original publication time ও ingestion time আলাদা রাখুন। Held-out evaluation period-এর বাইরে training বা reflection feedback রাখুন। Historical ticker list-এ relevant delisting ও symbol change রাখুন। প্রতিটি experiment-এর পাশে corporate-action handling ও comparison benchmark record করুন, যাতে model change-কে data change বলে ভুল না হয়।

Debate, retry ও repeated context budget করুন

Financial-agent spend graph-এর প্রতিটি request থেকে আসে, summary, repeated context ও billable retry-সহ। Planning-এ current pricing contract ব্যবহার করুন এবং পরে actual request usage reconcile করুন। Sweep-এর আগে debate round, source volume, parallel job ও automatic retry limit করুন। Document version দিয়ে source extraction cache করুন; application reuse ও provider billing discount আলাদা রাখুন। LLM charge থেকে data subscription ও local compute আলাদা track করুন এবং accepted research artifact প্রতি cost তুলনা করুন। Ticker ও date universe বাড়ানোর আগে উপরের bounded run দিয়ে শুরু করুন।

যে stage fail করেছে সেটি diagnose করুন

Authentication failure-এ compatible-provider key client তৈরি করা একই process-এ পৌঁছায় কি না verify করুন। Missing model হলে exact identifier ও account access current catalog-এর সঙ্গে তুলনা করুন। Malformed tool output-এ শুধু final exception নয়, tool schema ও sanitized response রাখুন। Stall data-vendor request, repeated tool loop বা model timeout হতে পারে; limit বাড়ানোর আগে stage timestamp inspect করুন। Mandatory data missing হলে থামুন। Prose দেখা পর্যন্ত retry করলে original failure আড়াল ও পুরো research budget খরচ হতে পারে।

Evidence ও সীমাবদ্ধতা

Configuration September 5, 2026-এ revision 9dee508c-এ source-review করা হয়েছে। Example walkthrough template; এই guide-এর জন্য কোনো APIsRouter client request, complete graph বা measured task-cost case execute করা হয়নি। Workflow বাড়ানোর আগে নিজের bounded run-এ selected model ও data tool validate করুন।

সাধারণ প্রশ্ন

openai_compatible কোন key পড়ে?

Reviewed provider OPENAI_COMPATIBLE_API_KEY-এ map করে। Execution environment-এ set করুন এবং secret print না করে resolved provider verify করুন।

দুই role কি আলাদা model ব্যবহার করতে পারে?

Configuration-এ আলাদা deep_think_llm ও quick_think_llm field আছে। দুই exact ID ও required capability validate করুন; shared endpoint একা compatibility প্রমাণ করে না।

Endpoint কি stock price supply করে?

না। Market data আলাদা configured vendor tool দিয়ে আসে, যার coverage, credential, licensing ও availability নিজস্ব।

propagate-এ কোন date pass করব?

Intended research date ব্যবহার করুন এবং প্রতিটি data tool information cutoff মানে কি না আলাদাভাবে verify করুন। Date argument একা current data-কে point-in-time করে না।

দুই model role কীভাবে select করব?

Current catalog ID ব্যবহার করুন, required tool ও output format test করুন, তারপর role বদলানোর আগে একই source packet-এর accepted report তুলনা করুন।

Successful graph কি trading strategy প্রমাণ করে?

না। Tested input-এর অধীনে workflow result প্রতিষ্ঠা করে। Strategy evaluation-এর জন্য point-in-time data, independent evaluation ও realistic execution assumption দরকার।