Skip to content

Commit

Permalink
fix: type of finish reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongpinWang committed Nov 15, 2024
1 parent 63db0c4 commit 384f645
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class AzureOpenAiChatCompletionStreamChunkResponse {
* @param choiceIndex - The index of the choice to parse.
* @returns The finish reason.
*/
getFinishReason(choiceIndex = 0): string | undefined | null {
getFinishReason(choiceIndex = 0): string | undefined {
return this.data.choices.find((c: any) => c.index === choiceIndex)
?.finish_reason;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/type-tests/test/azure-openai.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ expectType<string | undefined | null>(
).getContent()
);

expectType<string | undefined | null>(
expectType<string | undefined>(
(
await new AzureOpenAiChatClient('gpt-4').run({
messages: [{ role: 'user', content: 'test prompt' }]
Expand Down

0 comments on commit 384f645

Please sign in to comment.