fyodorov-llm-agents 0.2.98__py3-none-any.whl → 0.2.100__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -72,11 +72,16 @@ class Agent(BaseModel):
72
72
  'rag': self.rag,
73
73
  }
74
74
 
75
- def call_with_fn_calling(self, prompt: str = "", input: str = ""):
75
+ def call_with_fn_calling(self, prompt: str = "", input: str = "", history = []) -> dict:
76
76
  # Set environmental variable
77
- os.environ["OPENAI_API_KEY"] = self.api_key
77
+ if self.api_key.startswith('sk-'):
78
+ os.environ["OPENAI_API_KEY"] = self.api_key
79
+ else:
80
+ os.environ["MISTRAL_API_KEY"] = self.api_key
81
+
78
82
  messages: [] = [
79
83
  {"content": prompt, "role": "system"},
84
+ *history,
80
85
  { "content": input, "role": "user"},
81
86
  ]
82
87
  tools = [tool.get_function() for tool in self.tools]
@@ -90,7 +95,8 @@ class Agent(BaseModel):
90
95
  answer = response.choices[0].message.content
91
96
  print(f"Answer: {answer}")
92
97
  return {
93
- "answer": answer
98
+ "answer": answer,
99
+
94
100
  }
95
101
 
96
102
  @staticmethod
@@ -116,7 +116,6 @@ class Tool(BaseModel):
116
116
  raise ValueError('YAML string is required')
117
117
  tool_dict = yaml.safe_load(yaml_str)
118
118
  tool = Tool.from_plugin_json(tool_dict)
119
- tool.validate()
120
119
  return tool
121
120
 
122
121
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fyodorov_llm_agents
3
- Version: 0.2.98
3
+ Version: 0.2.100
4
4
  Summary: LLM agents for the Fyodorov AI suite
5
5
  Author-email: Daniel Ransom <02masseur.alibis@icloud.com>
6
6
  Project-URL: Homepage, https://github.com/FyodorovAI/fyodorov-llm-agents
@@ -0,0 +1,7 @@
1
+ fyodorov_llm_agents/agents/agent.py,sha256=lpD-qR-HOFquyRVPOT1cEzbDROGKBddaM74DJNdTFcU,3980
2
+ fyodorov_llm_agents/agents/openai.py,sha256=FA5RS7yn3JwvFA8PXju60XSYC_2oUZFNgBUzeIYtGv0,1154
3
+ fyodorov_llm_agents/tools/tool.py,sha256=ytc06THGiIt01KVPu10ywyWp4kCaDmwngRBfIERBpO4,7163
4
+ fyodorov_llm_agents-0.2.100.dist-info/METADATA,sha256=uRvYCBSZJgzwvyrpIxG-qeIWjApUSBIWFYl_qNbzlfQ,552
5
+ fyodorov_llm_agents-0.2.100.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
+ fyodorov_llm_agents-0.2.100.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
7
+ fyodorov_llm_agents-0.2.100.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- fyodorov_llm_agents/agents/agent.py,sha256=mC59vOECMI2Dp6zjCK4rJXCVHV_Ivx8KkB38L_bh5hw,3815
2
- fyodorov_llm_agents/agents/openai.py,sha256=FA5RS7yn3JwvFA8PXju60XSYC_2oUZFNgBUzeIYtGv0,1154
3
- fyodorov_llm_agents/tools/tool.py,sha256=YEfvur0hWWR14ZIlrcGZKBhoMUMkoaaHxURw2uJGym4,7187
4
- fyodorov_llm_agents-0.2.98.dist-info/METADATA,sha256=0UJf97ww8uaQpnlsOfNgl0mbNXXIgUo3WsOj93MKkyI,551
5
- fyodorov_llm_agents-0.2.98.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
- fyodorov_llm_agents-0.2.98.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
7
- fyodorov_llm_agents-0.2.98.dist-info/RECORD,,