Skip to content

Commit

Permalink
[JS] fix type of image message
Browse files Browse the repository at this point in the history
  • Loading branch information
kuojianlu committed Jan 4, 2024
1 parent 6f744df commit 17df4f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/packages/teams-ai/src/prompts/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export interface TextContentPart {

export interface ImageContentPart {
/**
* Type of the message content. Should always be 'image'.
* Type of the message content. Should always be 'image_url'.
*/
type: 'image';
type: 'image_url';

/**
* The URL of the image.
Expand Down
2 changes: 1 addition & 1 deletion js/packages/teams-ai/src/prompts/UserInputMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class UserInputMessage extends PromptSectionBase {

// Add image
const url = `data:${image.contentType};base64,${image.content.toString('base64')}`;
message.content!.push({ type: 'image', image_url: { url } });
message.content!.push({ type: 'image_url', image_url: { url } });
length += 85;
budget -= 85;
}
Expand Down

0 comments on commit 17df4f0

Please sign in to comment.