refactor: clarify chat model resource names (#27958)

Rename the admin-managed SDK resource from `ChatModelConfig` to
`ChatModel`. Rename catalog entries from `ChatModel` to
`ChatModelCatalogEntry` and replace `ChatModelsResponse` with
`ChatModelAvailabilityResponse`.

API routes and JSON fields do not change. Experimental SDK and OpenAPI
schema names do change.

Depends on #27957

_This pull request description was generated by Coder Agents._
This commit is contained in:
Ethan
2026-08-24 09:43:45 +00:00
committed by GitHub
parent cbe24a3da5
commit 9bd8899359
90 changed files with 1239 additions and 1239 deletions
+7 -7
View File
@@ -46,15 +46,15 @@ func FakeOpenAICompatProviderAPIKeys(t testing.TB) chatprovider.ProviderAPIKeys
return OpenAICompatProviderAPIKeys(chattest.OpenAI(t))
}
// CreateOpenAICompatChatModelConfig creates the default provider and model
// config used by chat runtime tests. Tests can pass a baseURL to route chat work
// to a specific local provider. If baseURL is empty, this helper starts a fake
// CreateOpenAICompatChatModel creates the default provider and ChatModel used
// by chat runtime tests. Tests can pass a baseURL to route chat work to a
// specific local provider. If baseURL is empty, this helper starts a fake
// OpenAI-compatible provider.
func CreateOpenAICompatChatModelConfig(
func CreateOpenAICompatChatModel(
t testing.TB,
client *codersdk.ExperimentalClient,
baseURL string,
) codersdk.ChatModelConfig {
) codersdk.ChatModel {
t.Helper()
if baseURL == "" {
@@ -72,14 +72,14 @@ func CreateOpenAICompatChatModelConfig(
require.NoError(t, err)
contextLimit := int64(4096)
isDefault := true
modelConfig, err := client.CreateChatModelConfig(ctx, codersdk.CreateChatModelConfigRequest{
model, err := client.CreateChatModel(ctx, codersdk.CreateChatModelRequest{
AIProviderID: &provider.ID,
Model: TestChatModelOpenAICompat,
ContextLimit: &contextLimit,
IsDefault: &isDefault,
})
require.NoError(t, err)
return modelConfig
return model
}
// WaitForChatSettled waits for a chat to leave active processing and drains