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

View File

@@ -17,7 +17,12 @@ import httpx
class DisabledLLMClient:
"""LLM client used when no llm-connect endpoint is configured."""
def complete(self, prompt: str, model: str = "") -> str: # noqa: ARG002
def complete(
self,
prompt: str,
model: str = "",
config: dict[str, Any] | None = None,
) -> str: # noqa: ARG002
raise RuntimeError("LLM_CONNECT_URL is not configured")
@@ -28,13 +33,19 @@ class LLMConnectClient:
self.base_url = base_url.rstrip("/")
self.timeout_seconds = timeout_seconds
def complete(self, prompt: str, model: str = "") -> str:
def complete(
self,
prompt: str,
model: str = "",
config: dict[str, Any] | None = None,
) -> str:
run_config = dict(config or {})
if model and "model_name" not in run_config:
run_config["model_name"] = model
run_config.setdefault("timeout_seconds", int(self.timeout_seconds))
payload: dict[str, Any] = {
"prompt": prompt,
"config": {
"model_name": model,
"timeout_seconds": int(self.timeout_seconds),
},
"config": run_config,
}
resp = httpx.post(
f"{self.base_url}/execute",