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

Two bugs in your gemini api doc need to be fixed, please: "Inconsistent Documentation and Errors with Text-Only Models and Streamed Responses" #140

Closed
eawlot3000 opened this issue May 15, 2024 · 2 comments
Labels
component:other Issues unrelated to examples/quickstarts status:awaiting response Awaiting a response from the author type:bug Something isn't working

Comments

@eawlot3000
Copy link

eawlot3000 commented May 15, 2024

The overall reference link: Google Gemini API Documentation

Description of the Bug:

Title: Inconsistent Documentation and Errors with Text-Only Models and Streamed Responses

Description:
I encountered several issues while using the Google Gemini API, specifically related to text-only input and streamed responses.

  1. Text-Only Input Issue:
    The documentation states that the Gemini API can handle text-only input. However, the example provided uses the 'gemini-pro-vision' model, which requires an image. This causes an error when executed.

  2. Streamed Responses Issue:
    The documentation example for streamed responses is incorrect. When executing the provided code, an AttributeError is raised.

Steps to Reproduce:

  1. For Text-Only Input Issue:

    • Refer to the documentation here.
    • Use the provided example code:
      model = genai.GenerativeModel('gemini-pro-vision')
      prompt = "Write a story about a magic backpack."
      response = model.generate_content(prompt)
    • Run the code in the terminal on macOS with Python 3.10.
  2. For Streamed Responses Issue:

    • Refer to the documentation here.
    • Use the provided example code:
      prompt = "Write a story about a magic backpack."
      response = genai.stream_generate_content(
        model="models/gemini-pro",
        prompt=prompt
      )
    • Run the code in the terminal on macOS with Python 3.10.

Expected Behavior:

  1. The text-only example should use a non-vision model to avoid the error.
  2. The streamed response example should work without raising an AttributeError.

Actual Behavior:

  1. Text-Only Input Issue:
    When running the text-only example, I received the following error:

    google.api_core.exceptions.InvalidArgument: 400 Add an image to use models/gemini-pro-vision, or switch your model to a text model.
    [Process exited 1]
    
  2. Streamed Responses Issue:
    When running the streamed response example, I received the following error:

    Traceback (most recent call last):
      File "xxxxxxxxxxsomething/here/test.py", line 46, in <module>
        response = genai.stream_generate_content(
    AttributeError: module 'google.generativeai' has no attribute 'stream_generate_content'
    [Process exited 1]
    

Development Environment:

  • OS: macOS
  • Python Version: 3.10
  • Terminal: Built-in macOS Terminal App

Please address these documentation errors to ensure the examples work correctly for users.

Thanks,
github user @eawlot3000

@eawlot3000 eawlot3000 added component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder type:bug Something isn't working labels May 15, 2024
@eawlot3000 eawlot3000 changed the title Two bugs in your gemini api doc need to be fixed, please: Inconsistent Documentation and Errors with Text-Only Models and Streamed Responses Two bugs in your gemini api doc need to be fixed, please:Inconsistent Documentation and Errors with Text-Only Models and Streamed Responses May 15, 2024
@eawlot3000 eawlot3000 changed the title Two bugs in your gemini api doc need to be fixed, please:Inconsistent Documentation and Errors with Text-Only Models and Streamed Responses Two bugs in your gemini api doc need to be fixed, please: "Inconsistent Documentation and Errors with Text-Only Models and Streamed Responses" May 15, 2024
@singhniraj08
Copy link
Collaborator

@eawlot3000, Thank you reporting this issue.
This repository is for issues related to collection of guides and examples for the Gemini API like bugs or improvements. For issues related to Gemini, we would suggest you to use "Send Documentation Feedback" option in Gemini docs. Ref: Screenshot below.

image

@singhniraj08 singhniraj08 added status:awaiting response Awaiting a response from the author component:other Issues unrelated to examples/quickstarts and removed component:examples Issues/PR referencing examples folder component:quickstarts Issues/PR referencing quickstarts folder labels May 20, 2024
@eawlot3000
Copy link
Author

@singhniraj08 uh oh, wrong place. Got it! I will try to submit there. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:other Issues unrelated to examples/quickstarts status:awaiting response Awaiting a response from the author type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants