GET
/
api
/
v1
/
users
/
context
/
{user_id}
{
  "data": {
    "context": "<string>"
  },
  "errno": 0,
  "errmsg": ""
}

Return a string of the user’s personalized context you can directly insert it into your prompt.

Format:

<memory>
# Below is the user profile:
{profile}

# Below is the latest events of the user:
{event}
</memory>
Please provide your answer using the information within the <memory> tag at the appropriate time.

Path Parameters

user_id
string
required

The ID of the user

Query Parameters

max_token_size
integer
default:
1000

Max token size of returned Context

prefer_topics
string[]

Rank prefer topics at first to try to keep them in filtering, default order is by updated time

only_topics
string[]

Only return profiles with these topics, default is all

Response

200
application/json
Successful Response
data
object | null

Response containing user context

errno
enum<integer>

Error code, 0 means success

Available options:
0,
400,
401,
403,
404,
405,
409,
422,
500,
501,
502,
503,
504
errmsg
string
default:

Error message, empty when success