solana-agent 0.0.11__py3-none-any.whl → 0.0.13__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.
- solana_agent/ai.py +13 -9
- {solana_agent-0.0.11.dist-info → solana_agent-0.0.13.dist-info}/METADATA +2 -2
- solana_agent-0.0.13.dist-info/RECORD +6 -0
- solana_agent-0.0.11.dist-info/RECORD +0 -6
- {solana_agent-0.0.11.dist-info → solana_agent-0.0.13.dist-info}/LICENSE +0 -0
- {solana_agent-0.0.11.dist-info → solana_agent-0.0.13.dist-info}/WHEEL +0 -0
solana_agent/ai.py
CHANGED
|
@@ -13,7 +13,7 @@ import inspect
|
|
|
13
13
|
import requests
|
|
14
14
|
from zep_cloud.client import AsyncZep
|
|
15
15
|
from zep_cloud.client import Zep
|
|
16
|
-
from zep_cloud.types import Message
|
|
16
|
+
from zep_cloud.types import Message
|
|
17
17
|
import pandas as pd
|
|
18
18
|
from pinecone import Pinecone
|
|
19
19
|
|
|
@@ -46,14 +46,14 @@ class MongoDatabase:
|
|
|
46
46
|
def __init__(self, db_url: str, db_name: str):
|
|
47
47
|
self._client = AsyncIOMotorClient(db_url)
|
|
48
48
|
self._db = self._client[db_name]
|
|
49
|
-
self.
|
|
49
|
+
self._threads = self._db["threads"]
|
|
50
50
|
self.messages = self._db["messages"]
|
|
51
51
|
|
|
52
52
|
async def save_thread_id(self, user_id: str, thread_id: str):
|
|
53
|
-
await self.
|
|
53
|
+
await self._threads.insert_one({"thread_id": thread_id, "user_id": user_id})
|
|
54
54
|
|
|
55
55
|
async def get_thread_id(self, user_id: str) -> Optional[str]:
|
|
56
|
-
document = await self.
|
|
56
|
+
document = await self._threads.find_one({"user_id": user_id})
|
|
57
57
|
return document["thread_id"] if document else None
|
|
58
58
|
|
|
59
59
|
async def save_message(self, user_id: str, metadata: Dict[str, Any]):
|
|
@@ -61,7 +61,11 @@ class MongoDatabase:
|
|
|
61
61
|
await self.messages.insert_one(metadata)
|
|
62
62
|
|
|
63
63
|
async def delete_all_threads(self):
|
|
64
|
-
await self.
|
|
64
|
+
await self._threads.delete_many({})
|
|
65
|
+
|
|
66
|
+
async def clear_user_history(self, user_id: str):
|
|
67
|
+
await self.messages.delete_many({"user_id": user_id})
|
|
68
|
+
await self._threads.delete_one({"user_id": user_id})
|
|
65
69
|
|
|
66
70
|
|
|
67
71
|
class AI:
|
|
@@ -692,12 +696,12 @@ class AI:
|
|
|
692
696
|
messages = [
|
|
693
697
|
Message(
|
|
694
698
|
role="user",
|
|
695
|
-
role_type=
|
|
699
|
+
role_type="user",
|
|
696
700
|
content=user_text,
|
|
697
701
|
),
|
|
698
702
|
Message(
|
|
699
703
|
role="assistant",
|
|
700
|
-
role_type=
|
|
704
|
+
role_type="assistant",
|
|
701
705
|
content=full_response,
|
|
702
706
|
),
|
|
703
707
|
]
|
|
@@ -806,12 +810,12 @@ class AI:
|
|
|
806
810
|
messages = [
|
|
807
811
|
Message(
|
|
808
812
|
role="user",
|
|
809
|
-
role_type=
|
|
813
|
+
role_type="user",
|
|
810
814
|
content=transcript,
|
|
811
815
|
),
|
|
812
816
|
Message(
|
|
813
817
|
role="assistant",
|
|
814
|
-
role_type=
|
|
818
|
+
role_type="assistant",
|
|
815
819
|
content=full_response,
|
|
816
820
|
),
|
|
817
821
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: solana-agent
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Summary: Build self-learning AI Agents
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: ai,openai,ai agents
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
|
|
22
22
|
Requires-Dist: pinecone (>=6.0.1,<7.0.0)
|
|
23
23
|
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
|
|
24
24
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
25
|
-
Requires-Dist: zep-cloud (>=2.
|
|
25
|
+
Requires-Dist: zep-cloud (>=2.4.0,<3.0.0)
|
|
26
26
|
Project-URL: Repository, https://github.com/truemagic-coder/solana-agent
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
|
|
2
|
+
solana_agent/ai.py,sha256=-01z87VNJ6kr-WzyPXCinSIlYZsaWgJWSkN7f5iDJvM,33538
|
|
3
|
+
solana_agent-0.0.13.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
|
|
4
|
+
solana_agent-0.0.13.dist-info/METADATA,sha256=oWgOt9pc9th3N748QxEdxabQ1GS3l1KXfAZ72J9R4tg,5577
|
|
5
|
+
solana_agent-0.0.13.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
6
|
+
solana_agent-0.0.13.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
|
|
2
|
-
solana_agent/ai.py,sha256=RVT-1F16Z-RYOmn8rdWtqffIqyRvtahL1NG1LSYj6-s,33406
|
|
3
|
-
solana_agent-0.0.11.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
|
|
4
|
-
solana_agent-0.0.11.dist-info/METADATA,sha256=RPS-y92uBtkcvYR2-cJo2YZd_46i9B66dnE7B3ReBds,5577
|
|
5
|
-
solana_agent-0.0.11.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
6
|
-
solana_agent-0.0.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|