alekn commited on
Commit
450dce9
·
verified ·
1 Parent(s): 0466935

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +3 -3
agent.py CHANGED
@@ -1,6 +1,6 @@
1
  from tools import all_tools
2
  from dotenv import load_dotenv
3
- from smolagents import InferenceClientModel, CodeAgent
4
  load_dotenv()
5
 
6
  model = InferenceClientModel(
@@ -11,12 +11,12 @@ model = InferenceClientModel(
11
 
12
  # Loads system prompt from the file
13
  with open("system_prompt.txt", "r", encoding="utf-8") as f:
14
- system_prompt = f.read()
15
 
16
  agent = CodeAgent(
17
  model=model,
18
  tools=all_tools,
19
- prompt_templates=system_prompt,
20
  additional_authorized_imports=['numpy', 'pandas'],
21
  add_base_tools=True
22
  )
 
1
  from tools import all_tools
2
  from dotenv import load_dotenv
3
+ from smolagents import InferenceClientModel, CodeAgent, PromptTemplates
4
  load_dotenv()
5
 
6
  model = InferenceClientModel(
 
11
 
12
  # Loads system prompt from the file
13
  with open("system_prompt.txt", "r", encoding="utf-8") as f:
14
+ prompts = PromptTemplates(system_prompt = f.read())
15
 
16
  agent = CodeAgent(
17
  model=model,
18
  tools=all_tools,
19
+ prompt_templates=prompts,
20
  additional_authorized_imports=['numpy', 'pandas'],
21
  add_base_tools=True
22
  )