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.
- {solana_agent-1.0.2 → solana_agent-1.1.0}/PKG-INFO +1 -1
- {solana_agent-1.0.2 → solana_agent-1.1.0}/pyproject.toml +1 -1
- {solana_agent-1.0.2 → solana_agent-1.1.0}/solana_agent/ai.py +22 -3
- {solana_agent-1.0.2 → solana_agent-1.1.0}/LICENSE +0 -0
- {solana_agent-1.0.2 → solana_agent-1.1.0}/README.md +0 -0
- {solana_agent-1.0.2 → solana_agent-1.1.0}/solana_agent/__init__.py +0 -0
|
@@ -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.
|
|
46
|
-
self._threads = self.
|
|
47
|
-
self.messages = self.
|
|
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
|
|
File without changes
|