Closed andreibondarev closed 2 weeks ago
Should we also support sending image data directly? This doesn't seem to work currently:
assistant.add_message_and_run(
images: ["xxx-base64-data-zzz"],
content: "Please describe this image"
)
3.2.1 :004 > assistant.add_message_and_run(
3.2.1 :005 > images: ["xxx-base64-data-zzz"],
3.2.1 :006 > content: "Please describe this image"
3.2.1 :007 > )
/Users/mattlindsey/github/langchainrb/lib/langchain/assistant.rb:159:in `add_message_and_run': unknown keyword: :images (ArgumentError)
from (irb):4:in `<main>'
from bin/console:51:in `<main>'
@mattlindsey: Should we also support sending image data directly? This doesn't seem to work currently:
No, I don't think so, not yet.
@mattlindsey: Should we also support sending image data directly? This doesn't seem to work currently:
No, I don't think so, not yet.
When Ollama supports sending just the URL to the llm (which OpenAI supports now), how will we indicate that we want to do that instead of fetching it into base64 in memory first? Maybe there's a nice way to indicate which method to do regardless of the llm.
Description
When using the
Langchain::Assistant
, with Ollama, we'd like to be able to send an image URLs to the LLM. Ollama docs: https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion.We should be able to do the following:
Since Ollama only accepts base64-encoded images, we should download the image into memory and then convert to its Base64 format.
Sample code that I've prototyped:
Tasks:
image_url
and converting it to Base64 here.