Use this endpoint to update and save a user’s personalization preferences. These settings are saved at the user level, not per session, and will be applied to all of the user’s future interactions.
This is a PATCH request, you only need to send the fields you want to change.
For the best results, we recommend that you call this endpoint before the main interaction begins (for example, before audio streaming starts or before you call the /end endpoint).This ensures the user’s preferences are applied before content is generated. However, you can call this endpoint at any time to update the settings.
Code Examples
import requests
url = "https://sdp.suki.ai/api/v1/user/preferences"
headers = {
"sdp_suki_token": "<sdp_suki_token>",
"Content-Type": "application/json"
}
payload = {
"personalization_preference": {
"verbosity": "CONCISE", # Options: CONCISE, BALANCED, DETAILED
"section_format": [
{
"loinc": "10164-2",
"style": "NARRATIVE" # Options: NARRATIVE, BULLETED
}
]
}
}
response = requests.patch(url, json=payload, headers=headers)
if response.status_code == 200:
data = response.json()
print("Preferences updated successfully")
print(f"Updated preferences: {data}")
else:
print(f"Failed to update preferences: {response.status_code}")
print(response.json())
personalization_preference