generated from coulomb/repo-seed
Pass instruction depth config to llm-connect
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user