(resp *fantasy.ObjectResponse)
| 1243 | } |
| 1244 | |
| 1245 | func normalizeObjectResponse(resp *fantasy.ObjectResponse) normalizedObjectResponsePayload { |
| 1246 | if resp == nil { |
| 1247 | return normalizedObjectResponsePayload{StructuredOutput: true} |
| 1248 | } |
| 1249 | |
| 1250 | return normalizedObjectResponsePayload{ |
| 1251 | RawTextLength: utf8.RuneCountInString(resp.RawText), |
| 1252 | FinishReason: string(resp.FinishReason), |
| 1253 | Usage: normalizeUsage(resp.Usage), |
| 1254 | Warnings: normalizeWarnings(resp.Warnings), |
| 1255 | StructuredOutput: true, |
| 1256 | } |
| 1257 | } |
| 1258 | |
| 1259 | func streamErrorStatus(current Status, err error) Status { |
| 1260 | if current == StatusError { |
no test coverage detected