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

@ -1,3 +1,5 @@
import { BlockKind } from '@/components/block';
export const blocksPrompt = `
Blocks is a special user interface mode that helps users with writing, editing, and other content creation tasks. When block is open, it is on the right side of the screen, while the conversation is on the left side. When creating or updating documents, changes are reflected in real-time on the blocks and visible to the user.
@ -62,8 +64,20 @@ print(f"Factorial of 5 is: {factorial(5)}")
\`\`\`
`;
export const updateDocumentPrompt = (currentContent: string | null) => `\
Update the following contents of the document based on the given prompt.
export const updateDocumentPrompt = (
currentContent: string | null,
type: BlockKind,
) =>
type === 'text'
? `\
Improve the following contents of the document based on the given prompt.
${currentContent}
`;
`
: type === 'code'
? `\
Improve the following code snippet based on the given prompt.
${currentContent}
`
: '';