mirror of
https://gh-proxy.org/https://github.com/klinsmaya/CLIProxyAPI.git
synced 2026-11-09 09:56:49 +08:00
- Introduced a new `models` package for organizing Codex client model templates and building responses. - Migrated Codex response handling to `codexmodels.BuildResponse`. - Added comprehensive tests for model metadata, reasoning levels, and input modalities handling.
23 lines
959 B
Go
23 lines
959 B
Go
package openai
|
|
|
|
import (
|
|
codexmodels "github.com/router-for-me/CLIProxyAPI/v7/internal/client/codex/models"
|
|
"github.com/router-for-me/CLIProxyAPI/v7/internal/registry"
|
|
)
|
|
|
|
func (h *OpenAIAPIHandler) codexClientModelsResponse() map[string]any {
|
|
optimizeMultiAgentV2 := h != nil && h.Cfg != nil && h.Cfg.CodexOptimizeMultiAgentV2
|
|
return codexmodels.BuildResponse(h.Models(), registry.GetGlobalRegistry().GetModelProviders, optimizeMultiAgentV2)
|
|
}
|
|
|
|
// CodexClientModelsResponse builds a Codex client model response.
|
|
func CodexClientModelsResponse(models []map[string]any) map[string]any {
|
|
return codexmodels.BuildResponse(models, nil, false)
|
|
}
|
|
|
|
// CodexClientModelsResponseWithMultiAgentV2 builds a Codex client model response
|
|
// and advertises multi-agent v2 for synthesized models when enabled.
|
|
func CodexClientModelsResponseWithMultiAgentV2(models []map[string]any, enabled bool) map[string]any {
|
|
return codexmodels.BuildResponse(models, nil, enabled)
|
|
}
|