获取属性记忆模板列表
分页返回 API Key 所属项目下的属性记忆模板摘要,按创建时间倒序排列;创建时间相同的按模板 ID 倒序排列。项目无模板时返回空数组;页码超出范围时返回空数组,并保留实际总数和总页数。
POST
import os
import requests
import json
# 替换成你的 API Key
os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY"
os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1"
data = {
"page": 1,
"size": 10
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/list/profile_template"
res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/list/profile_template \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"page": 1,
"size": 10
}'
{
"code": 0,
"data": {
"profile_templates": [
{
"profile_template_id": "<string>",
"name": "<string>",
"project_id": "<string>",
"instance_count": 0,
"create_time": "<string>",
"update_time": "<string>"
}
],
"total": 0,
"current": 0,
"size": 0,
"pages": 0
},
"message": "ok"
}Authorizations
Authorization
string
header
required
Token API_key,可在 API 控制台>接口密钥 中查看
请求体
application/json
page
number
default: 1
页码,从 1 开始。
size
number
default: 10
每页条数,取值 1~100。
响应体
application/json
Successful Response
code
number
接口状态码。
Example: 0
data
object
展示属性
message
string
接口提示信息。
Example: "ok"
import os
import requests
import json
# 替换成你的 API Key
os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY"
os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1"
data = {
"page": 1,
"size": 10
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/list/profile_template"
res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/list/profile_template \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"page": 1,
"size": 10
}'
{
"code": 0,
"data": {
"profile_templates": [
{
"profile_template_id": "<string>",
"name": "<string>",
"project_id": "<string>",
"instance_count": 0,
"create_time": "<string>",
"update_time": "<string>"
}
],
"total": 0,
"current": 0,
"size": 0,
"pages": 0
},
"message": "ok"
}