MCPcopy Index your code
hub / github.com/coder/coder / convertChatModelConfig

Function convertChatModelConfig

coderd/exp_chats.go:7382–7401  ·  view source on GitHub ↗
(config database.ChatModelConfig)

Source from the content-addressed store, hash-verified

7380}
7381
7382func convertChatModelConfig(config database.ChatModelConfig) codersdk.ChatModelConfig {
7383 var aiProviderID *uuid.UUID
7384 if config.AIProviderID.Valid {
7385 aiProviderID = &config.AIProviderID.UUID
7386 }
7387 return codersdk.ChatModelConfig{
7388 ID: config.ID,
7389 Provider: config.Provider,
7390 AIProviderID: aiProviderID,
7391 Model: config.Model,
7392 DisplayName: config.DisplayName,
7393 Enabled: config.Enabled,
7394 IsDefault: config.IsDefault,
7395 ContextLimit: config.ContextLimit,
7396 CompressionThreshold: config.CompressionThreshold,
7397 ModelConfig: unmarshalChatModelCallConfig(config.Options),
7398 CreatedAt: config.CreatedAt,
7399 UpdatedAt: config.UpdatedAt,
7400 }
7401}
7402
7403func marshalChatModelCallConfig(
7404 modelConfig *codersdk.ChatModelCallConfig,

Callers 3

listChatModelConfigsMethod · 0.85
createChatModelConfigMethod · 0.85
updateChatModelConfigMethod · 0.85

Calls 1

Tested by

no test coverage detected