Pass instruction depth config to llm-connect

This commit is contained in:
2026-05-19 20:55:35 +02:00
parent 1ff8b14d1b
commit 5c4f96e7aa
6 changed files with 208 additions and 16 deletions

52
tests/test_llm_client.py Normal file
View File

@@ -0,0 +1,52 @@
from __future__ import annotations
import httpx
from activity_core.llm_client import LLMConnectClient
def test_llm_connect_client_forwards_run_config(monkeypatch) -> None:
captured: dict = {}
class Response:
def raise_for_status(self) -> None:
pass
def json(self) -> dict:
return {"content": '{"summary":"ok","recommendations":[]}'}
def fake_post(url: str, json: dict, timeout: float) -> Response:
captured["url"] = url
captured["json"] = json
captured["timeout"] = timeout
return Response()
monkeypatch.setattr(httpx, "post", fake_post)
client = LLMConnectClient("http://llm-connect.local/", timeout_seconds=42)
result = client.complete(
"Prompt",
model="fallback-model",
config={
"model_name": "custodian-triage-balanced",
"temperature": 0.2,
"max_tokens": 1200,
"max_depth": 2,
"model_params": {"reasoning_effort": "medium"},
},
)
assert result == '{"summary":"ok","recommendations":[]}'
assert captured["url"] == "http://llm-connect.local/execute"
assert captured["timeout"] == 42
assert captured["json"] == {
"prompt": "Prompt",
"config": {
"model_name": "custodian-triage-balanced",
"temperature": 0.2,
"max_tokens": 1200,
"max_depth": 2,
"model_params": {"reasoning_effort": "medium"},
"timeout_seconds": 42,
},
}