MCPcopy Create free account
hub / github.com/coder/coder / parseToolResultRows

Function parseToolResultRows

coderd/x/chatd/chatprompt/chatprompt.go:568–578  ·  view source on GitHub ↗

parseToolResultRows decodes persisted tool result rows.

(raw pqtype.NullRawMessage)

Source from the content-addressed store, hash-verified

566
567// parseToolResultRows decodes persisted tool result rows.
568func parseToolResultRows(raw pqtype.NullRawMessage) ([]toolResultRaw, error) {
569 if !raw.Valid || len(raw.RawMessage) == 0 {
570 return nil, nil
571 }
572
573 var rows []toolResultRaw
574 if err := json.Unmarshal(raw.RawMessage, &rows); err != nil {
575 return nil, xerrors.Errorf("parse tool content: %w", err)
576 }
577 return rows, nil
578}
579
580// extractErrorString pulls the "error" field from a JSON object if
581// present, returning it as a string. Returns "" if the field is

Callers 1

parseToolRoleFunction · 0.85

Calls 2

UnmarshalMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected