cuemap 0.2.2__tar.gz → 0.3.0__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.
- {cuemap-0.2.2/cuemap.egg-info → cuemap-0.3.0}/PKG-INFO +1 -1
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap/client.py +16 -23
- {cuemap-0.2.2 → cuemap-0.3.0/cuemap.egg-info}/PKG-INFO +1 -1
- {cuemap-0.2.2 → cuemap-0.3.0}/pyproject.toml +1 -1
- {cuemap-0.2.2 → cuemap-0.3.0}/LICENSE +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/MANIFEST.in +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/README.md +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap/__init__.py +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap/exceptions.py +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap/models.py +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap.egg-info/SOURCES.txt +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap.egg-info/dependency_links.txt +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap.egg-info/requires.txt +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/cuemap.egg-info/top_level.txt +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/examples/pure_usage.py +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/examples/with_local_llm.py +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/examples/with_openai.py +0 -0
- {cuemap-0.2.2 → cuemap-0.3.0}/setup.cfg +0 -0
|
@@ -48,14 +48,10 @@ class CueMap:
|
|
|
48
48
|
"""Get request headers."""
|
|
49
49
|
headers = {}
|
|
50
50
|
if self.api_key:
|
|
51
|
-
headers["
|
|
52
|
-
return headers
|
|
53
|
-
|
|
54
|
-
def _endpoint(self, path: str) -> str:
|
|
55
|
-
"""Get endpoint with optional project_id."""
|
|
51
|
+
headers["X-API-Key"] = self.api_key
|
|
56
52
|
if self.project_id:
|
|
57
|
-
|
|
58
|
-
return
|
|
53
|
+
headers["X-Project-ID"] = self.project_id
|
|
54
|
+
return headers
|
|
59
55
|
|
|
60
56
|
def add(
|
|
61
57
|
self,
|
|
@@ -81,7 +77,7 @@ class CueMap:
|
|
|
81
77
|
... )
|
|
82
78
|
"""
|
|
83
79
|
response = self.client.post(
|
|
84
|
-
|
|
80
|
+
"/memories",
|
|
85
81
|
json={
|
|
86
82
|
"content": content,
|
|
87
83
|
"cues": cues,
|
|
@@ -120,7 +116,7 @@ class CueMap:
|
|
|
120
116
|
... print(r.content)
|
|
121
117
|
"""
|
|
122
118
|
response = self.client.post(
|
|
123
|
-
|
|
119
|
+
"/recall",
|
|
124
120
|
json={
|
|
125
121
|
"cues": cues,
|
|
126
122
|
"limit": limit,
|
|
@@ -147,7 +143,7 @@ class CueMap:
|
|
|
147
143
|
Success status
|
|
148
144
|
"""
|
|
149
145
|
response = self.client.patch(
|
|
150
|
-
|
|
146
|
+
f"/memories/{memory_id}/reinforce",
|
|
151
147
|
json={"cues": cues},
|
|
152
148
|
headers=self._headers()
|
|
153
149
|
)
|
|
@@ -157,7 +153,7 @@ class CueMap:
|
|
|
157
153
|
def get(self, memory_id: str) -> Memory:
|
|
158
154
|
"""Get a memory by ID."""
|
|
159
155
|
response = self.client.get(
|
|
160
|
-
|
|
156
|
+
f"/memories/{memory_id}",
|
|
161
157
|
headers=self._headers()
|
|
162
158
|
)
|
|
163
159
|
|
|
@@ -171,7 +167,7 @@ class CueMap:
|
|
|
171
167
|
def stats(self) -> Dict[str, Any]:
|
|
172
168
|
"""Get server statistics."""
|
|
173
169
|
response = self.client.get(
|
|
174
|
-
|
|
170
|
+
"/stats",
|
|
175
171
|
headers=self._headers()
|
|
176
172
|
)
|
|
177
173
|
|
|
@@ -217,13 +213,10 @@ class AsyncCueMap:
|
|
|
217
213
|
def _headers(self) -> Dict[str, str]:
|
|
218
214
|
headers = {}
|
|
219
215
|
if self.api_key:
|
|
220
|
-
headers["
|
|
221
|
-
return headers
|
|
222
|
-
|
|
223
|
-
def _endpoint(self, path: str) -> str:
|
|
216
|
+
headers["X-API-Key"] = self.api_key
|
|
224
217
|
if self.project_id:
|
|
225
|
-
|
|
226
|
-
return
|
|
218
|
+
headers["X-Project-ID"] = self.project_id
|
|
219
|
+
return headers
|
|
227
220
|
|
|
228
221
|
async def add(
|
|
229
222
|
self,
|
|
@@ -233,7 +226,7 @@ class AsyncCueMap:
|
|
|
233
226
|
) -> str:
|
|
234
227
|
"""Add a memory (async)."""
|
|
235
228
|
response = await self.client.post(
|
|
236
|
-
|
|
229
|
+
"/memories",
|
|
237
230
|
json={
|
|
238
231
|
"content": content,
|
|
239
232
|
"cues": cues,
|
|
@@ -257,7 +250,7 @@ class AsyncCueMap:
|
|
|
257
250
|
) -> List[RecallResult]:
|
|
258
251
|
"""Recall memories (async)."""
|
|
259
252
|
response = await self.client.post(
|
|
260
|
-
|
|
253
|
+
"/recall",
|
|
261
254
|
json={
|
|
262
255
|
"cues": cues,
|
|
263
256
|
"limit": limit,
|
|
@@ -275,7 +268,7 @@ class AsyncCueMap:
|
|
|
275
268
|
async def reinforce(self, memory_id: str, cues: List[str]) -> bool:
|
|
276
269
|
"""Reinforce a memory (async)."""
|
|
277
270
|
response = await self.client.patch(
|
|
278
|
-
|
|
271
|
+
f"/memories/{memory_id}/reinforce",
|
|
279
272
|
json={"cues": cues},
|
|
280
273
|
headers=self._headers()
|
|
281
274
|
)
|
|
@@ -285,7 +278,7 @@ class AsyncCueMap:
|
|
|
285
278
|
async def get(self, memory_id: str) -> Memory:
|
|
286
279
|
"""Get a memory by ID (async)."""
|
|
287
280
|
response = await self.client.get(
|
|
288
|
-
|
|
281
|
+
f"/memories/{memory_id}",
|
|
289
282
|
headers=self._headers()
|
|
290
283
|
)
|
|
291
284
|
|
|
@@ -299,7 +292,7 @@ class AsyncCueMap:
|
|
|
299
292
|
async def stats(self) -> Dict[str, Any]:
|
|
300
293
|
"""Get server statistics (async)."""
|
|
301
294
|
response = await self.client.get(
|
|
302
|
-
|
|
295
|
+
"/stats",
|
|
303
296
|
headers=self._headers()
|
|
304
297
|
)
|
|
305
298
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|