Closed matthewsinclair closed 7 months ago
Hi @matthewsinclair! No, nothing has been done yet to support sending images like that.
Is there any way to send arbitrary post params in a LangChain call?
No. Currently the features are centered around text based messages and functions.
That's a cool API that I haven't played with yet.
Hi @brainlid. Thanks so much for the quick reply.
I understand this has not been implemented yet, which explains why I couldn't get it to work!
I will close this now and wait for an update. Thanks again for all the hard work here.
All the best, M@
I've implemented this here: https://github.com/brainlid/langchain/pull/62 it's pretty incomplete from the OpenAI side, but this might help you.
I am experimenting with different libs to work with the OpenAI GPT APIs. I am trying to work out how to send an image with LangChain but nothing I do seems to work. I had a similar issue with ExOpenAI library (now solved) which you can see here: https://github.com/dvcrn/ex_openai/issues/13
I am trying to work out how to do something equivalent to this (which uses a raw HTTPoison's HTML post request):
That is just a snippet, but the
"type" => "image_url"...
bit is the bit I am trying to replicate with LangChain.I have tried this:
But no matter what I do with the function
get_prompt_attrs_for_image_from_data
nothing seems to work. If I just encode thecontent
as a string, then the OpenAI API flips out with a "too many tokens" because the image data is too big. But anything other than a string forcontent
causes a validation error from LangChain.Is there any way to send arbitrary post params in a LangChain call?
PS: For reference, this is how OpenAI describes the
type: :image_url
params: https://platform.openai.com/docs/guides/vision