fyodorov-llm-agents 0.2.122__py3-none-any.whl → 0.2.124__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.
- fyodorov_llm_agents/agents/agent.py +6 -7
- {fyodorov_llm_agents-0.2.122.dist-info → fyodorov_llm_agents-0.2.124.dist-info}/METADATA +1 -1
- fyodorov_llm_agents-0.2.124.dist-info/RECORD +7 -0
- fyodorov_llm_agents-0.2.122.dist-info/RECORD +0 -7
- {fyodorov_llm_agents-0.2.122.dist-info → fyodorov_llm_agents-0.2.124.dist-info}/WHEEL +0 -0
- {fyodorov_llm_agents-0.2.122.dist-info → fyodorov_llm_agents-0.2.124.dist-info}/top_level.txt +0 -0
@@ -74,17 +74,16 @@ class Agent(BaseModel):
|
|
74
74
|
}
|
75
75
|
|
76
76
|
def call_with_fn_calling(self, input: str = "", history = []) -> dict:
|
77
|
+
litellm.set_verbose = True
|
77
78
|
model = self.model
|
78
79
|
# Set environmental variable
|
79
80
|
if self.api_key.startswith('sk-'):
|
80
|
-
|
81
|
+
os.environ["OPENAI_API_KEY"] = self.api_key
|
81
82
|
self.api_url = "https://api.openai.com/v1"
|
82
83
|
elif self.api_key and self.api_key != '':
|
83
84
|
model = 'mistral/'+self.model
|
84
|
-
|
85
|
-
|
86
|
-
else:
|
87
|
-
litellm.api_base = self.api_url
|
85
|
+
os.environ["MISTRAL_API_KEY"] = self.api_key
|
86
|
+
self.api_url = "https://api.mistral.ai/v1"
|
88
87
|
|
89
88
|
messages: [] = [
|
90
89
|
{"content": self.prompt, "role": "system"},
|
@@ -95,10 +94,10 @@ class Agent(BaseModel):
|
|
95
94
|
tools = [tool.get_function() for tool in self.tools]
|
96
95
|
if tools and litellm.supports_function_calling(model=model):
|
97
96
|
print(f"calling litellm with model {self.model}, tools: {tools}, messages: {messages}, max_retries: 0, history: {history}")
|
98
|
-
response = litellm.completion(model=model, messages=messages, max_retries=0, tools=tools, tool_choice="auto")
|
97
|
+
response = litellm.completion(model=model, messages=messages, max_retries=0, tools=tools, tool_choice="auto", base_url=self.api_url)
|
99
98
|
else:
|
100
99
|
print(f"calling litellm with model {self.model}, messages: {messages}, max_retries: 0, history: {history}")
|
101
|
-
response = litellm.completion(model=model, messages=messages, max_retries=0)
|
100
|
+
response = litellm.completion(model=model, messages=messages, max_retries=0, base_url=self.api_url)
|
102
101
|
print(f"Response: {response}")
|
103
102
|
tool_calls = []
|
104
103
|
if hasattr(response, 'tool_calls'):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fyodorov_llm_agents
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.124
|
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=bDztxFseKX-C3IlMFwSEVIrXUWppnNb_b4Mita8iUe4,6186
|
2
|
+
fyodorov_llm_agents/agents/openai.py,sha256=FA5RS7yn3JwvFA8PXju60XSYC_2oUZFNgBUzeIYtGv0,1154
|
3
|
+
fyodorov_llm_agents/tools/tool.py,sha256=HyOk0X_3XE23sa8J-8UZx657tJ0sxwZWMbA4OPxXU6E,7940
|
4
|
+
fyodorov_llm_agents-0.2.124.dist-info/METADATA,sha256=UcAHX6orrqB1uzMwbaq45OTc3kgit7_8bT4DqDovZ5M,552
|
5
|
+
fyodorov_llm_agents-0.2.124.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
+
fyodorov_llm_agents-0.2.124.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
|
7
|
+
fyodorov_llm_agents-0.2.124.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
fyodorov_llm_agents/agents/agent.py,sha256=h0jhRCrCknx1ORGxWWD1b9zWV3coc5XlFUtimL5235E,6147
|
2
|
-
fyodorov_llm_agents/agents/openai.py,sha256=FA5RS7yn3JwvFA8PXju60XSYC_2oUZFNgBUzeIYtGv0,1154
|
3
|
-
fyodorov_llm_agents/tools/tool.py,sha256=HyOk0X_3XE23sa8J-8UZx657tJ0sxwZWMbA4OPxXU6E,7940
|
4
|
-
fyodorov_llm_agents-0.2.122.dist-info/METADATA,sha256=PJiOquJA5BLNqZkbGS038vanXsQ3jef-uqEIyYcQ3l4,552
|
5
|
-
fyodorov_llm_agents-0.2.122.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
-
fyodorov_llm_agents-0.2.122.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
|
7
|
-
fyodorov_llm_agents-0.2.122.dist-info/RECORD,,
|
File without changes
|
{fyodorov_llm_agents-0.2.122.dist-info → fyodorov_llm_agents-0.2.124.dist-info}/top_level.txt
RENAMED
File without changes
|