feat: support image outputs during code execution (#674)

Co-authored-by: Bailey Simrell <baileysimrell@gmail.com>
This commit is contained in:
Jeremy 2025-01-08 00:00:21 +05:30 committed by GitHub
parent 50fbc0dab2
commit 50bd4604b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 313 additions and 117 deletions

View file

@ -254,7 +254,7 @@ export async function POST(request: Request) {
if (document.kind === 'text') {
const { fullStream } = streamText({
model: customModel(model.apiIdentifier),
system: updateDocumentPrompt(currentContent),
system: updateDocumentPrompt(currentContent, 'text'),
prompt: description,
experimental_providerMetadata: {
openai: {
@ -284,7 +284,7 @@ export async function POST(request: Request) {
} else if (document.kind === 'code') {
const { fullStream } = streamObject({
model: customModel(model.apiIdentifier),
system: updateDocumentPrompt(currentContent),
system: updateDocumentPrompt(currentContent, 'code'),
prompt: description,
schema: z.object({
code: z.string(),