You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During my latest project, I came across the idea of introducing a vision language to process images. Some parts of my code can be seen below for a two-agent collaboration workflow.
defprocess_single_image() ->dict:
"""Process a single image and return the results."""# Only use this for langgraph studio debugging --------------------------------------image_directory='C:/Users/Images/'image_path= [os.listdir(image_directory)[-1]]
# ----------------------------------------------------------------------------------try:
# Encode the imagebase64_image=encode_image(image_path)
# Create initial stateinitial_state= {
"messages": [
HumanMessage(content=[{
"type": "image_url",
"image_url": {
"url": f"data:image/png;base64,{base64_image}"
}
}])
],
"sender": "human",
"file_path": image_path
}
# Run the graphresult=graph.invoke(initial_state)
returnresultexceptExceptionase:
print(f"Error processing {image_path}: {str(e)}")
return {"error": str(e)}
How can I import an image directly in the Langgraph Studio platform? Maybe it is impossible yet if someone else knows better, please let me know :)
The text was updated successfully, but these errors were encountered:
Hey everyone:
During my latest project, I came across the idea of introducing a vision language to process images. Some parts of my code can be seen below for a two-agent collaboration workflow.
How can I import an image directly in the Langgraph Studio platform? Maybe it is impossible yet if someone else knows better, please let me know :)
The text was updated successfully, but these errors were encountered: