generated from coulomb/repo-seed
Pass instruction depth config to llm-connect
This commit is contained in:
52
tests/test_llm_client.py
Normal file
52
tests/test_llm_client.py
Normal 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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user