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

Function jsonOrEmptyMap

coderd/database/db2sdk/db2sdk.go:1543–1555  ·  view source on GitHub ↗
(rawMessage pqtype.NullRawMessage)

Source from the content-addressed store, hash-verified

1541}
1542
1543func jsonOrEmptyMap(rawMessage pqtype.NullRawMessage) map[string]any {
1544 var m map[string]any
1545 if !rawMessage.Valid {
1546 return m
1547 }
1548
1549 err := json.Unmarshal(rawMessage.RawMessage, &m)
1550 if err != nil {
1551 // Don't reuse m
1552 return map[string]any{}
1553 }
1554 return m
1555}
1556
1557func ChatMessage(m database.ChatMessage) codersdk.ChatMessage {
1558 modelConfigID := &m.ModelConfigID.UUID

Callers 7

AIBridgeInterceptionFunction · 0.85
AIBridgeSessionFunction · 0.85
AIBridgeTokenUsageFunction · 0.85
AIBridgeUserPromptFunction · 0.85
AIBridgeToolUsageFunction · 0.85
AIBridgeSessionThreadsFunction · 0.85
buildAIBridgeThreadFunction · 0.85

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected