generated from coulomb/repo-seed
Preserve llm-connect run config in server mode
This commit is contained in:
@@ -125,10 +125,28 @@ class TestExecute:
|
||||
try:
|
||||
status, body = _post(
|
||||
f"http://127.0.0.1:{s.port}/execute",
|
||||
{"prompt": "hi", "config": {"model_name": "gpt-3.5-turbo", "max_tokens": 100}},
|
||||
{
|
||||
"prompt": "hi",
|
||||
"config": {
|
||||
"model_name": "gpt-3.5-turbo",
|
||||
"max_tokens": 100,
|
||||
"max_depth": 2,
|
||||
"model_params": {"reasoning_effort": "medium"},
|
||||
},
|
||||
},
|
||||
)
|
||||
assert status == 200
|
||||
assert adapter.last_config.model_name == "gpt-3.5-turbo"
|
||||
assert adapter.last_config.max_tokens == 100
|
||||
assert adapter.last_config.max_depth == 2
|
||||
assert adapter.last_config.model_params == {"reasoning_effort": "medium"}
|
||||
finally:
|
||||
s.stop()
|
||||
|
||||
def test_config_must_be_object(self, server):
|
||||
status, body = _post(
|
||||
f"http://127.0.0.1:{server.port}/execute",
|
||||
{"prompt": "hi", "config": "not an object"},
|
||||
)
|
||||
assert status == 400
|
||||
assert "config" in body["error"]
|
||||
|
||||
Reference in New Issue
Block a user