-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add sample code for base64 encoded image in Orchestration #466
Conversation
sample-code/src/orchestration.ts
Outdated
@@ -354,10 +356,14 @@ export async function orchestrationChatCompletionImage(): Promise<OrchestrationR | |||
} | |||
}); | |||
|
|||
const imageFilePath = join(__dirname, 'src', 'media', 'sample-image.png'); | |||
const mimeType = lookup(extname(imageFilePath).toLowerCase()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pp] Computing the mime type is maybe a bit overkill, since we anyway hardcode png here in the filename. Thus might Asseln hard code the mime type ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that hardcoding the mime type here is probably enough, but please keep it separate from the template string, so our users still know which part to replace, in case their image is of a different type.
Context
Closes SAP/ai-sdk-js-backlog#213.
What this PR does and why it is needed