mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
Update apps/docs/user-profiles/api.mdx
Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
This commit is contained in:
parent
d3727abac0
commit
aab469e4d9
1 changed files with 46 additions and 9 deletions
|
|
@ -25,7 +25,7 @@ Retrieves a user's profile, optionally combined with search results.
|
|||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `containerTag` | string | Yes | The container tag (usually user ID) to get profiles for |
|
||||
| `threshold` | float | Yes | Threshold for search results. Only results with a score above this threshold will be included. |
|
||||
| `threshold` | float | No | Threshold for filtering search results. Only results with a score above this threshold will be included. |
|
||||
| `q` | string | No | Optional search query to include search results with the profile |
|
||||
|
||||
## Response
|
||||
|
|
@ -75,8 +75,7 @@ const response = await fetch('https://api.supermemory.ai/v4/profile', {
|
|||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
containerTag: 'user_123',
|
||||
threshold: 0.7
|
||||
containerTag: 'user_123'
|
||||
})
|
||||
});
|
||||
|
||||
|
|
@ -97,8 +96,7 @@ response = requests.post(
|
|||
'Content-Type': 'application/json'
|
||||
},
|
||||
json={
|
||||
'containerTag': 'user_123',
|
||||
'threshold': 0.7
|
||||
'containerTag': 'user_123'
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -113,8 +111,7 @@ curl -X POST https://api.supermemory.ai/v4/profile \
|
|||
-H "Authorization: Bearer YOUR_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"containerTag": "user_123",
|
||||
"threshold": 0.7
|
||||
"containerTag": "user_123"
|
||||
}'
|
||||
```
|
||||
|
||||
|
|
@ -135,7 +132,6 @@ const response = await fetch('https://api.supermemory.ai/v4/profile', {
|
|||
},
|
||||
body: JSON.stringify({
|
||||
containerTag: 'user_123',
|
||||
threshold: 0.7,
|
||||
q: 'deployment errors yesterday'
|
||||
})
|
||||
});
|
||||
|
|
@ -158,7 +154,6 @@ response = requests.post(
|
|||
},
|
||||
json={
|
||||
'containerTag': 'user_123',
|
||||
'threshold': 0.7,
|
||||
'q': 'deployment errors yesterday'
|
||||
}
|
||||
)
|
||||
|
|
@ -171,6 +166,48 @@ search_results = data.get('searchResults', {}).get('results', [])
|
|||
|
||||
</CodeGroup>
|
||||
|
||||
## Profile with Threshold
|
||||
|
||||
Use the optional `threshold` parameter to filter search results by relevance score:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```typescript TypeScript
|
||||
const response = await fetch('https://api.supermemory.ai/v4/profile', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.SUPERMEMORY_API_KEY}`,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
containerTag: 'user_123',
|
||||
threshold: 0.7, // Only include results with score > 0.7
|
||||
q: 'deployment errors yesterday'
|
||||
})
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
```
|
||||
|
||||
```python Python
|
||||
response = requests.post(
|
||||
'https://api.supermemory.ai/v4/profile',
|
||||
headers={
|
||||
'Authorization': f'Bearer {os.getenv("SUPERMEMORY_API_KEY")}',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
json={
|
||||
'containerTag': 'user_123',
|
||||
'threshold': 0.7, # Only include results with score > 0.7
|
||||
'q': 'deployment errors yesterday'
|
||||
}
|
||||
)
|
||||
|
||||
data = response.json()
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## Error Responses
|
||||
|
||||
| Status | Description |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue