solana-agent 1.0.2__tar.gz → 1.1.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 1.0.2
3
+ Version: 1.1.0
4
4
  Summary: Build self-learning AI Agents
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "solana-agent"
3
- version = "1.0.2"
3
+ version = "1.1.0"
4
4
  description = "Build self-learning AI Agents"
5
5
  authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
6
6
  license = "MIT"
@@ -42,9 +42,9 @@ class ToolConfig(BaseModel):
42
42
  class MongoDatabase:
43
43
  def __init__(self, db_url: str, db_name: str):
44
44
  self._client = AsyncIOMotorClient(db_url)
45
- self._db = self._client[db_name]
46
- self._threads = self._db["threads"]
47
- self.messages = self._db["messages"]
45
+ self.db = self._client[db_name]
46
+ self._threads = self.db["threads"]
47
+ self.messages = self.db["messages"]
48
48
 
49
49
  async def save_thread_id(self, user_id: str, thread_id: str):
50
50
  await self._threads.insert_one({"thread_id": thread_id, "user_id": user_id})
@@ -192,6 +192,25 @@ class AI:
192
192
  )
193
193
  return run.status
194
194
 
195
+ # check time tool - has to be sync
196
+ def check_time(self) -> str:
197
+ """Get current UTC time formatted as a string.
198
+
199
+ Returns:
200
+ str: Current UTC time in format 'YYYY-MM-DD HH:MM:SS UTC'
201
+
202
+ Example:
203
+ ```python
204
+ time = ai.check_time()
205
+ # Returns: "2024-02-13 15:30:45 UTC"
206
+ ```
207
+
208
+ Note:
209
+ This is a synchronous tool method required for OpenAI function calling.
210
+ Always returns time in UTC timezone for consistency.
211
+ """
212
+ return datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S %Z")
213
+
195
214
  # search facts tool - has to be sync
196
215
  def search_facts(
197
216
  self,
File without changes
File without changes