mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: propagate kimi base-url temperature overrides
Follow up salvaged PR #12668 by threading base_url through the remaining direct-call sites so kimi-k2.5 uses temperature=1.0 on api.moonshot.ai and keeps 0.6 on api.kimi.com/coding. Add focused regression tests for run_agent, trajectory_compressor, and mini_swe_runner.
This commit is contained in:
parent
6f79b8f01d
commit
50d6799389
7 changed files with 119 additions and 8 deletions
|
|
@ -54,6 +54,30 @@ def test_generate_summary_custom_client_forces_kimi_temperature():
|
|||
assert compressor.client.chat.completions.create.call_args.kwargs["temperature"] == 0.6
|
||||
|
||||
|
||||
def test_generate_summary_public_moonshot_kimi_k2_5_forces_temperature_1():
|
||||
config = CompressionConfig(
|
||||
summarization_model="kimi-k2.5",
|
||||
base_url="https://api.moonshot.ai/v1",
|
||||
temperature=0.3,
|
||||
summary_target_tokens=100,
|
||||
max_retries=1,
|
||||
)
|
||||
compressor = TrajectoryCompressor.__new__(TrajectoryCompressor)
|
||||
compressor.config = config
|
||||
compressor.logger = MagicMock()
|
||||
compressor._use_call_llm = False
|
||||
compressor.client = MagicMock()
|
||||
compressor.client.chat.completions.create.return_value = SimpleNamespace(
|
||||
choices=[SimpleNamespace(message=SimpleNamespace(content="[CONTEXT SUMMARY]: summary"))]
|
||||
)
|
||||
|
||||
metrics = TrajectoryMetrics()
|
||||
result = compressor._generate_summary("tool output", metrics)
|
||||
|
||||
assert result.startswith("[CONTEXT SUMMARY]:")
|
||||
assert compressor.client.chat.completions.create.call_args.kwargs["temperature"] == 1.0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# CompressionConfig
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue