solana-agent 2.1.1__tar.gz → 2.1.2__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-2.1.1 → solana_agent-2.1.2}/PKG-INFO +2 -1
- {solana_agent-2.1.1 → solana_agent-2.1.2}/pyproject.toml +2 -1
- {solana_agent-2.1.1 → solana_agent-2.1.2}/solana_agent/ai.py +13 -7
- {solana_agent-2.1.1 → solana_agent-2.1.2}/LICENSE +0 -0
- {solana_agent-2.1.1 → solana_agent-2.1.2}/README.md +0 -0
- {solana_agent-2.1.1 → solana_agent-2.1.2}/solana_agent/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: solana-agent
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
4
4
|
Summary: Build self-learning AI Agents
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: ai,openai,ai agents
|
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
18
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Dist: ntplib (>=0.4.0,<0.5.0)
|
|
19
20
|
Requires-Dist: openai (>=1.64.0,<2.0.0)
|
|
20
21
|
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
|
21
22
|
Requires-Dist: pinecone (>=6.0.1,<7.0.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "solana-agent"
|
|
3
|
-
version = "2.1.
|
|
3
|
+
version = "2.1.2"
|
|
4
4
|
description = "Build self-learning AI Agents"
|
|
5
5
|
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -26,6 +26,7 @@ zep-python = "^2.0.2"
|
|
|
26
26
|
requests = "^2.32.3"
|
|
27
27
|
pinecone = "^6.0.1"
|
|
28
28
|
pandas = "^2.2.3"
|
|
29
|
+
ntplib = "^0.4.0"
|
|
29
30
|
|
|
30
31
|
[build-system]
|
|
31
32
|
requires = ["poetry-core>=1.0.0"]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import datetime
|
|
3
|
+
import ntplib
|
|
3
4
|
import json
|
|
4
5
|
from typing import AsyncGenerator, List, Literal, Dict, Any, Callable
|
|
5
6
|
import uuid
|
|
@@ -430,9 +431,8 @@ class AI:
|
|
|
430
431
|
self.kb.delete(ids=[id], namespace=user_id)
|
|
431
432
|
self._database.kb.delete_one({"reference": id})
|
|
432
433
|
|
|
433
|
-
# check time tool - has to be sync
|
|
434
434
|
def check_time(self) -> str:
|
|
435
|
-
"""Get current UTC time formatted as a string.
|
|
435
|
+
"""Get current UTC time formatted as a string via Cloudflare's NTP service.
|
|
436
436
|
|
|
437
437
|
Returns:
|
|
438
438
|
str: Current UTC time in format 'YYYY-MM-DD HH:MM:SS UTC'
|
|
@@ -440,16 +440,22 @@ class AI:
|
|
|
440
440
|
Example:
|
|
441
441
|
```python
|
|
442
442
|
time = ai.check_time()
|
|
443
|
-
# Returns: "
|
|
443
|
+
# Returns: "2025-02-26 15:30:45 UTC"
|
|
444
444
|
```
|
|
445
445
|
|
|
446
446
|
Note:
|
|
447
447
|
This is a synchronous tool method required for OpenAI function calling.
|
|
448
|
-
|
|
448
|
+
Fetches time over NTP from Cloudflare's time server (time.cloudflare.com).
|
|
449
449
|
"""
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
try:
|
|
451
|
+
client = ntplib.NTPClient()
|
|
452
|
+
# Request time from Cloudflare's NTP server.
|
|
453
|
+
response = client.request("time.cloudflare.com", version=3)
|
|
454
|
+
dt = datetime.datetime.fromtimestamp(
|
|
455
|
+
response.tx_time, datetime.timezone.utc)
|
|
456
|
+
return dt.strftime("%Y-%m-%d %H:%M:%S UTC")
|
|
457
|
+
except Exception as e:
|
|
458
|
+
return f"Error: {e}"
|
|
453
459
|
|
|
454
460
|
# has to be sync for tool
|
|
455
461
|
def get_memory_context(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|