solana-agent 2.0.0__tar.gz → 2.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-2.0.0 → solana_agent-2.1.0}/PKG-INFO +2 -1
- {solana_agent-2.0.0 → solana_agent-2.1.0}/pyproject.toml +2 -1
- {solana_agent-2.0.0 → solana_agent-2.1.0}/solana_agent/ai.py +30 -9
- {solana_agent-2.0.0 → solana_agent-2.1.0}/LICENSE +0 -0
- {solana_agent-2.0.0 → solana_agent-2.1.0}/README.md +0 -0
- {solana_agent-2.0.0 → solana_agent-2.1.0}/solana_agent/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: solana-agent
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Build self-learning AI Agents
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: ai,openai,ai agents
|
|
@@ -23,6 +23,7 @@ Requires-Dist: pydantic (>=2.10.6,<3.0.0)
|
|
|
23
23
|
Requires-Dist: pymongo (>=4.11.1,<5.0.0)
|
|
24
24
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
25
25
|
Requires-Dist: zep-cloud (>=2.4.0,<3.0.0)
|
|
26
|
+
Requires-Dist: zep-python (>=2.0.2,<3.0.0)
|
|
26
27
|
Project-URL: Repository, https://github.com/truemagic-coder/solana-agent
|
|
27
28
|
Description-Content-Type: text/markdown
|
|
28
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "solana-agent"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.1.0"
|
|
4
4
|
description = "Build self-learning AI Agents"
|
|
5
5
|
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -22,6 +22,7 @@ openai = "^1.64.0"
|
|
|
22
22
|
pydantic = "^2.10.6"
|
|
23
23
|
pymongo = "^4.11.1"
|
|
24
24
|
zep-cloud = "^2.4.0"
|
|
25
|
+
zep-python = "^2.0.2"
|
|
25
26
|
requests = "^2.32.3"
|
|
26
27
|
pinecone = "^6.0.1"
|
|
27
28
|
pandas = "^2.2.3"
|
|
@@ -9,8 +9,10 @@ from pymongo import MongoClient
|
|
|
9
9
|
from openai import OpenAI
|
|
10
10
|
import inspect
|
|
11
11
|
import requests
|
|
12
|
-
from zep_cloud.client import AsyncZep
|
|
13
|
-
from zep_cloud.client import Zep
|
|
12
|
+
from zep_cloud.client import AsyncZep as AsyncZepCloud
|
|
13
|
+
from zep_cloud.client import Zep as ZepCloud
|
|
14
|
+
from zep_python.client import Zep
|
|
15
|
+
from zep_python.client import AsyncZep
|
|
14
16
|
from zep_cloud.types import Message
|
|
15
17
|
from pinecone import Pinecone
|
|
16
18
|
|
|
@@ -58,6 +60,7 @@ class AI:
|
|
|
58
60
|
instructions: str,
|
|
59
61
|
database: Any,
|
|
60
62
|
zep_api_key: str = None,
|
|
63
|
+
zep_base_url: str = None,
|
|
61
64
|
perplexity_api_key: str = None,
|
|
62
65
|
grok_api_key: str = None,
|
|
63
66
|
pinecone_api_key: str = None,
|
|
@@ -74,6 +77,7 @@ class AI:
|
|
|
74
77
|
instructions (str): Base behavioral instructions for the AI
|
|
75
78
|
database (Any): Database instance for message/thread storage
|
|
76
79
|
zep_api_key (str, optional): API key for Zep memory storage. Defaults to None
|
|
80
|
+
zep_base_url (str, optional): Base URL for Zep API. Defaults to None
|
|
77
81
|
perplexity_api_key (str, optional): API key for Perplexity search. Defaults to None
|
|
78
82
|
grok_api_key (str, optional): API key for X/Twitter search via Grok. Defaults to None
|
|
79
83
|
pinecone_api_key (str, optional): API key for Pinecone. Defaults to None
|
|
@@ -101,11 +105,27 @@ class AI:
|
|
|
101
105
|
"""
|
|
102
106
|
self._client = OpenAI(api_key=openai_api_key, base_url=openai_base_url) if openai_base_url else OpenAI(
|
|
103
107
|
api_key=openai_api_key)
|
|
104
|
-
|
|
108
|
+
memory_instructions = """
|
|
109
|
+
You are a highly intelligent, context-aware conversational AI. When a user sends a query or statement, you should not only process the current input but also retrieve and integrate relevant context from their previous interactions. Use the memory data to:
|
|
110
|
+
- Infer nuances in the user's intent.
|
|
111
|
+
- Recall previous topics, preferences, or facts that might be relevant.
|
|
112
|
+
- Provide a thoughtful, clear, and structured response.
|
|
113
|
+
- Clarify ambiguous queries by relating them to known user history.
|
|
114
|
+
|
|
115
|
+
Always be concise and ensure that your response maintains coherence across the conversation while respecting the user's context and previous data.
|
|
116
|
+
"""
|
|
117
|
+
self._instructions = instructions + " " + memory_instructions
|
|
105
118
|
self._database: MongoDatabase = database
|
|
106
119
|
self._accumulated_value_queue = asyncio.Queue()
|
|
107
|
-
|
|
108
|
-
|
|
120
|
+
if zep_api_key and not zep_base_url:
|
|
121
|
+
self._zep = AsyncZepCloud(api_key=zep_api_key)
|
|
122
|
+
self._sync_zep = ZepCloud(api_key=zep_api_key)
|
|
123
|
+
elif zep_api_key and zep_base_url:
|
|
124
|
+
self._zep = AsyncZep(api_key=zep_api_key, base_url=zep_base_url)
|
|
125
|
+
self._sync_zep = Zep(api_key=zep_api_key, base_url=zep_base_url)
|
|
126
|
+
else:
|
|
127
|
+
self._zep = None
|
|
128
|
+
self._sync_zep = None
|
|
109
129
|
self._perplexity_api_key = perplexity_api_key
|
|
110
130
|
self._grok_api_key = grok_api_key
|
|
111
131
|
self._gemini_api_key = gemini_api_key
|
|
@@ -766,11 +786,12 @@ class AI:
|
|
|
766
786
|
messages=[
|
|
767
787
|
{
|
|
768
788
|
"role": "system",
|
|
769
|
-
"content": self._instructions,
|
|
789
|
+
"content": self._instructions + f" Memory: {memory}",
|
|
790
|
+
|
|
770
791
|
},
|
|
771
792
|
{
|
|
772
793
|
"role": "user",
|
|
773
|
-
"content":
|
|
794
|
+
"content": user_text,
|
|
774
795
|
},
|
|
775
796
|
],
|
|
776
797
|
tools=self._tools,
|
|
@@ -927,11 +948,11 @@ class AI:
|
|
|
927
948
|
messages=[
|
|
928
949
|
{
|
|
929
950
|
"role": "system",
|
|
930
|
-
"content": self._instructions,
|
|
951
|
+
"content": self._instructions + f" Memory: {memory}",
|
|
931
952
|
},
|
|
932
953
|
{
|
|
933
954
|
"role": "user",
|
|
934
|
-
"content":
|
|
955
|
+
"content": transcript,
|
|
935
956
|
},
|
|
936
957
|
],
|
|
937
958
|
tools=self._tools,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|