refactor(config)!: retire the old OpenAI API selector (#6615)
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
This commit is contained in:
1 parent
e3a1af2ed3
commit
5c1083df7f
14 files changed
+112
-141
No files matched your search
@@ -998,7 +998,7 @@ def test_update_provider_settings_persists_provider_specific_advanced_options(
|
||||
update_provider_settings(
|
||||
{
|
||||
"provider": ["openai"],
|
||||
"apiType": ["responses"],
|
||||
"api": [json.dumps({"supportedApis": ["responses"]})],
|
||||
"use_proxy": ["true"],
|
||||
"extraHeaders": [json.dumps({"X-Trace": "enabled"})],
|
||||
"extraBody": [json.dumps({"service_tier": "priority"})],
|
||||
@@ -2852,13 +2852,12 @@ def test_custom_connection_cannot_remove_api_used_by_legacy_or_inline_model(tmp_
|
||||
assert config_path.read_bytes() == before
|
||||
|
||||
|
||||
@pytest.mark.parametrize("field", ["apiType", "api_type"])
|
||||
def test_legacy_openai_settings_can_return_to_auto(monkeypatch, tmp_path, field):
|
||||
def test_openai_settings_can_return_to_auto(monkeypatch, tmp_path):
|
||||
config_path = tmp_path / "config.json"
|
||||
config = Config.model_validate({"providers": {"openai": {
|
||||
"apiKey": "fixture", "api": {"supportedApis": ["responses"]},
|
||||
}}})
|
||||
save_config(config, config_path)
|
||||
monkeypatch.setattr("nanobot.config.loader._current_config_path", config_path)
|
||||
update_provider_settings({"provider": ["openai"], field: ["auto"]})
|
||||
update_provider_settings({"provider": ["openai"], "api": ["null"]})
|
||||
assert load_config(config_path).providers.openai.api is None
|
||||
Reference in new issue
Block a user