ScrapeGraphAI / Scrapegraph-ai

Python scraper based on AI
https://scrapegraphai.com
MIT License
15.87k stars 1.29k forks source link

Got IndexError with gemini model. #805

Closed GUNAND12 closed 3 days ago

GUNAND12 commented 5 days ago

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 commented 4 days ago

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.

github-actions[bot] commented 4 days ago

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

The release is available on:

Your semantic-release bot :package::rocket:

VinciGit00 commented 4 days ago

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

GUNAND12 commented 3 days ago

Thanks @Levyathanus and @VinciGit00. It worked now.

github-actions[bot] commented 3 days ago

:tada: This issue has been resolved in version 1.31.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 3 days ago

:tada: This issue has been resolved in version 1.31.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: