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

Got IndexError with gemini model. #805

Closed
GUNAND12 opened this issue Nov 17, 2024 · 4 comments
Closed

Got IndexError with gemini model. #805

GUNAND12 opened this issue Nov 17, 2024 · 4 comments

Comments

@GUNAND12
Copy link

I tried running below code but got an IndexError: list index out of range

graph_config = {
    "llm": {
        "api_key": "YOUR_GEMINI_APIKEY",
        "model": "gemini-1.5-pro",
    },
    "verbose": True,
    "headless": False,
}

# Create the SmartScraperGraph instance
smart_scraper_graph = SmartScraperGraph(
    prompt="Find some information about what does the company do, the name and a contact email.",
    source="https://scrapegraphai.com/",
    config=graph_config
)

# Run the pipeline
result = smart_scraper_graph.run()

I also tried changing the model gemini-pro.

@Levyathanus
Copy link

Hi, I'm openinig a PR for this. In the meantime you can try to specify the model provider in the graph configuration like this:

graph_config = {
    "llm": {
        "api_key": "YOUR_GEMINI_APIKEY",
        "model": "google_genai/gemini-1.5-pro",
    },
    "verbose": True,
    "headless": False,
}

and see if it works.

Levyathanus added a commit to Levyathanus/Scrapegraph-ai that referenced this issue Nov 17, 2024
VinciGit00 added a commit that referenced this issue Nov 18, 2024
fix: try to infer possible provider from the model name, resolves #805
github-actions bot pushed a commit that referenced this issue Nov 18, 2024
## [1.30.0-beta.5](v1.30.0-beta.4...v1.30.0-beta.5) (2024-11-18)

### Bug Fixes

* try to infer possible provider from the model name, resolves [#805](#805) ([d2d0312](d2d0312))
Copy link

🎉 This issue has been resolved in version 1.30.0-beta.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@VinciGit00
Copy link
Collaborator

Please look at the google examples, you forgot the complete name

@GUNAND12
Copy link
Author

Thanks @Levyathanus and @VinciGit00. It worked now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants