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)
| 176 | // Responses API item, or an empty string when the field is absent or not a |
| 177 | // string. |
| 178 | func 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 | |
| 190 | func openAIResponsesValidationError(message string) *ErrorResponse { |
| 191 | return &ErrorResponse{ |
no outgoing calls