Find answers from the community

Updated 2 weeks ago

Integrating Image Reasoning into Prompt Template

Hello there, was wondering if we could pass images in prompt template

currently what i am doing is
prompt = prompt_template.format(
system_prompt=agent.system_prompt,
history=message_history,
context=context_str,
question=query,
agent_id=str(agent.id),
)

openai_agent = OpenAIAgent.from_tools(
tools_to_use,
llm=llm,
verbose=True,
tool_call_parser=advanced_tool_call_parser,
)
response = openai_agent.stream_chat(prompt)

but I want to add image reasoning also. was wondering how we do it. If anyone have idea, please help
I am able to get response like doing this
sample_message = ChatMessage(
role=MessageRole.USER,
blocks=[
TextBlock(text=text),
ImageBlock(url=image_url)
],
)

openai_llm = OpenAI(model=settings.OPENAI_MODEL, api_key=settings.OPEN_AI_API)
re = openai_llm.chat(messages=[sample_message])

but having difficulty integrating to stream_chat and prompt template
L
N
3 comments
Prompt templates don't support images just yet. Soon though!

The openai agent also does not support images in the input. I believe the new AgentWorkflow should though, if you saw that
Oh. I am using OpenAiAgent from llama_index.agent.openai import OpenAIAgent, . Is there any way to pass image to these? @Logan M
There is not right now
Add a reply
Sign up and join the conversation on Discord