fix: patch image typing in new SDK (#36)
This commit is contained in:
@@ -842,6 +842,7 @@ export default function App({
|
||||
// Start the conversation loop
|
||||
await processConversation([
|
||||
{
|
||||
type: "message",
|
||||
role: "user",
|
||||
content: messageContent as unknown as MessageCreate["content"],
|
||||
},
|
||||
|
||||
@@ -106,7 +106,7 @@ export function clearPlaceholdersInText(text: string): void {
|
||||
|
||||
// Convert display text (with placeholders) into Letta content parts
|
||||
// Text placeholders are resolved; image placeholders become image content
|
||||
type Base64ImageSource = { type: "base64"; mediaType: string; data: string };
|
||||
type Base64ImageSource = { type: "base64"; media_type: string; data: string };
|
||||
type ContentPart =
|
||||
| { type: "text"; text: string }
|
||||
| { type: "image"; source: Base64ImageSource };
|
||||
@@ -144,7 +144,7 @@ export function buildMessageContentFromDisplay(text: string): ContentPart[] {
|
||||
type: "image",
|
||||
source: {
|
||||
type: "base64",
|
||||
mediaType: img.mediaType || "image/jpeg",
|
||||
media_type: img.mediaType || "image/jpeg",
|
||||
data: img.data,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ test("buildMessageContentFromDisplay handles image placeholders", () => {
|
||||
type: "image",
|
||||
source: {
|
||||
type: "base64",
|
||||
mediaType: "image/png",
|
||||
media_type: "image/png",
|
||||
data: "abc123",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user