hebbrix 2.0.1__tar.gz → 2.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hebbrix
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Advanced Memory API for AI Agents with Reinforcement Learning - 3-line integration
5
5
  Home-page: https://github.com/hebbrix/hebbrix-python
6
6
  Author: Hebbrix Team
@@ -41,7 +41,7 @@ Features:
41
41
  - ✅ Type hints throughout
42
42
  """
43
43
 
44
- __version__ = "2.0.0"
44
+ __version__ = "2.0.2"
45
45
  __author__ = "Hebbrix Team"
46
46
  __license__ = "MIT"
47
47
 
@@ -286,6 +286,8 @@ class MemoryChat:
286
286
  response.raise_for_status()
287
287
 
288
288
  # Convenience methods for memory operations
289
+ # These use synchronous requests.post() (same as send/send_with_context)
290
+ # instead of the async MemoryClient to avoid coroutine issues.
289
291
  def add_memory(self, content: str, collection_id: str, importance: float = 0.5) -> Dict[str, Any]:
290
292
  """
291
293
  Add a memory manually.
@@ -298,11 +300,20 @@ class MemoryChat:
298
300
  Returns:
299
301
  Created memory dict
300
302
  """
301
- return self.client.memories.create(
302
- content=content,
303
- collection_id=collection_id,
304
- importance=importance,
305
- )
303
+ url = f"{self.base_url}/v1/memories"
304
+ headers = {
305
+ "Authorization": f"Bearer {self.api_key}",
306
+ "Content-Type": "application/json",
307
+ }
308
+ payload = {
309
+ "content": content,
310
+ "collection_id": collection_id,
311
+ "importance": importance,
312
+ }
313
+
314
+ response = requests.post(url, json=payload, headers=headers)
315
+ response.raise_for_status()
316
+ return response.json()
306
317
 
307
318
  def search_memories(self, query: str, collection_id: Optional[str] = None, limit: int = 10) -> List[Dict[str, Any]]:
308
319
  """
@@ -316,11 +327,21 @@ class MemoryChat:
316
327
  Returns:
317
328
  List of memory dicts
318
329
  """
319
- return self.client.memories.search(
320
- query=query,
321
- collection_id=collection_id,
322
- limit=limit,
323
- )["results"]
330
+ url = f"{self.base_url}/v1/search"
331
+ headers = {
332
+ "Authorization": f"Bearer {self.api_key}",
333
+ "Content-Type": "application/json",
334
+ }
335
+ payload: Dict[str, Any] = {
336
+ "query": query,
337
+ "limit": limit,
338
+ }
339
+ if collection_id:
340
+ payload["collection_id"] = collection_id
341
+
342
+ response = requests.post(url, json=payload, headers=headers)
343
+ response.raise_for_status()
344
+ return response.json().get("results", [])
324
345
 
325
346
 
326
347
  # Convenience function for even simpler usage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hebbrix
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Advanced Memory API for AI Agents with Reinforcement Learning - 3-line integration
5
5
  Home-page: https://github.com/hebbrix/hebbrix-python
6
6
  Author: Hebbrix Team
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hebbrix"
7
- version = "2.0.1"
7
+ version = "2.0.2"
8
8
  description = "Advanced Memory API for AI Agents with Reinforcement Learning - 3-line integration"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes