Skip to content

Commit

Permalink
Added Union types to ChatCompletionMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
mpatankar committed Jan 3, 2025
1 parent c9c1707 commit 939d7c3
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/resources/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ export interface ChatCompletionFunctionMessageParam {
}

export interface ChatCompletionMessage {
content: string | null;
content:
| string
| Array<
| ChatCompletionsAPI.ChatCompletionStructuredMessageText
| ChatCompletionsAPI.ChatCompletionStructuredMessageImageURL
>
| null;

role: 'assistant';

Expand Down Expand Up @@ -433,11 +439,11 @@ export namespace CompletionCreateParams {
* format.
*/
content:
| string
| Array<
| ChatCompletionsAPI.ChatCompletionStructuredMessageText
| ChatCompletionsAPI.ChatCompletionStructuredMessageImageURL
>;
| string
| Array<
| ChatCompletionsAPI.ChatCompletionStructuredMessageText
| ChatCompletionsAPI.ChatCompletionStructuredMessageImageURL
>;

/**
* The role of the messages author. Choice between: system, user, or assistant.
Expand Down

0 comments on commit 939d7c3

Please sign in to comment.