solana-agent 1.0.2__py3-none-any.whl → 1.1.1__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
@@ -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._db = self._client[db_name]
46
- self._threads = self._db["threads"]
47
- self.messages = self._db["messages"]
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,
@@ -317,7 +336,6 @@ class AI:
317
336
  use_perplexity: bool = True,
318
337
  use_grok: bool = True,
319
338
  use_facts: bool = True,
320
- use_kb=True,
321
339
  perplexity_model: Literal[
322
340
  "sonar", "sonar-pro", "sonar-reasoning-pro", "sonar-reasoning"
323
341
  ] = "sonar",
@@ -367,10 +385,6 @@ class AI:
367
385
  x_search_results = self.search_x(query, grok_model)
368
386
  else:
369
387
  x_search_results = ""
370
- if use_kb:
371
- kb_results = self.search_kb(query)
372
- else:
373
- kb_results = ""
374
388
 
375
389
  response = self._client.chat.completions.create(
376
390
  model=openai_model,
@@ -381,7 +395,7 @@ class AI:
381
395
  },
382
396
  {
383
397
  "role": "user",
384
- "content": f"Query: {query}, Facts: {facts}, KB Results: {kb_results}, Internet Search Results: {search_results}, X Search Results: {x_search_results}",
398
+ "content": f"Query: {query}, Facts: {facts}, Internet Search Results: {search_results}, X Search Results: {x_search_results}",
385
399
  },
386
400
  ],
387
401
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 1.0.2
3
+ Version: 1.1.1
4
4
  Summary: Build self-learning AI Agents
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents
@@ -0,0 +1,6 @@
1
+ solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
+ solana_agent/ai.py,sha256=u-CfvihRgQUVSxAJVxFs29byrZxQRAPRqMm1l4mlLLs,29680
3
+ solana_agent-1.1.1.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
+ solana_agent-1.1.1.dist-info/METADATA,sha256=YorL6wHra39TE0pmhtfyEuiH4mnTiP1P3IZO_J5Fim0,4276
5
+ solana_agent-1.1.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
6
+ solana_agent-1.1.1.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
- solana_agent/ai.py,sha256=4hAb_iyHr-IkVqi8DFI3-Wu2QiCWSLFV5ji61X05aTk,29229
3
- solana_agent-1.0.2.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
- solana_agent-1.0.2.dist-info/METADATA,sha256=MXo_LkL1ovr54qiEZ_sUJ1yhLIrSPKskhBkn2uQFYlQ,4276
5
- solana_agent-1.0.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
6
- solana_agent-1.0.2.dist-info/RECORD,,