fyodorov-llm-agents 0.2.118__py3-none-any.whl → 0.2.122__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.
@@ -5,7 +5,7 @@ import queue
5
5
  import threading
6
6
  import json
7
7
  import yaml
8
- from pydantic import BaseModel
8
+ from pydantic import BaseModel, HttpUrl
9
9
  from openai import OpenAI as oai
10
10
  import litellm
11
11
  from fyodorov_llm_agents.tools.tool import Tool
@@ -15,7 +15,8 @@ MAX_DESCRIPTION_LENGTH = 280
15
15
  VALID_CHARACTERS_REGEX = r'^[a-zA-Z0-9\s.,!?:;\'"-_]+$'
16
16
 
17
17
  class Agent(BaseModel):
18
- api_key: str = None
18
+ api_key: str | None = None
19
+ api_url: HttpUrl | None = None
19
20
  tools: [Tool] = []
20
21
  rag: [] = []
21
22
  model: str | None = None
@@ -76,10 +77,14 @@ class Agent(BaseModel):
76
77
  model = self.model
77
78
  # Set environmental variable
78
79
  if self.api_key.startswith('sk-'):
79
- os.environ["OPENAI_API_KEY"] = self.api_key
80
- else:
80
+ litellm.openai_key = self.api_key
81
+ self.api_url = "https://api.openai.com/v1"
82
+ elif self.api_key and self.api_key != '':
81
83
  model = 'mistral/'+self.model
82
- os.environ["MISTRAL_API_KEY"] = self.api_key
84
+ litellm.mistral_key = self.api_key
85
+ litellm.api_base = "https://api.mistral.ai/v1"
86
+ else:
87
+ litellm.api_base = self.api_url
83
88
 
84
89
  messages: [] = [
85
90
  {"content": self.prompt, "role": "system"},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fyodorov_llm_agents
3
- Version: 0.2.118
3
+ Version: 0.2.122
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=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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,7 +0,0 @@
1
- fyodorov_llm_agents/agents/agent.py,sha256=q-HVNdt4OvzB_FWxjgBxd_gG2ljJR7ZauVSysG-9CwM,5908
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.118.dist-info/METADATA,sha256=HC4M0t4b60EaZSVf3ghDZu7t6dGyUgdEE52MpDxHQYQ,552
5
- fyodorov_llm_agents-0.2.118.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
- fyodorov_llm_agents-0.2.118.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
7
- fyodorov_llm_agents-0.2.118.dist-info/RECORD,,