From 25b57dbd07ce9162c2f236edee53e7b2c7a357bf Mon Sep 17 00:00:00 2001 From: cyclic Date: Sun, 5 Oct 2025 23:28:16 -0600 Subject: [PATCH] clarified `choices` type in `CompletionsResponse` to the correct api standard of being an array of choices --- src/init.luau | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/init.luau b/src/init.luau index 9460074..f4ce7a0 100644 --- a/src/init.luau +++ b/src/init.luau @@ -15,8 +15,8 @@ export type message = { name: string }, id: string, - index: number?, - type: 'function' + index: number?, -- according to x.ai's documentation, this is 'integer | null' so i guess it can for some reason not exist? + type: 'function'? } }? } @@ -26,7 +26,7 @@ export type CompletionsResponse = { object: 'chat.completion', created: number, model: string, - choices: { + choices: { { index: number, message: message, finish_reason: "stop" | "length" | "function_call" | "content_filter" | "null", @@ -48,7 +48,7 @@ export type CompletionsResponse = { } } }? - }, + } }, citations: { string }?, system_fingerprint: string?, usage: {