mause123
commited on
Commit
·
32d2dd2
1
Parent(s):
14db953
Switch default provider to Groq to avoid Google API rate limits
Browse files- agent.py +1 -1
- simple_app.py +4 -4
agent.py
CHANGED
|
@@ -195,7 +195,7 @@ tools = [
|
|
| 195 |
]
|
| 196 |
|
| 197 |
# Build graph function
|
| 198 |
-
def build_graph(provider: str = "
|
| 199 |
"""Build the graph"""
|
| 200 |
# Load environment variables from .env file
|
| 201 |
if provider == "google":
|
|
|
|
| 195 |
]
|
| 196 |
|
| 197 |
# Build graph function
|
| 198 |
+
def build_graph(provider: str = "groq"):
|
| 199 |
"""Build the graph"""
|
| 200 |
# Load environment variables from .env file
|
| 201 |
if provider == "google":
|
simple_app.py
CHANGED
|
@@ -32,12 +32,12 @@ class SimpleAgent:
|
|
| 32 |
# Check which provider to use based on available API keys
|
| 33 |
def get_available_provider():
|
| 34 |
"""Check which LLM provider is available based on environment variables"""
|
| 35 |
-
if os.getenv("
|
| 36 |
-
return "google"
|
| 37 |
-
elif os.getenv("GROQ_API_KEY"):
|
| 38 |
return "groq"
|
|
|
|
|
|
|
| 39 |
else:
|
| 40 |
-
return "
|
| 41 |
|
| 42 |
# Initialize agent with available provider
|
| 43 |
provider = get_available_provider()
|
|
|
|
| 32 |
# Check which provider to use based on available API keys
|
| 33 |
def get_available_provider():
|
| 34 |
"""Check which LLM provider is available based on environment variables"""
|
| 35 |
+
if os.getenv("GROQ_API_KEY"):
|
|
|
|
|
|
|
| 36 |
return "groq"
|
| 37 |
+
elif os.getenv("GOOGLE_API_KEY"):
|
| 38 |
+
return "google"
|
| 39 |
else:
|
| 40 |
+
return "groq" # Default, will show error if no key
|
| 41 |
|
| 42 |
# Initialize agent with available provider
|
| 43 |
provider = get_available_provider()
|