Skip to content

Python scraper based on AI

fix: gemini errror

VinciGit002ea54eab1d07
diff --git a/examples/gemini/csv_scraper_gemini.py b/examples/gemini/csv_scraper_gemini.py
index c19419b0..7923cf37 100644
--- a/examples/gemini/csv_scraper_gemini.py
+++ b/examples/gemini/csv_scraper_gemini.py
@@ -19,20 +19,13 @@ text = pd.read_csv("inputs/username.csv")
# ************************************************
# Define the configuration for the graph
# ************************************************
+gemini_key = os.getenv("GOOGLE_APIKEY")
graph_config = {
"llm": {
- "model": "ollama/mistral",
- "temperature": 0,
- "format": "json", # Ollama needs the format to be specified explicitly
- # "model_tokens": 2000, # set context length arbitrarily
- "base_url": "http://localhost:11434",
+ "api_key": gemini_key,
+ "model": "gemini-pro",
},
- "embeddings": {
- "model": "ollama/nomic-embed-text",
- "temperature": 0,
- "base_url": "http://localhost:11434",
- }
}
# ************************************************
diff --git a/examples/gemini/smart_scraper_gemini.py b/examples/gemini/smart_scraper_gemini.py
index b3b25024..1319ab95 100644
--- a/examples/gemini/smart_scraper_gemini.py
+++ b/examples/gemini/smart_scraper_gemini.py
@@ -18,7 +18,7 @@ gemini_key = os.getenv("GOOGLE_APIKEY")
graph_config = {
"llm": {
"api_key": gemini_key,
- "model": "gpt-3.5-turbo",
+ "model": "gemini-pro",
},
}
diff --git a/scrapegraphai/helpers/models_tokens.py b/scrapegraphai/helpers/models_tokens.py
index 73a3999f..55d3e689 100644
--- a/scrapegraphai/helpers/models_tokens.py
+++ b/scrapegraphai/helpers/models_tokens.py
@@ -20,7 +20,9 @@ models_tokens = {
"gpt-4-32k-0613": 32768,
},
"azure": {
- "gpt-3.5-turbo": 4096
+ "gpt-3.5-turbo": 4096,
+ "gpt-4": 8192,
+ "gpt-4-32k": 32768
},
"gemini": {
"gemini-pro": 128000,
@@ -48,4 +50,3 @@ models_tokens = {
"claude3": 200000
}
}
-