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

Function unmarshalChatModelCallConfig

coderd/exp_chats.go:7459–7474  ·  view source on GitHub ↗
(
	raw json.RawMessage,
)

Source from the content-addressed store, hash-verified

7457}
7458
7459func unmarshalChatModelCallConfig(
7460 raw json.RawMessage,
7461) *codersdk.ChatModelCallConfig {
7462 if len(raw) == 0 {
7463 return nil
7464 }
7465
7466 decoded := &codersdk.ChatModelCallConfig{}
7467 if err := json.Unmarshal(raw, decoded); err != nil {
7468 return nil
7469 }
7470 if isZeroChatModelCallConfig(decoded) {
7471 return nil
7472 }
7473 return decoded
7474}
7475
7476func isZeroChatModelCallConfig(config *codersdk.ChatModelCallConfig) bool {
7477 if config == nil {

Callers 1

convertChatModelConfigFunction · 0.85

Calls 2

UnmarshalMethod · 0.45

Tested by

no test coverage detected