solana-agent 2.0.0__py3-none-any.whl → 2.1.0__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 CHANGED
@@ -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
- self._instructions = instructions
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
- self._zep = AsyncZep(api_key=zep_api_key) if zep_api_key else None
108
- self._sync_zep = Zep(api_key=zep_api_key) if zep_api_key else None
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": f"Query: {user_text}, Memory: {memory}",
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": f"Query: {transcript}, Memory: {memory}",
955
+ "content": transcript,
935
956
  },
936
957
  ],
937
958
  tools=self._tools,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 2.0.0
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
 
@@ -0,0 +1,6 @@
1
+ solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
+ solana_agent/ai.py,sha256=TM1oqJtPE5cfIxtRiy2uyTRgH2ux4o7Fy_0P3HUkcss,44006
3
+ solana_agent-2.1.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
+ solana_agent-2.1.0.dist-info/METADATA,sha256=pw_VcbC-0q3OEH2Tx2xLEASOpPyuh-KKPjYvAhaKTCo,4769
5
+ solana_agent-2.1.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
6
+ solana_agent-2.1.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
- solana_agent/ai.py,sha256=4D2g2B-30Qw_1uKuD2s_anBg8CUL95j0Eusc69bs4L4,42730
3
- solana_agent-2.0.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
- solana_agent-2.0.0.dist-info/METADATA,sha256=BAHvcEQ1JFVWfrZBf0BKvd7dDPl43SjWkYhBkv1UTMQ,4726
5
- solana_agent-2.0.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
6
- solana_agent-2.0.0.dist-info/RECORD,,