diff --git a/src/components/thread/index.tsx b/src/components/thread/index.tsx index 1bb5fa3..1066413 100644 --- a/src/components/thread/index.tsx +++ b/src/components/thread/index.tsx @@ -182,9 +182,6 @@ export function Thread() { return; setFirstTokenReceived(false); - // TODO: check configurable object for modelname camelcase or snakecase else do openai format - const isOpenAI = true; - const newHumanMessage: Message = { id: uuidv4(), type: "human", diff --git a/src/lib/multimodal-utils.ts b/src/lib/multimodal-utils.ts index 2710e3a..645bb41 100644 --- a/src/lib/multimodal-utils.ts +++ b/src/lib/multimodal-utils.ts @@ -1,5 +1,4 @@ import type { Base64ContentBlock } from "@langchain/core/messages"; -import { convertToOpenAIImageBlock } from "@langchain/core/messages"; // Returns a Promise of a typed multimodal block for images export async function fileToImageBlock( @@ -46,15 +45,3 @@ export async function fileToBase64(file: File): Promise { reader.readAsDataURL(file); }); } - -// Utility to convert base64 image blocks to OpenAI image_url format -export function toOpenAIImageBlock(block: Base64ContentBlock | any) { - if (block.type === "image" && block.source_type === "base64") { - return convertToOpenAIImageBlock(block); - } - return block; -} - -const cleanBase64 = (base64String: string): string => { - return base64String.replace(/^data:.*?;base64,/, ""); -};