Update Agent
curl --request POST \
--url https://api-spectra.duplik.cn/v1/agent/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "sales",
"conversation": {
"background_color": "#FFFFFF",
"background_image": "",
"copyright": "",
"enabled": true,
"greeting_message": "",
"guiding_questions": [
"string"
],
"recommended_related_questions_prompt": "",
"show_answer_source": true,
"show_answer_source_data": true,
"text_color": "#000000"
},
"description": "You are a helpful assist",
"icon": "https://example.com/analysis-icon.png",
"llm": {
"completion_params": {
"max_memory": 2048,
"max_memory_num": 5,
"max_tokens": 2048,
"temperature": 0.7
},
"model_name": "qwen2.5-72b-instruct",
"model_provider": "aliyun"
},
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"orchestration": {
"instruction": {
"enabled": true,
"rewriting_count": 3,
"rewriting_prompt": "rewriting prompt"
},
"knowledge_list": [
{
"folders": [
{
"folder_id": "xxx",
"name": "xxx"
}
],
"knowledge_id": "631506272047205"
}
],
"tools": [
{
"tool_apis": [
{
"api_id": "631506271514745"
}
],
"tool_id": "631506271912031"
},
{
"tool_id": "631506271912032",
"tool_llm": {
"llm_id": "631506271514746"
}
}
],
"voice": {
"enabled": false,
"input_enabled": false,
"output_enabled": false
}
},
"prompt": "You are a helpful assist",
"publish_status": 1,
"status": 1
}
'import requests
url = "https://api-spectra.duplik.cn/v1/agent/{agent_id}"
payload = {
"category": "sales",
"conversation": {
"background_color": "#FFFFFF",
"background_image": "",
"copyright": "",
"enabled": True,
"greeting_message": "",
"guiding_questions": ["string"],
"recommended_related_questions_prompt": "",
"show_answer_source": True,
"show_answer_source_data": True,
"text_color": "#000000"
},
"description": "You are a helpful assist",
"icon": "https://example.com/analysis-icon.png",
"llm": {
"completion_params": {
"max_memory": 2048,
"max_memory_num": 5,
"max_tokens": 2048,
"temperature": 0.7
},
"model_name": "qwen2.5-72b-instruct",
"model_provider": "aliyun"
},
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"orchestration": {
"instruction": {
"enabled": True,
"rewriting_count": 3,
"rewriting_prompt": "rewriting prompt"
},
"knowledge_list": [
{
"folders": [
{
"folder_id": "xxx",
"name": "xxx"
}
],
"knowledge_id": "631506272047205"
}
],
"tools": [
{
"tool_apis": [{ "api_id": "631506271514745" }],
"tool_id": "631506271912031"
},
{
"tool_id": "631506271912032",
"tool_llm": { "llm_id": "631506271514746" }
}
],
"voice": {
"enabled": False,
"input_enabled": False,
"output_enabled": False
}
},
"prompt": "You are a helpful assist",
"publish_status": 1,
"status": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: 'sales',
conversation: {
background_color: '#FFFFFF',
background_image: '',
copyright: '',
enabled: true,
greeting_message: '',
guiding_questions: ['string'],
recommended_related_questions_prompt: '',
show_answer_source: true,
show_answer_source_data: true,
text_color: '#000000'
},
description: 'You are a helpful assist',
icon: 'https://example.com/analysis-icon.png',
llm: {
completion_params: {max_memory: 2048, max_memory_num: 5, max_tokens: 2048, temperature: 0.7},
model_name: 'qwen2.5-72b-instruct',
model_provider: 'aliyun'
},
mode: 'advanced_single',
name: 'advanced_single_agent use kb and other tools',
orchestration: {
instruction: {enabled: true, rewriting_count: 3, rewriting_prompt: 'rewriting prompt'},
knowledge_list: [{folders: [{folder_id: 'xxx', name: 'xxx'}], knowledge_id: '631506272047205'}],
tools: [
{tool_apis: [{api_id: '631506271514745'}], tool_id: '631506271912031'},
{tool_id: '631506271912032', tool_llm: {llm_id: '631506271514746'}}
],
voice: {enabled: false, input_enabled: false, output_enabled: false}
},
prompt: 'You are a helpful assist',
publish_status: 1,
status: 1
})
};
fetch('https://api-spectra.duplik.cn/v1/agent/{agent_id}', 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-spectra.duplik.cn/v1/agent/{agent_id}",
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([
'category' => 'sales',
'conversation' => [
'background_color' => '#FFFFFF',
'background_image' => '',
'copyright' => '',
'enabled' => true,
'greeting_message' => '',
'guiding_questions' => [
'string'
],
'recommended_related_questions_prompt' => '',
'show_answer_source' => true,
'show_answer_source_data' => true,
'text_color' => '#000000'
],
'description' => 'You are a helpful assist',
'icon' => 'https://example.com/analysis-icon.png',
'llm' => [
'completion_params' => [
'max_memory' => 2048,
'max_memory_num' => 5,
'max_tokens' => 2048,
'temperature' => 0.7
],
'model_name' => 'qwen2.5-72b-instruct',
'model_provider' => 'aliyun'
],
'mode' => 'advanced_single',
'name' => 'advanced_single_agent use kb and other tools',
'orchestration' => [
'instruction' => [
'enabled' => true,
'rewriting_count' => 3,
'rewriting_prompt' => 'rewriting prompt'
],
'knowledge_list' => [
[
'folders' => [
[
'folder_id' => 'xxx',
'name' => 'xxx'
]
],
'knowledge_id' => '631506272047205'
]
],
'tools' => [
[
'tool_apis' => [
[
'api_id' => '631506271514745'
]
],
'tool_id' => '631506271912031'
],
[
'tool_id' => '631506271912032',
'tool_llm' => [
'llm_id' => '631506271514746'
]
]
],
'voice' => [
'enabled' => false,
'input_enabled' => false,
'output_enabled' => false
]
],
'prompt' => 'You are a helpful assist',
'publish_status' => 1,
'status' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api-spectra.duplik.cn/v1/agent/{agent_id}"
payload := strings.NewReader("{\n \"category\": \"sales\",\n \"conversation\": {\n \"background_color\": \"#FFFFFF\",\n \"background_image\": \"\",\n \"copyright\": \"\",\n \"enabled\": true,\n \"greeting_message\": \"\",\n \"guiding_questions\": [\n \"string\"\n ],\n \"recommended_related_questions_prompt\": \"\",\n \"show_answer_source\": true,\n \"show_answer_source_data\": true,\n \"text_color\": \"#000000\"\n },\n \"description\": \"You are a helpful assist\",\n \"icon\": \"https://example.com/analysis-icon.png\",\n \"llm\": {\n \"completion_params\": {\n \"max_memory\": 2048,\n \"max_memory_num\": 5,\n \"max_tokens\": 2048,\n \"temperature\": 0.7\n },\n \"model_name\": \"qwen2.5-72b-instruct\",\n \"model_provider\": \"aliyun\"\n },\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"orchestration\": {\n \"instruction\": {\n \"enabled\": true,\n \"rewriting_count\": 3,\n \"rewriting_prompt\": \"rewriting prompt\"\n },\n \"knowledge_list\": [\n {\n \"folders\": [\n {\n \"folder_id\": \"xxx\",\n \"name\": \"xxx\"\n }\n ],\n \"knowledge_id\": \"631506272047205\"\n }\n ],\n \"tools\": [\n {\n \"tool_apis\": [\n {\n \"api_id\": \"631506271514745\"\n }\n ],\n \"tool_id\": \"631506271912031\"\n },\n {\n \"tool_id\": \"631506271912032\",\n \"tool_llm\": {\n \"llm_id\": \"631506271514746\"\n }\n }\n ],\n \"voice\": {\n \"enabled\": false,\n \"input_enabled\": false,\n \"output_enabled\": false\n }\n },\n \"prompt\": \"You are a helpful assist\",\n \"publish_status\": 1,\n \"status\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-spectra.duplik.cn/v1/agent/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"sales\",\n \"conversation\": {\n \"background_color\": \"#FFFFFF\",\n \"background_image\": \"\",\n \"copyright\": \"\",\n \"enabled\": true,\n \"greeting_message\": \"\",\n \"guiding_questions\": [\n \"string\"\n ],\n \"recommended_related_questions_prompt\": \"\",\n \"show_answer_source\": true,\n \"show_answer_source_data\": true,\n \"text_color\": \"#000000\"\n },\n \"description\": \"You are a helpful assist\",\n \"icon\": \"https://example.com/analysis-icon.png\",\n \"llm\": {\n \"completion_params\": {\n \"max_memory\": 2048,\n \"max_memory_num\": 5,\n \"max_tokens\": 2048,\n \"temperature\": 0.7\n },\n \"model_name\": \"qwen2.5-72b-instruct\",\n \"model_provider\": \"aliyun\"\n },\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"orchestration\": {\n \"instruction\": {\n \"enabled\": true,\n \"rewriting_count\": 3,\n \"rewriting_prompt\": \"rewriting prompt\"\n },\n \"knowledge_list\": [\n {\n \"folders\": [\n {\n \"folder_id\": \"xxx\",\n \"name\": \"xxx\"\n }\n ],\n \"knowledge_id\": \"631506272047205\"\n }\n ],\n \"tools\": [\n {\n \"tool_apis\": [\n {\n \"api_id\": \"631506271514745\"\n }\n ],\n \"tool_id\": \"631506271912031\"\n },\n {\n \"tool_id\": \"631506271912032\",\n \"tool_llm\": {\n \"llm_id\": \"631506271514746\"\n }\n }\n ],\n \"voice\": {\n \"enabled\": false,\n \"input_enabled\": false,\n \"output_enabled\": false\n }\n },\n \"prompt\": \"You are a helpful assist\",\n \"publish_status\": 1,\n \"status\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"sales\",\n \"conversation\": {\n \"background_color\": \"#FFFFFF\",\n \"background_image\": \"\",\n \"copyright\": \"\",\n \"enabled\": true,\n \"greeting_message\": \"\",\n \"guiding_questions\": [\n \"string\"\n ],\n \"recommended_related_questions_prompt\": \"\",\n \"show_answer_source\": true,\n \"show_answer_source_data\": true,\n \"text_color\": \"#000000\"\n },\n \"description\": \"You are a helpful assist\",\n \"icon\": \"https://example.com/analysis-icon.png\",\n \"llm\": {\n \"completion_params\": {\n \"max_memory\": 2048,\n \"max_memory_num\": 5,\n \"max_tokens\": 2048,\n \"temperature\": 0.7\n },\n \"model_name\": \"qwen2.5-72b-instruct\",\n \"model_provider\": \"aliyun\"\n },\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"orchestration\": {\n \"instruction\": {\n \"enabled\": true,\n \"rewriting_count\": 3,\n \"rewriting_prompt\": \"rewriting prompt\"\n },\n \"knowledge_list\": [\n {\n \"folders\": [\n {\n \"folder_id\": \"xxx\",\n \"name\": \"xxx\"\n }\n ],\n \"knowledge_id\": \"631506272047205\"\n }\n ],\n \"tools\": [\n {\n \"tool_apis\": [\n {\n \"api_id\": \"631506271514745\"\n }\n ],\n \"tool_id\": \"631506271912031\"\n },\n {\n \"tool_id\": \"631506271912032\",\n \"tool_llm\": {\n \"llm_id\": \"631506271514746\"\n }\n }\n ],\n \"voice\": {\n \"enabled\": false,\n \"input_enabled\": false,\n \"output_enabled\": false\n }\n },\n \"prompt\": \"You are a helpful assist\",\n \"publish_status\": 1,\n \"status\": 1\n}"
response = http.request(request)
puts response.read_body{
"created_at": 123,
"updated_at": 123,
"org_id": "<string>",
"user_id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"mode": "<string>",
"icon": "<string>",
"description": "<string>",
"category": "<string>",
"prompt": "<string>",
"status": 123,
"publish_status": 123,
"orchestration": {
"instruction": {
"enabled": true,
"rewriting_count": 2,
"rewriting_prompt": "<string>"
},
"knowledge_tools_mode": "smart",
"knowledge_list": [
{
"knowledge_id": "<string>",
"dataset_id": "<string>",
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"folders": [
{
"folder_id": "<string>",
"name": "<string>"
}
]
}
],
"tools": [
{
"description": "Updated tool description",
"icon": "https://example.com/icon.png",
"name": "Updated Tool Name",
"status": 2,
"tool_llm": {
"description": "Updated llm tool description",
"icon": "https://example.com/icon.png",
"name": "Updated llm Tool Name",
"params": [
{
"description": "content",
"key": "content",
"required": true,
"test_data": "蛇年小蛇绕树枝"
}
],
"prompt": "你是一位英语翻译专家,请翻译如下内容,{content}"
}
}
],
"voice": {
"enabled": false,
"input_enabled": false,
"output_enabled": false
},
"multi_mode": "<string>",
"member_agents": [
{}
],
"recursion_limit": 25,
"intent_enabled": false,
"intent_prompt": "<string>"
},
"llm": {
"model_provider": "<string>",
"model_name": "<string>",
"completion_params": {
"temperature": 0.1,
"max_tokens": 2048,
"max_memory": 2048,
"max_memory_num": 5,
"stop_sequences": [
"<string>"
]
},
"model_description": "<string>"
},
"conversation": {
"enabled": true,
"greeting_message": "",
"guiding_questions": [
"<string>"
],
"copyright": "",
"background_color": "rgba(0, 114, 255, 0.10)",
"text_color": "#313D4F",
"background_image": "",
"show_answer_source": false,
"show_answer_source_data": false,
"recommend_related_questions": true,
"recommended_related_questions_prompt": ""
},
"created_by": "<string>",
"permission_types": [],
"message_count": 0
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Agents
Update Agent
更新一个 Agent
POST
/
v1
/
agent
/
{agent_id}
Update Agent
curl --request POST \
--url https://api-spectra.duplik.cn/v1/agent/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "sales",
"conversation": {
"background_color": "#FFFFFF",
"background_image": "",
"copyright": "",
"enabled": true,
"greeting_message": "",
"guiding_questions": [
"string"
],
"recommended_related_questions_prompt": "",
"show_answer_source": true,
"show_answer_source_data": true,
"text_color": "#000000"
},
"description": "You are a helpful assist",
"icon": "https://example.com/analysis-icon.png",
"llm": {
"completion_params": {
"max_memory": 2048,
"max_memory_num": 5,
"max_tokens": 2048,
"temperature": 0.7
},
"model_name": "qwen2.5-72b-instruct",
"model_provider": "aliyun"
},
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"orchestration": {
"instruction": {
"enabled": true,
"rewriting_count": 3,
"rewriting_prompt": "rewriting prompt"
},
"knowledge_list": [
{
"folders": [
{
"folder_id": "xxx",
"name": "xxx"
}
],
"knowledge_id": "631506272047205"
}
],
"tools": [
{
"tool_apis": [
{
"api_id": "631506271514745"
}
],
"tool_id": "631506271912031"
},
{
"tool_id": "631506271912032",
"tool_llm": {
"llm_id": "631506271514746"
}
}
],
"voice": {
"enabled": false,
"input_enabled": false,
"output_enabled": false
}
},
"prompt": "You are a helpful assist",
"publish_status": 1,
"status": 1
}
'import requests
url = "https://api-spectra.duplik.cn/v1/agent/{agent_id}"
payload = {
"category": "sales",
"conversation": {
"background_color": "#FFFFFF",
"background_image": "",
"copyright": "",
"enabled": True,
"greeting_message": "",
"guiding_questions": ["string"],
"recommended_related_questions_prompt": "",
"show_answer_source": True,
"show_answer_source_data": True,
"text_color": "#000000"
},
"description": "You are a helpful assist",
"icon": "https://example.com/analysis-icon.png",
"llm": {
"completion_params": {
"max_memory": 2048,
"max_memory_num": 5,
"max_tokens": 2048,
"temperature": 0.7
},
"model_name": "qwen2.5-72b-instruct",
"model_provider": "aliyun"
},
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"orchestration": {
"instruction": {
"enabled": True,
"rewriting_count": 3,
"rewriting_prompt": "rewriting prompt"
},
"knowledge_list": [
{
"folders": [
{
"folder_id": "xxx",
"name": "xxx"
}
],
"knowledge_id": "631506272047205"
}
],
"tools": [
{
"tool_apis": [{ "api_id": "631506271514745" }],
"tool_id": "631506271912031"
},
{
"tool_id": "631506271912032",
"tool_llm": { "llm_id": "631506271514746" }
}
],
"voice": {
"enabled": False,
"input_enabled": False,
"output_enabled": False
}
},
"prompt": "You are a helpful assist",
"publish_status": 1,
"status": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: 'sales',
conversation: {
background_color: '#FFFFFF',
background_image: '',
copyright: '',
enabled: true,
greeting_message: '',
guiding_questions: ['string'],
recommended_related_questions_prompt: '',
show_answer_source: true,
show_answer_source_data: true,
text_color: '#000000'
},
description: 'You are a helpful assist',
icon: 'https://example.com/analysis-icon.png',
llm: {
completion_params: {max_memory: 2048, max_memory_num: 5, max_tokens: 2048, temperature: 0.7},
model_name: 'qwen2.5-72b-instruct',
model_provider: 'aliyun'
},
mode: 'advanced_single',
name: 'advanced_single_agent use kb and other tools',
orchestration: {
instruction: {enabled: true, rewriting_count: 3, rewriting_prompt: 'rewriting prompt'},
knowledge_list: [{folders: [{folder_id: 'xxx', name: 'xxx'}], knowledge_id: '631506272047205'}],
tools: [
{tool_apis: [{api_id: '631506271514745'}], tool_id: '631506271912031'},
{tool_id: '631506271912032', tool_llm: {llm_id: '631506271514746'}}
],
voice: {enabled: false, input_enabled: false, output_enabled: false}
},
prompt: 'You are a helpful assist',
publish_status: 1,
status: 1
})
};
fetch('https://api-spectra.duplik.cn/v1/agent/{agent_id}', 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-spectra.duplik.cn/v1/agent/{agent_id}",
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([
'category' => 'sales',
'conversation' => [
'background_color' => '#FFFFFF',
'background_image' => '',
'copyright' => '',
'enabled' => true,
'greeting_message' => '',
'guiding_questions' => [
'string'
],
'recommended_related_questions_prompt' => '',
'show_answer_source' => true,
'show_answer_source_data' => true,
'text_color' => '#000000'
],
'description' => 'You are a helpful assist',
'icon' => 'https://example.com/analysis-icon.png',
'llm' => [
'completion_params' => [
'max_memory' => 2048,
'max_memory_num' => 5,
'max_tokens' => 2048,
'temperature' => 0.7
],
'model_name' => 'qwen2.5-72b-instruct',
'model_provider' => 'aliyun'
],
'mode' => 'advanced_single',
'name' => 'advanced_single_agent use kb and other tools',
'orchestration' => [
'instruction' => [
'enabled' => true,
'rewriting_count' => 3,
'rewriting_prompt' => 'rewriting prompt'
],
'knowledge_list' => [
[
'folders' => [
[
'folder_id' => 'xxx',
'name' => 'xxx'
]
],
'knowledge_id' => '631506272047205'
]
],
'tools' => [
[
'tool_apis' => [
[
'api_id' => '631506271514745'
]
],
'tool_id' => '631506271912031'
],
[
'tool_id' => '631506271912032',
'tool_llm' => [
'llm_id' => '631506271514746'
]
]
],
'voice' => [
'enabled' => false,
'input_enabled' => false,
'output_enabled' => false
]
],
'prompt' => 'You are a helpful assist',
'publish_status' => 1,
'status' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api-spectra.duplik.cn/v1/agent/{agent_id}"
payload := strings.NewReader("{\n \"category\": \"sales\",\n \"conversation\": {\n \"background_color\": \"#FFFFFF\",\n \"background_image\": \"\",\n \"copyright\": \"\",\n \"enabled\": true,\n \"greeting_message\": \"\",\n \"guiding_questions\": [\n \"string\"\n ],\n \"recommended_related_questions_prompt\": \"\",\n \"show_answer_source\": true,\n \"show_answer_source_data\": true,\n \"text_color\": \"#000000\"\n },\n \"description\": \"You are a helpful assist\",\n \"icon\": \"https://example.com/analysis-icon.png\",\n \"llm\": {\n \"completion_params\": {\n \"max_memory\": 2048,\n \"max_memory_num\": 5,\n \"max_tokens\": 2048,\n \"temperature\": 0.7\n },\n \"model_name\": \"qwen2.5-72b-instruct\",\n \"model_provider\": \"aliyun\"\n },\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"orchestration\": {\n \"instruction\": {\n \"enabled\": true,\n \"rewriting_count\": 3,\n \"rewriting_prompt\": \"rewriting prompt\"\n },\n \"knowledge_list\": [\n {\n \"folders\": [\n {\n \"folder_id\": \"xxx\",\n \"name\": \"xxx\"\n }\n ],\n \"knowledge_id\": \"631506272047205\"\n }\n ],\n \"tools\": [\n {\n \"tool_apis\": [\n {\n \"api_id\": \"631506271514745\"\n }\n ],\n \"tool_id\": \"631506271912031\"\n },\n {\n \"tool_id\": \"631506271912032\",\n \"tool_llm\": {\n \"llm_id\": \"631506271514746\"\n }\n }\n ],\n \"voice\": {\n \"enabled\": false,\n \"input_enabled\": false,\n \"output_enabled\": false\n }\n },\n \"prompt\": \"You are a helpful assist\",\n \"publish_status\": 1,\n \"status\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-spectra.duplik.cn/v1/agent/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"sales\",\n \"conversation\": {\n \"background_color\": \"#FFFFFF\",\n \"background_image\": \"\",\n \"copyright\": \"\",\n \"enabled\": true,\n \"greeting_message\": \"\",\n \"guiding_questions\": [\n \"string\"\n ],\n \"recommended_related_questions_prompt\": \"\",\n \"show_answer_source\": true,\n \"show_answer_source_data\": true,\n \"text_color\": \"#000000\"\n },\n \"description\": \"You are a helpful assist\",\n \"icon\": \"https://example.com/analysis-icon.png\",\n \"llm\": {\n \"completion_params\": {\n \"max_memory\": 2048,\n \"max_memory_num\": 5,\n \"max_tokens\": 2048,\n \"temperature\": 0.7\n },\n \"model_name\": \"qwen2.5-72b-instruct\",\n \"model_provider\": \"aliyun\"\n },\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"orchestration\": {\n \"instruction\": {\n \"enabled\": true,\n \"rewriting_count\": 3,\n \"rewriting_prompt\": \"rewriting prompt\"\n },\n \"knowledge_list\": [\n {\n \"folders\": [\n {\n \"folder_id\": \"xxx\",\n \"name\": \"xxx\"\n }\n ],\n \"knowledge_id\": \"631506272047205\"\n }\n ],\n \"tools\": [\n {\n \"tool_apis\": [\n {\n \"api_id\": \"631506271514745\"\n }\n ],\n \"tool_id\": \"631506271912031\"\n },\n {\n \"tool_id\": \"631506271912032\",\n \"tool_llm\": {\n \"llm_id\": \"631506271514746\"\n }\n }\n ],\n \"voice\": {\n \"enabled\": false,\n \"input_enabled\": false,\n \"output_enabled\": false\n }\n },\n \"prompt\": \"You are a helpful assist\",\n \"publish_status\": 1,\n \"status\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"sales\",\n \"conversation\": {\n \"background_color\": \"#FFFFFF\",\n \"background_image\": \"\",\n \"copyright\": \"\",\n \"enabled\": true,\n \"greeting_message\": \"\",\n \"guiding_questions\": [\n \"string\"\n ],\n \"recommended_related_questions_prompt\": \"\",\n \"show_answer_source\": true,\n \"show_answer_source_data\": true,\n \"text_color\": \"#000000\"\n },\n \"description\": \"You are a helpful assist\",\n \"icon\": \"https://example.com/analysis-icon.png\",\n \"llm\": {\n \"completion_params\": {\n \"max_memory\": 2048,\n \"max_memory_num\": 5,\n \"max_tokens\": 2048,\n \"temperature\": 0.7\n },\n \"model_name\": \"qwen2.5-72b-instruct\",\n \"model_provider\": \"aliyun\"\n },\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"orchestration\": {\n \"instruction\": {\n \"enabled\": true,\n \"rewriting_count\": 3,\n \"rewriting_prompt\": \"rewriting prompt\"\n },\n \"knowledge_list\": [\n {\n \"folders\": [\n {\n \"folder_id\": \"xxx\",\n \"name\": \"xxx\"\n }\n ],\n \"knowledge_id\": \"631506272047205\"\n }\n ],\n \"tools\": [\n {\n \"tool_apis\": [\n {\n \"api_id\": \"631506271514745\"\n }\n ],\n \"tool_id\": \"631506271912031\"\n },\n {\n \"tool_id\": \"631506271912032\",\n \"tool_llm\": {\n \"llm_id\": \"631506271514746\"\n }\n }\n ],\n \"voice\": {\n \"enabled\": false,\n \"input_enabled\": false,\n \"output_enabled\": false\n }\n },\n \"prompt\": \"You are a helpful assist\",\n \"publish_status\": 1,\n \"status\": 1\n}"
response = http.request(request)
puts response.read_body{
"created_at": 123,
"updated_at": 123,
"org_id": "<string>",
"user_id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"mode": "<string>",
"icon": "<string>",
"description": "<string>",
"category": "<string>",
"prompt": "<string>",
"status": 123,
"publish_status": 123,
"orchestration": {
"instruction": {
"enabled": true,
"rewriting_count": 2,
"rewriting_prompt": "<string>"
},
"knowledge_tools_mode": "smart",
"knowledge_list": [
{
"knowledge_id": "<string>",
"dataset_id": "<string>",
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"folders": [
{
"folder_id": "<string>",
"name": "<string>"
}
]
}
],
"tools": [
{
"description": "Updated tool description",
"icon": "https://example.com/icon.png",
"name": "Updated Tool Name",
"status": 2,
"tool_llm": {
"description": "Updated llm tool description",
"icon": "https://example.com/icon.png",
"name": "Updated llm Tool Name",
"params": [
{
"description": "content",
"key": "content",
"required": true,
"test_data": "蛇年小蛇绕树枝"
}
],
"prompt": "你是一位英语翻译专家,请翻译如下内容,{content}"
}
}
],
"voice": {
"enabled": false,
"input_enabled": false,
"output_enabled": false
},
"multi_mode": "<string>",
"member_agents": [
{}
],
"recursion_limit": 25,
"intent_enabled": false,
"intent_prompt": "<string>"
},
"llm": {
"model_provider": "<string>",
"model_name": "<string>",
"completion_params": {
"temperature": 0.1,
"max_tokens": 2048,
"max_memory": 2048,
"max_memory_num": 5,
"stop_sequences": [
"<string>"
]
},
"model_description": "<string>"
},
"conversation": {
"enabled": true,
"greeting_message": "",
"guiding_questions": [
"<string>"
],
"copyright": "",
"background_color": "rgba(0, 114, 255, 0.10)",
"text_color": "#313D4F",
"background_image": "",
"show_answer_source": false,
"show_answer_source_data": false,
"recommend_related_questions": true,
"recommended_related_questions_prompt": ""
},
"created_by": "<string>",
"permission_types": [],
"message_count": 0
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
Body
application/json
Response
Successful Response
Agent read model
