docs: correct memory decay claims that contradict the SDK (#6905)
This commit is contained in:
@@ -75,7 +75,7 @@ print(response)
|
|||||||
```
|
```
|
||||||
</CodeGroup>
|
</CodeGroup>
|
||||||
|
|
||||||
This "Updated custom categories" message is specific to a PATCH-style partial update, which is what `client.project.update()` sends. Calling the raw API with a full PUT instead returns a generic `{"message": "Project updated successfully."}`, regardless of which fields changed.
|
Treat the `message` string as informational. The project endpoint accepts `PATCH` only, and its documented response is the generic `{"message": "Project updated successfully"}`. Confirm an update by reading the field back, as in the next step, rather than by matching on the message.
|
||||||
|
|
||||||
### 2. Confirm the active catalog
|
### 2. Confirm the active catalog
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ client.project.update(decay=True)
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript JavaScript
|
```javascript JavaScript
|
||||||
await client.project.update({ decay: true });
|
await client.updateProject({ decay: true });
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash cURL
|
```bash cURL
|
||||||
@@ -75,32 +75,32 @@ curl -X PATCH https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PR
|
|||||||
```
|
```
|
||||||
|
|
||||||
```json Response
|
```json Response
|
||||||
{ "message": "Updated decay" }
|
{ "message": "Project updated successfully" }
|
||||||
```
|
```
|
||||||
</CodeGroup>
|
</CodeGroup>
|
||||||
|
|
||||||
### 2. Confirm the state
|
### 2. Confirm the state
|
||||||
|
|
||||||
`decay` is returned on every project read; there is currently no way to narrow the response to just this field, so read the full project object and pick out `decay`.
|
`decay` is returned on every project read. To fetch only this field, use `?fields=decay`.
|
||||||
|
|
||||||
<CodeGroup>
|
<CodeGroup>
|
||||||
```python Python
|
```python Python
|
||||||
response = client.project.get()
|
response = client.project.get(fields=["decay"])
|
||||||
print(response["decay"])
|
print(response["decay"])
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript JavaScript
|
```javascript JavaScript
|
||||||
const response = await client.project.get();
|
const response = await client.getProject({ fields: ["decay"] });
|
||||||
console.log(response.decay);
|
console.log(response.decay);
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash cURL
|
```bash cURL
|
||||||
curl "https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PROJECT_ID/" \
|
curl "https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PROJECT_ID/?fields=decay" \
|
||||||
-H "Authorization: Token $MEM0_API_KEY"
|
-H "Authorization: Token $MEM0_API_KEY"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json Response
|
```json Response
|
||||||
{ "decay": true, "...": "full project object" }
|
{ "decay": true }
|
||||||
```
|
```
|
||||||
</CodeGroup>
|
</CodeGroup>
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ client.project.update(decay=False)
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript JavaScript
|
```javascript JavaScript
|
||||||
await client.project.update({ decay: false });
|
await client.updateProject({ decay: false });
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash cURL
|
```bash cURL
|
||||||
|
|||||||
Reference in New Issue
Block a user