Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support images / binary input in Studio #220

Open
SergioRubio01 opened this issue Dec 30, 2024 · 1 comment
Open

Support images / binary input in Studio #220

SergioRubio01 opened this issue Dec 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@SergioRubio01
Copy link

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.

def process_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 image
        base64_image = encode_image(image_path)
        
        # Create initial state
        initial_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 graph
        result = graph.invoke(initial_state)
        return result
        
    except Exception as e:
        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 :)
image

@dqbd
Copy link
Collaborator

dqbd commented Dec 31, 2024

Hello! Image / binary input is not supported yet in Studio

@dqbd dqbd added enhancement New feature or request and removed enhancement New feature or request labels Dec 31, 2024
@dqbd dqbd changed the title How to import Image as state input in Studio Platform Support images / binary input in Studio Dec 31, 2024
@dqbd dqbd added the enhancement New feature or request label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants