diff --git a/react-native/src/api/open-api.ts b/react-native/src/api/open-api.ts index 2fcbd9b..e8b0912 100644 --- a/react-native/src/api/open-api.ts +++ b/react-native/src/api/open-api.ts @@ -8,6 +8,7 @@ import { } from '../storage/StorageUtils.ts'; import { BedrockMessage, + DocumentContent, ImageContent, OpenAIMessage, TextContent, @@ -225,6 +226,18 @@ function getOpenAIMessages( }), }; } + const hasDoc = message.content.some(content => 'document' in content); + if (hasDoc) { + const text = message.content.find( + content => 'text' in content + ) as TextContent; + const doc = message.content.find(content => 'document' in content); + const docContent = (doc as DocumentContent).document.source.bytes; + return { + role: message.role, + content: text.text + '\nDocument base64 is:\n ' + docContent, + }; + } return { role: message.role, content: message.content diff --git a/react-native/src/chat/component/CustomSendComponent.tsx b/react-native/src/chat/component/CustomSendComponent.tsx index 6272ef6..e0768d8 100644 --- a/react-native/src/chat/component/CustomSendComponent.tsx +++ b/react-native/src/chat/component/CustomSendComponent.tsx @@ -89,7 +89,8 @@ const isMultiModalModel = (): boolean => { textModelId.includes('nova-pro') || textModelId.includes('nova-lite') || textModelId.startsWith('ollama') || - textModelId.startsWith('gpt') + textModelId.startsWith('gpt') || + textModelId.startsWith('deepseek') ); };