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

Simplify File Usage #419

Open
MarkDaoust opened this issue Jan 23, 2025 · 0 comments
Open

Simplify File Usage #419

MarkDaoust opened this issue Jan 23, 2025 · 0 comments
Labels
good first issue Good for newcomers type:bug Something isn't working

Comments

@MarkDaoust
Copy link
Contributor

Description of the bug:

There are a bunch of examples for the new SDK rthat look like this:

response = client.models.generate_content(
    model=MODEL_ID,
    contents=[
        types.Content(
            role="user",
            parts=[
                types.Part.from_uri(
                    file_uri=file_upload.uri,
                    mime_type=file_upload.mime_type),
                ]),
        "Write a short and engaging blog post based on this picture.",
    ]
)

They can be simplified to:

response = client.models.generate_content(
    model=MODEL_ID,
    contents=[
        file_upload,
        "Write a short and engaging blog post based on this picture.",
    ]
)

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

@MarkDaoust MarkDaoust added the type:bug Something isn't working label Jan 23, 2025
@markmcd markmcd added the good first issue Good for newcomers label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants