clarified choices type in CompletionsResponse to the correct api standard of being an array of choices

This commit is contained in:
2025-10-05 23:28:16 -06:00
parent eb098ce266
commit 25b57dbd07

View File

@@ -15,8 +15,8 @@ export type message = {
name: string name: string
}, },
id: string, id: string,
index: number?, index: number?, -- according to x.ai's documentation, this is 'integer | null' so i guess it can for some reason not exist?
type: 'function' type: 'function'?
} }
}? }?
} }
@@ -26,7 +26,7 @@ export type CompletionsResponse = {
object: 'chat.completion', object: 'chat.completion',
created: number, created: number,
model: string, model: string,
choices: { choices: { {
index: number, index: number,
message: message, message: message,
finish_reason: "stop" | "length" | "function_call" | "content_filter" | "null", finish_reason: "stop" | "length" | "function_call" | "content_filter" | "null",
@@ -48,7 +48,7 @@ export type CompletionsResponse = {
} }
} }
}? }?
}, } },
citations: { string }?, citations: { string }?,
system_fingerprint: string?, system_fingerprint: string?,
usage: { usage: {