sovant 1.0.3__py3-none-any.whl → 1.0.4__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.
Potentially problematic release.
This version of sovant might be problematic. Click here for more details.
- sovant/client.py +6 -6
- {sovant-1.0.3.dist-info → sovant-1.0.4.dist-info}/METADATA +5 -5
- {sovant-1.0.3.dist-info → sovant-1.0.4.dist-info}/RECORD +6 -6
- {sovant-1.0.3.dist-info → sovant-1.0.4.dist-info}/WHEEL +0 -0
- {sovant-1.0.3.dist-info → sovant-1.0.4.dist-info}/licenses/LICENSE +0 -0
- {sovant-1.0.3.dist-info → sovant-1.0.4.dist-info}/top_level.txt +0 -0
sovant/client.py
CHANGED
|
@@ -16,7 +16,7 @@ class Sovant:
|
|
|
16
16
|
self.api_key = api_key or os.getenv("SOVANT_API_KEY")
|
|
17
17
|
if not self.api_key:
|
|
18
18
|
raise ValueError("Missing api_key")
|
|
19
|
-
self.base_url = (base_url or os.getenv("SOVANT_BASE_URL") or "https://
|
|
19
|
+
self.base_url = (base_url or os.getenv("SOVANT_BASE_URL") or "https://sovant.ai").rstrip("/")
|
|
20
20
|
self.timeout = timeout
|
|
21
21
|
self._client = httpx.Client(
|
|
22
22
|
timeout=self.timeout,
|
|
@@ -52,11 +52,11 @@ class Sovant:
|
|
|
52
52
|
if 'type' not in body or body['type'] is None:
|
|
53
53
|
body['type'] = 'journal'
|
|
54
54
|
|
|
55
|
-
r = self._client.post(f"{self.base_url}/v1/memory", content=json.dumps(body))
|
|
55
|
+
r = self._client.post(f"{self.base_url}/api/v1/memory", content=json.dumps(body))
|
|
56
56
|
return self._handle(r)
|
|
57
57
|
|
|
58
58
|
def memory_get(self, id: str):
|
|
59
|
-
r = self._client.get(f"{self.base_url}/v1/memories/{id}")
|
|
59
|
+
r = self._client.get(f"{self.base_url}/api/v1/memories/{id}")
|
|
60
60
|
return self._handle(r)
|
|
61
61
|
|
|
62
62
|
def memory_search(self, q: SearchQuery):
|
|
@@ -75,16 +75,16 @@ class Sovant:
|
|
|
75
75
|
params['from_date'] = q.from_date
|
|
76
76
|
if q.to_date:
|
|
77
77
|
params['to_date'] = q.to_date
|
|
78
|
-
r = self._client.get(f"{self.base_url}/v1/memory/search", params=params)
|
|
78
|
+
r = self._client.get(f"{self.base_url}/api/v1/memory/search", params=params)
|
|
79
79
|
return self._handle(r)
|
|
80
80
|
|
|
81
81
|
def memory_update(self, id: str, patch: Dict[str, Any]):
|
|
82
82
|
# Convert data field to content field if present
|
|
83
83
|
if 'data' in patch:
|
|
84
84
|
patch['content'] = json.dumps(patch.pop('data')) if not isinstance(patch.get('data'), str) else patch.pop('data')
|
|
85
|
-
r = self._client.patch(f"{self.base_url}/v1/memories/{id}", content=json.dumps(patch))
|
|
85
|
+
r = self._client.patch(f"{self.base_url}/api/v1/memories/{id}", content=json.dumps(patch))
|
|
86
86
|
return self._handle(r)
|
|
87
87
|
|
|
88
88
|
def memory_delete(self, id: str):
|
|
89
|
-
r = self._client.delete(f"{self.base_url}/v1/memories/{id}")
|
|
89
|
+
r = self._client.delete(f"{self.base_url}/api/v1/memories/{id}")
|
|
90
90
|
return self._handle(r)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sovant
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Sovant Memory-as-a-Service Python SDK
|
|
5
5
|
Author: Sovant
|
|
6
6
|
License: MIT
|
|
@@ -46,9 +46,9 @@ from sovant import Sovant, MemoryCreate, SearchQuery
|
|
|
46
46
|
|
|
47
47
|
client = Sovant(api_key="YOUR_API_KEY")
|
|
48
48
|
|
|
49
|
-
# Create a memory
|
|
49
|
+
# Create a memory (SDK uses 'data' field, automatically converts to 'content' for API)
|
|
50
50
|
created = client.memory_create(MemoryCreate(
|
|
51
|
-
|
|
51
|
+
data="User prefers morning meetings", # Note: 'data' field (not 'content')
|
|
52
52
|
type="preference",
|
|
53
53
|
tags=["customer:123"],
|
|
54
54
|
# metadata={"source": "crm"},
|
|
@@ -98,8 +98,8 @@ print(results)
|
|
|
98
98
|
|
|
99
99
|
## Field Mapping Note
|
|
100
100
|
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
101
|
+
- **SDK uses:** `data` field in MemoryCreate (more intuitive for developers)
|
|
102
|
+
- **API expects:** `content` field (SDK automatically converts `data` → `content`)
|
|
103
103
|
- **Deprecated:** `subject` is ignored by the API. Use `thread_id`, `tags`, or `metadata` for grouping.
|
|
104
104
|
|
|
105
105
|
## Status of Advanced Features
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
sovant/__init__.py,sha256=1GYQzmb1Ni5-y874HOs1J-rYrpx-iBzR4_cCEBFIjpk,122
|
|
2
2
|
sovant/base_client.py,sha256=Vmn6OGywGwLbH5cEeflSjVOFwn5iX_YdfTdUq9pWWxA,8778
|
|
3
|
-
sovant/client.py,sha256=
|
|
3
|
+
sovant/client.py,sha256=B1SlHvUKKRSf1NYOOEkfukBmxhpsop4lHY2X_-EBFek,3372
|
|
4
4
|
sovant/exceptions.py,sha256=MQMSgk7ckXnAbe7hPPpbKOnRBHSPxuCY7WSjqfJAvd0,1557
|
|
5
5
|
sovant/models.py,sha256=avDAITMptDDdDfNH_ed854Q7kF6z_1OzjwJ9Xeft_-8,979
|
|
6
6
|
sovant/types.py,sha256=gnvdXksJt8LObti7nc6eHSBCB7Pz7SNpS5o_HRTq_kA,6098
|
|
7
7
|
sovant/resources/__init__.py,sha256=cPFIM7h8duviDdeHudnVEAmv3F89RHQxdH5BCRWFteQ,193
|
|
8
8
|
sovant/resources/memories.py,sha256=bKKE0uWqFkPa1OEvbK1LrdSD7v6N04RhJ_2VDoPPQBA,11379
|
|
9
9
|
sovant/resources/threads.py,sha256=mN29xP0JODmZBKyfhpeqJyViUWNVMAx3TlYAW-1ruTs,12558
|
|
10
|
-
sovant-1.0.
|
|
11
|
-
sovant-1.0.
|
|
12
|
-
sovant-1.0.
|
|
13
|
-
sovant-1.0.
|
|
14
|
-
sovant-1.0.
|
|
10
|
+
sovant-1.0.4.dist-info/licenses/LICENSE,sha256=rnNP6-elrMIlQ9jf2aqnHZMyyQ_wvF3y1hTpVUusCWU,1062
|
|
11
|
+
sovant-1.0.4.dist-info/METADATA,sha256=yObvvZo81fC0we_Z7rt5Ip35qdTqwPB8LUOXSn6cho4,3835
|
|
12
|
+
sovant-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
sovant-1.0.4.dist-info/top_level.txt,sha256=za6eVEsYd_ZQQs8vrmEWNcAR58r1wCDge_jA60e4CvQ,7
|
|
14
|
+
sovant-1.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|