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

Function normalizeObjectResponse

coderd/x/chatd/chatdebug/model.go:1245–1257  ·  view source on GitHub ↗
(resp *fantasy.ObjectResponse)

Source from the content-addressed store, hash-verified

1243}
1244
1245func 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
1259func streamErrorStatus(current Status, err error) Status {
1260 if current == StatusError {

Callers 1

GenerateObjectMethod · 0.85

Calls 2

normalizeUsageFunction · 0.85
normalizeWarningsFunction · 0.85

Tested by

no test coverage detected