获取梦境策略
curl --request GET \
--url https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"memory_store_id": "mstr_01h455vb4pex5vsknk084sn02q",
"agent_id": "agent_01h455vb4pex5vsknk084sn02q",
"activity": {
"enabled": true,
"min_changed_sessions": 3
},
"schedule": {
"enabled": false
},
"trigger_id": "trig_01h455vb4pex5vsknk084sn02q",
"environment_id": "env_01h455vb4pex5vsknk084sn02q",
"updated_at": "2026-01-01T00:00:00.000Z"
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}返回单个记忆库的梦境策略。
从未配置过策略时,响应中两个条件均为禁用,且不携带 agent_id、trigger_id、environment_id 或 updated_at。已归档的记忆库仍可读取。
GET
/
v1
/
memory-stores
/
{memory_store_id}
/
dream-policy
获取梦境策略
curl --request GET \
--url https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/memory-stores/{memory_store_id}/dream-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"memory_store_id": "mstr_01h455vb4pex5vsknk084sn02q",
"agent_id": "agent_01h455vb4pex5vsknk084sn02q",
"activity": {
"enabled": true,
"min_changed_sessions": 3
},
"schedule": {
"enabled": false
},
"trigger_id": "trig_01h455vb4pex5vsknk084sn02q",
"environment_id": "env_01h455vb4pex5vsknk084sn02q",
"updated_at": "2026-01-01T00:00:00.000Z"
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}路径参数
记忆库 ID。
Pattern:
^mstr_[0-9a-hjkmnp-tv-z]{26}$响应
记忆库的梦境策略。未配置时两个条件均为禁用。
单个记忆库的梦境设置。
活动条件和定时条件分别判断,任一满足即触发。每次触发都会新建一个以读写方式挂载该记忆库的会话,并在策略持有的触发器下记录为一次触发器运行。
受此策略控制的记忆库。
Pattern:
^mstr_[0-9a-hjkmnp-tv-z]{26}$活动条件。始终存在,包括禁用时。
Show child attributes
Show child attributes
定时条件。始终存在,包括禁用时。
Show child attributes
Show child attributes
运行梦境会话的智能体。缺省表示使用平台默认梦境智能体。
Pattern:
^agent_[0-9a-hjkmnp-tv-z]{26}$此策略持有的触发器。未配置策略时缺省。
Pattern:
^trig_[0-9a-hjkmnp-tv-z]{26}$承载梦境会话的环境。未配置策略时缺省。
Pattern:
^env_[0-9a-hjkmnp-tv-z]{26}$策略上次更新的时间。未配置策略时缺省。
此页面对您有帮助吗?