kirbah commited on
Commit
6e10d57
·
1 Parent(s): b13be81

added LiteLLMModel support

Browse files
Files changed (2) hide show
  1. basic_agent.py +6 -2
  2. requirements.txt +1 -0
basic_agent.py CHANGED
@@ -1,4 +1,5 @@
1
- from smolagents import ToolCallingAgent, DuckDuckGoSearchTool, InferenceClientModel
 
2
 
3
 
4
  class BasicAgent:
@@ -8,9 +9,12 @@ class BasicAgent:
8
  def __call__(self, question: str) -> str:
9
  print(f"Agent received question (first 50 chars): {question[:50]}...")
10
 
 
 
 
11
  agent = ToolCallingAgent(
12
  tools=[DuckDuckGoSearchTool()],
13
- model=InferenceClientModel(),
14
  max_steps=5,
15
  name="web_agent",
16
  description="Web Search Agent",
 
1
+ import os
2
+ from smolagents import ToolCallingAgent, DuckDuckGoSearchTool, InferenceClientModel, LiteLLMModel
3
 
4
 
5
  class BasicAgent:
 
9
  def __call__(self, question: str) -> str:
10
  print(f"Agent received question (first 50 chars): {question[:50]}...")
11
 
12
+ model = LiteLLMModel(model_id="groq/deepseek-r1-distill-llama-70b",
13
+ api_key=os.getenv("GROQ_API_KEY"))
14
+
15
  agent = ToolCallingAgent(
16
  tools=[DuckDuckGoSearchTool()],
17
+ model=model,
18
  max_steps=5,
19
  name="web_agent",
20
  description="Web Search Agent",
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
  gradio
2
  requests
3
  smolagents
 
4
  duckduckgo-search
 
1
  gradio
2
  requests
3
  smolagents
4
+ litellm
5
  duckduckgo-search