Rudraprasad commited on
Commit
1d20e47
·
verified ·
1 Parent(s): 75eef45

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +15 -7
agents.py CHANGED
@@ -5,8 +5,10 @@ import requests
5
  import yaml
6
  import pandas as pd
7
 
 
8
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
9
- from smolagents import CodeAgent, DuckDuckGoSearchTool, VisitWebpageTool, WikipediaSearchTool, Tool, OpenAIServerModel, SpeechToTextTool
 
10
 
11
  class GetTaskFileTool(Tool):
12
  name = "get_task_file_tool"
@@ -55,12 +57,18 @@ prompts["system_prompt"] = ("You are a general AI assistant. I will ask you a qu
55
  + prompts["system_prompt"])
56
 
57
  def agentRudra():
58
- gemini_model = OpenAIServerModel(
59
- model_id="gemini-2.0-flash",
60
- api_base="https://generativelanguage.googleapis.com/v1beta/openai/",
61
- api_key=os.getenv("API_KEY"),
62
- temperature=0.7
 
 
 
 
 
63
  )
 
64
  agent = CodeAgent(
65
  tools=[
66
  DuckDuckGoSearchTool(),
@@ -71,7 +79,7 @@ def agentRudra():
71
  LoadXlsxFileTool(),
72
  LoadTextFileTool()
73
  ],
74
- model=gemini_model,
75
  prompt_templates=prompts,
76
  max_steps=15,
77
  additional_authorized_imports = ["pandas"]
 
5
  import yaml
6
  import pandas as pd
7
 
8
+
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, VisitWebpageTool, WikipediaSearchTool, Tool, SpeechToTextTool
11
+ from langchain_groq import ChatGroq
12
 
13
  class GetTaskFileTool(Tool):
14
  name = "get_task_file_tool"
 
57
  + prompts["system_prompt"])
58
 
59
  def agentRudra():
60
+ # gemini_model = OpenAIServerModel(
61
+ # model_id="gemini-2.0-flash",
62
+ # api_base="https://generativelanguage.googleapis.com/v1beta/openai/",
63
+ # api_key=os.getenv("API_KEY"),
64
+ # temperature=0.7
65
+ # )
66
+ model = ChatGroq(
67
+ model_name="llama3-8b-8192",
68
+ api_key=groq_api_key,
69
+ temperature=0
70
  )
71
+
72
  agent = CodeAgent(
73
  tools=[
74
  DuckDuckGoSearchTool(),
 
79
  LoadXlsxFileTool(),
80
  LoadTextFileTool()
81
  ],
82
+ model=model,
83
  prompt_templates=prompts,
84
  max_steps=15,
85
  additional_authorized_imports = ["pandas"]