feat(config): expose sampling temperature and document reproducibility

Adds a cross-provider temperature config (and TRADINGAGENTS_TEMPERATURE),
forwarded to every LLM client when set, so runs can be made less variable
on models that honor it. Adds a README "Reproducibility" section that
separates the sources of run-to-run variation, what users can control
(temperature, non-reasoning model, pinned date), and what is inherent to
LLM-driven analysis, and notes that the identity and verified-data fixes
already removed the "different companies / fabricated prices" variance.

#178 #168
This commit is contained in:
Yijia-Xiao
2026-05-31 03:51:50 +00:00
parent 47cbb321fe
commit 8a22594607
9 changed files with 123 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ from .base_client import BaseLLMClient, normalize_content
from .validators import validate_model
_PASSTHROUGH_KWARGS = (
"timeout", "max_retries", "api_key", "max_tokens",
"timeout", "max_retries", "api_key", "max_tokens", "temperature",
"callbacks", "http_client", "http_async_client", "effort",
)

View File

@@ -7,7 +7,7 @@ from .base_client import BaseLLMClient, normalize_content
from .validators import validate_model
_PASSTHROUGH_KWARGS = (
"timeout", "max_retries", "api_key", "reasoning_effort",
"timeout", "max_retries", "api_key", "reasoning_effort", "temperature",
"callbacks", "http_client", "http_async_client",
)

View File

@@ -31,7 +31,7 @@ class GoogleClient(BaseLLMClient):
if self.base_url:
llm_kwargs["base_url"] = self.base_url
for key in ("timeout", "max_retries", "callbacks", "http_client", "http_async_client"):
for key in ("timeout", "max_retries", "temperature", "callbacks", "http_client", "http_async_client"):
if key in self.kwargs:
llm_kwargs[key] = self.kwargs[key]

View File

@@ -138,7 +138,7 @@ class MinimaxChatOpenAI(NormalizedChatOpenAI):
# Kwargs forwarded from user config to ChatOpenAI
_PASSTHROUGH_KWARGS = (
"timeout", "max_retries", "reasoning_effort",
"timeout", "max_retries", "reasoning_effort", "temperature",
"api_key", "callbacks", "http_client", "http_async_client",
)