userid parameter.userid appears for the first time, the backend will automatically generate a corresponding user and summarize the conversation through the LLM, extracting relevant information as long-term memory.userid has appeared before, the backend will automatically retrieve the corresponding long-term memory and update the latest memory, automatically adding it to the system and passing it to the large model.userid must comply with the uuidV4 standard; if it does not, the memory operation will not be executed. UUID generation test link: https://www.uuidgenerator.net/version4{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "我是谁?"}],
"userid":"fe657e7e-862e-4be0-990d-37428979a38c"
}curl --location --request POST 'https://api.302.ai/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "我是谁?"}],
"userid":"fe657e7e-862e-4be0-990d-37428979a38c"
}'{
"id": "chatcmpl-D18ryWua3cgLEwtqLxcwOrbkpgKvt",
"model": "gpt-4o-mini",
"object": "chat.completion",
"choices": [
{
"delta": {
"role": "assistant",
"content": "你是一位18岁的年轻男性,名叫didara,来自广州。你对香水有浓厚的兴趣,希望找到一些品牌推荐。同时,你有一个目标,就是想要更好地了解自己。这个探索自我的过程是非常重要的,可以通过各种方式,比如反思个人经历、兴趣爱好以及与他人的交流来更深入地认识自己。你想从哪个方面开始了解自己呢?"
},
"message": {
"role": "assistant",
"content": "你是一位18岁的年轻男性,名叫didara,来自广州。你对香水有浓厚的兴趣,希望找到一些品牌推荐。同时,你有一个目标,就是想要更好地了解自己。这个探索自我的过程是非常重要的,可以通过各种方式,比如反思个人经历、兴趣爱好以及与他人的交流来更深入地认识自己。你想从哪个方面开始了解自己呢?"
},
"index": 0,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 138,
"completion_tokens": 89,
"total_tokens": 227,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"created": 1769164794,
"system_fingerprint": "fp_f97eff32c5"
}