generated from coulomb/repo-seed
Preserve llm-connect run config in server mode
This commit is contained in:
@@ -65,12 +65,10 @@ class _Handler(BaseHTTPRequestHandler):
|
||||
return
|
||||
|
||||
cfg = data.get("config", {})
|
||||
config = RunConfig(
|
||||
model_name=cfg.get("model_name", "gpt-4"),
|
||||
temperature=float(cfg.get("temperature", 0.7)),
|
||||
max_tokens=int(cfg.get("max_tokens", 2000)),
|
||||
timeout_seconds=int(cfg.get("timeout_seconds", 300)),
|
||||
)
|
||||
if not isinstance(cfg, dict):
|
||||
self._respond(400, {"error": "field 'config' must be an object"})
|
||||
return
|
||||
config = RunConfig.from_dict(cfg)
|
||||
|
||||
try:
|
||||
response = self.server.adapter.execute_prompt(prompt, config) # type: ignore[attr-defined]
|
||||
|
||||
Reference in New Issue
Block a user