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

Function StringResponseField

coderd/x/chatd/chattest/openai_responses_validation.go:178–188  ·  view source on GitHub ↗

StringResponseField returns the string value for key from a decoded Responses API item, or an empty string when the field is absent or not a string.

(values map[string]interface{}, key string)

Source from the content-addressed store, hash-verified

176// Responses API item, or an empty string when the field is absent or not a
177// string.
178func StringResponseField(values map[string]interface{}, key string) string {
179 value, ok := values[key]
180 if !ok {
181 return ""
182 }
183 text, ok := value.(string)
184 if !ok {
185 return ""
186 }
187 return text
188}
189
190func openAIResponsesValidationError(message string) *ErrorResponse {
191 return &ErrorResponse{

Callers 5

promptItemTypesFunction · 0.92
promptItemRolesFunction · 0.92

Calls

no outgoing calls

Tested by 4

promptItemTypesFunction · 0.74
promptItemRolesFunction · 0.74