solana-agent 0.0.100__py3-none-any.whl → 1.0.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
@@ -429,6 +429,46 @@ class AI:
429
429
  except Exception as e:
430
430
  return f"Failed to search X. Error: {e}"
431
431
 
432
+ async def clear_user_history(self, user_id: str):
433
+ """Clear stored conversation history for a specific user.
434
+
435
+ Args:
436
+ user_id (str): Unique identifier for the user whose history should be cleared
437
+
438
+ Example:
439
+ ```python
440
+ await ai.clear_user_history("user123")
441
+ # Clears all stored messages, facts, and threads for user123
442
+ ```
443
+
444
+ Note:
445
+ This is an async method and must be awaited.
446
+ """
447
+ try:
448
+ await self.delete_assistant_thread(user_id)
449
+ except Exception:
450
+ pass
451
+ try:
452
+ await self._database.clear_user_history(user_id)
453
+ except Exception:
454
+ pass
455
+ try:
456
+ await self.delete_facts(user_id)
457
+ except Exception:
458
+ pass
459
+
460
+ async def delete_assistant_thread(self, user_id: str):
461
+ """Delete stored conversation thread for a user on OpenAI.
462
+
463
+ Example:
464
+ ```python
465
+ await ai.delete_assistant_thread("user123")
466
+ # Deletes the assistant conversation thread for a user
467
+ ```
468
+ """
469
+ thread_id = await self._database.get_thread_id(user_id)
470
+ await self._client.beta.threads.delete(thread_id=thread_id)
471
+
432
472
  async def delete_facts(self, user_id: str):
433
473
  """Delete stored conversation facts for a specific user from Zep memory.
434
474
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 0.0.100
3
+ Version: 1.0.0
4
4
  Summary: Build self-learning AI Agents
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents
@@ -98,7 +98,7 @@ pip install solana-agent
98
98
  ```
99
99
 
100
100
  ## Documentation
101
- * All public methods have docstrings for real-time IDE hinting
101
+ * Each public method has a docstring for real-time IDE hinting
102
102
 
103
103
  ## Production Apps
104
104
  * [Solana Agent Copilot](https://ai.solana-agent.com) - Solana Token AI Copilot using streaming text conversations
@@ -0,0 +1,6 @@
1
+ solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
+ solana_agent/ai.py,sha256=d0F9B4D-mfRqt-7t0imAH8x1sB_UIiVZhTPiZZF1vGo,29103
3
+ solana_agent-1.0.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
+ solana_agent-1.0.0.dist-info/METADATA,sha256=0kpQ3rD9T0cVG8zeIQ6LVMeIxtGBpGhaofDsYdMq0TI,4341
5
+ solana_agent-1.0.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
6
+ solana_agent-1.0.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
- solana_agent/ai.py,sha256=T9Lnf8i9To6Oi16e3NzIfCvJI9La0Cpkx-sNfXFZSXY,27833
3
- solana_agent-0.0.100.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
- solana_agent-0.0.100.dist-info/METADATA,sha256=RuMKQKR2aI-Eew61WVUEmxehUXuXu2DqXrxt0dkYOF4,4343
5
- solana_agent-0.0.100.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
6
- solana_agent-0.0.100.dist-info/RECORD,,