refactor(api): move Codex client model handling to registry package
- Relocated Codex client model JSON and related logic from `openai` package to `registry` for better modularity. - Updated references to use `registry.GetCodexClientModelsJSON()` in loading logic. - Extended test cases to cover additional field removals (`upgrade`, `availability_nux`).
This commit is contained in:
@@ -346,6 +346,12 @@ func TestModelsWithClientVersionReturnsCodexCatalog(t *testing.T) {
|
||||
if _, ok := custom["apply_patch_tool_type"]; ok {
|
||||
t.Fatal("expected custom model to omit apply_patch_tool_type")
|
||||
}
|
||||
if _, ok := custom["upgrade"]; ok {
|
||||
t.Fatal("expected custom model to omit upgrade")
|
||||
}
|
||||
if _, ok := custom["availability_nux"]; ok {
|
||||
t.Fatal("expected custom model to omit availability_nux")
|
||||
}
|
||||
|
||||
hiddenModels := map[string]bool{
|
||||
"grok-imagine-image-quality": false,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package registry
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed models/codex_client_models.json
|
||||
var codexClientModelsJSON []byte
|
||||
|
||||
// GetCodexClientModelsJSON returns the embedded Codex client model catalog.
|
||||
func GetCodexClientModelsJSON() []byte {
|
||||
return append([]byte(nil), codexClientModelsJSON...)
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user