Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 19 |
class CrewAIBasicAgent:
|
| 20 |
"""Wrapper class for CrewAI agent to match the expected interface."""
|
| 21 |
|
| 22 |
-
def __init__(self, provider: str = "
|
| 23 |
print(f"CrewAI Agent initialized with provider: {provider}")
|
| 24 |
try:
|
| 25 |
self.agent = LangChainAgent(provider=provider)
|
|
@@ -70,7 +70,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 70 |
|
| 71 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 72 |
try:
|
| 73 |
-
agent = CrewAIBasicAgent(provider="
|
| 74 |
except Exception as e:
|
| 75 |
print(f"Error instantiating CrewAI agent: {e}")
|
| 76 |
return f"Error initializing CrewAI agent: {e}", None
|
|
@@ -172,23 +172,25 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 172 |
|
| 173 |
# --- Build Gradio Interface using Blocks ---
|
| 174 |
with gr.Blocks() as demo:
|
| 175 |
-
gr.Markdown("# CrewAI Multi-Purpose Agent Evaluation Runner")
|
| 176 |
gr.Markdown(
|
| 177 |
"""
|
| 178 |
**CrewAI Agent Features:**
|
|
|
|
| 179 |
- **Multi-Agent Architecture**: Specialized agents for different types of tasks
|
| 180 |
- **Research Capabilities**: Search Wikipedia, ArXiv papers, and web sources
|
| 181 |
-
- **Mathematical Operations**: Perform calculations and solve mathematical problems
|
| 182 |
-
- **Intelligent Task Routing**: Automatically selects the best
|
|
|
|
| 183 |
|
| 184 |
**Instructions:**
|
| 185 |
1. Please clone this space, then modify the code to define your CrewAI agent's logic, tools, and packages
|
| 186 |
-
2. Add your API keys to the `.env` file (
|
| 187 |
3. Log in to your Hugging Face account using the button below
|
| 188 |
4. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your CrewAI agent, and see the score
|
| 189 |
---
|
| 190 |
-
**Note:** The CrewAI agent uses multiple specialized
|
| 191 |
-
|
| 192 |
"""
|
| 193 |
)
|
| 194 |
|
|
|
|
| 19 |
class CrewAIBasicAgent:
|
| 20 |
"""Wrapper class for CrewAI agent to match the expected interface."""
|
| 21 |
|
| 22 |
+
def __init__(self, provider: str = "groq"):
|
| 23 |
print(f"CrewAI Agent initialized with provider: {provider}")
|
| 24 |
try:
|
| 25 |
self.agent = LangChainAgent(provider=provider)
|
|
|
|
| 70 |
|
| 71 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 72 |
try:
|
| 73 |
+
agent = CrewAIBasicAgent(provider="groq") # Using Groq Llama instead of Google Gemini
|
| 74 |
except Exception as e:
|
| 75 |
print(f"Error instantiating CrewAI agent: {e}")
|
| 76 |
return f"Error initializing CrewAI agent: {e}", None
|
|
|
|
| 172 |
|
| 173 |
# --- Build Gradio Interface using Blocks ---
|
| 174 |
with gr.Blocks() as demo:
|
| 175 |
+
gr.Markdown("# CrewAI Multi-Purpose Agent Evaluation Runner (Powered by Groq Llama)")
|
| 176 |
gr.Markdown(
|
| 177 |
"""
|
| 178 |
**CrewAI Agent Features:**
|
| 179 |
+
- **Powered by Groq Llama 3.3 70B**: Ultra-fast inference with state-of-the-art language model
|
| 180 |
- **Multi-Agent Architecture**: Specialized agents for different types of tasks
|
| 181 |
- **Research Capabilities**: Search Wikipedia, ArXiv papers, and web sources
|
| 182 |
+
- **Mathematical Operations**: Perform complex calculations and solve mathematical problems
|
| 183 |
+
- **Intelligent Task Routing**: Automatically selects the best tools for each question
|
| 184 |
+
- **Advanced Memory Management**: Smart conversation memory with summarization for better context
|
| 185 |
|
| 186 |
**Instructions:**
|
| 187 |
1. Please clone this space, then modify the code to define your CrewAI agent's logic, tools, and packages
|
| 188 |
+
2. Add your API keys to the `.env` file (Groq, Tavily, etc.)
|
| 189 |
3. Log in to your Hugging Face account using the button below
|
| 190 |
4. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your CrewAI agent, and see the score
|
| 191 |
---
|
| 192 |
+
**Note:** The CrewAI agent uses Groq's ultra-fast Llama model with multiple specialized tools working together
|
| 193 |
+
to provide comprehensive and accurate answers. This combination provides both speed and intelligence.
|
| 194 |
"""
|
| 195 |
)
|
| 196 |
|