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

Function parseChatModelOverride

coderd/exp_chats.go:482–493  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

480}
481
482func parseChatModelOverride(raw string) (*uuid.UUID, error) {
483 trimmed := strings.TrimSpace(raw)
484 if trimmed == "" {
485 //nolint:nilnil // Empty site-config value means the override is unset.
486 return nil, nil
487 }
488 modelConfigID, err := uuid.Parse(trimmed)
489 if err != nil {
490 return nil, xerrors.Errorf("parse chat model override: %w", err)
491 }
492 return &modelConfigID, nil
493}
494
495func formatChatModelOverride(id *uuid.UUID) string {
496 if id == nil {

Callers 2

putChatModelOverrideMethod · 0.85

Calls 2

ParseMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected