import { chat } from "https://esm.town/v/stevekrouse/openai?v=19";
export async function getGPT4oEmoji(url) {
const response = await chat([
{
role: "system",
content: `
You are a helpful assistant.
I will provide you with a photo, and I would like an emoji that best captures the essence of the photo.
Reply with 1 to 5 emojis that the image evokes. Prefer fewer emojis.
`,
},
{
role: "user",
content: [{
type: "image_url",
image_url: {
url,
},
}],
},
], {
model: "gpt-4o",
max_tokens: 100,
});
return response.content;
}