生成多轮策略内容
curl --request POST \
--url https://revor.ai/api/v2/agents/{agentId}/sequence/generate \
--header 'Content-Type: application/json' \
--data '
{
"round_no": 123,
"content_generation_mode": "<string>",
"content_input": "<string>",
"followup_purpose": "<string>",
"generate_both": true,
"prior_rounds": [
{}
]
}
'import requests
url = "https://revor.ai/api/v2/agents/{agentId}/sequence/generate"
payload = {
"round_no": 123,
"content_generation_mode": "<string>",
"content_input": "<string>",
"followup_purpose": "<string>",
"generate_both": True,
"prior_rounds": [{}]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
round_no: 123,
content_generation_mode: '<string>',
content_input: '<string>',
followup_purpose: '<string>',
generate_both: true,
prior_rounds: [{}]
})
};
fetch('https://revor.ai/api/v2/agents/{agentId}/sequence/generate', 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://revor.ai/api/v2/agents/{agentId}/sequence/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'round_no' => 123,
'content_generation_mode' => '<string>',
'content_input' => '<string>',
'followup_purpose' => '<string>',
'generate_both' => true,
'prior_rounds' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://revor.ai/api/v2/agents/{agentId}/sequence/generate"
payload := strings.NewReader("{\n \"round_no\": 123,\n \"content_generation_mode\": \"<string>\",\n \"content_input\": \"<string>\",\n \"followup_purpose\": \"<string>\",\n \"generate_both\": true,\n \"prior_rounds\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revor.ai/api/v2/agents/{agentId}/sequence/generate")
.header("Content-Type", "application/json")
.body("{\n \"round_no\": 123,\n \"content_generation_mode\": \"<string>\",\n \"content_input\": \"<string>\",\n \"followup_purpose\": \"<string>\",\n \"generate_both\": true,\n \"prior_rounds\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/agents/{agentId}/sequence/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"round_no\": 123,\n \"content_generation_mode\": \"<string>\",\n \"content_input\": \"<string>\",\n \"followup_purpose\": \"<string>\",\n \"generate_both\": true,\n \"prior_rounds\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body智能体
生成多轮策略内容
为某轮跟进生成策略内容,不保存不发送。
POST
/
api
/
v2
/
agents
/
{agentId}
/
sequence
/
generate
生成多轮策略内容
curl --request POST \
--url https://revor.ai/api/v2/agents/{agentId}/sequence/generate \
--header 'Content-Type: application/json' \
--data '
{
"round_no": 123,
"content_generation_mode": "<string>",
"content_input": "<string>",
"followup_purpose": "<string>",
"generate_both": true,
"prior_rounds": [
{}
]
}
'import requests
url = "https://revor.ai/api/v2/agents/{agentId}/sequence/generate"
payload = {
"round_no": 123,
"content_generation_mode": "<string>",
"content_input": "<string>",
"followup_purpose": "<string>",
"generate_both": True,
"prior_rounds": [{}]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
round_no: 123,
content_generation_mode: '<string>',
content_input: '<string>',
followup_purpose: '<string>',
generate_both: true,
prior_rounds: [{}]
})
};
fetch('https://revor.ai/api/v2/agents/{agentId}/sequence/generate', 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://revor.ai/api/v2/agents/{agentId}/sequence/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'round_no' => 123,
'content_generation_mode' => '<string>',
'content_input' => '<string>',
'followup_purpose' => '<string>',
'generate_both' => true,
'prior_rounds' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://revor.ai/api/v2/agents/{agentId}/sequence/generate"
payload := strings.NewReader("{\n \"round_no\": 123,\n \"content_generation_mode\": \"<string>\",\n \"content_input\": \"<string>\",\n \"followup_purpose\": \"<string>\",\n \"generate_both\": true,\n \"prior_rounds\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revor.ai/api/v2/agents/{agentId}/sequence/generate")
.header("Content-Type", "application/json")
.body("{\n \"round_no\": 123,\n \"content_generation_mode\": \"<string>\",\n \"content_input\": \"<string>\",\n \"followup_purpose\": \"<string>\",\n \"generate_both\": true,\n \"prior_rounds\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/agents/{agentId}/sequence/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"round_no\": 123,\n \"content_generation_mode\": \"<string>\",\n \"content_input\": \"<string>\",\n \"followup_purpose\": \"<string>\",\n \"generate_both\": true,\n \"prior_rounds\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body为某轮跟进生成策略内容草稿。不保存结果,不发送消息,不扣触达次数。
接口概览
| 方法 | POST |
| 路径 | /api/v2/agents/{agentId}/sequence/generate |
| 权限 | agents:write |
| 幂等性 | 需要 Idempotency-Key |
| 限流桶 | expensive_create |
| 返回 | 公共 job |
路径参数
请求体
cURL
curl -X POST "https://revor.ai/api/v2/agents/{agentId}/sequence/generate" \
-H "Authorization: Bearer sk-revor-REPLACE_ME" \
-H "Idempotency-Key: agent-sequence-gen-001" \
-H "Content-Type: application/json" \
-d '{
"round_no": 2,
"content_generation_mode": "ai_personalized",
"content_input": "强调交货期",
"followup_purpose": "补充应用案例",
"generate_both": true,
"prior_rounds": []
}'
请求体
{
"round_no": 2,
"content_generation_mode": "ai_personalized",
"content_input": "强调交货期",
"followup_purpose": "补充应用案例",
"generate_both": true,
"prior_rounds": []
}
响应
202
{
"ok": true,
"request_id": "req_xxx",
"item": {
"id": "job-uuid",
"status": "queued",
"type": "agent_sequence_generate"
}
}
行为说明
- 使用已保存的首轮配置。
- 不保存生成结果,不发送消息。
- 不扣触达次数,但受
expensive_create限流与异步任务并发限制。 - 结果还包含
agent_id、agent_version、round_no。 - 外部模型失败不自动重复生成;重新生成使用新幂等键。
错误码
| HTTP | 错误码 | 含义 |
|---|---|---|
400 | agent_input_invalid | 参数错误 |
403 | permission_denied | 缺少 agents:write |
404 | agent_not_found | 智能体不存在 |
404 | agent_sequence_unavailable | 多轮触达未开放 |
MCP 工具
revor_generate_agent_sequence_content
