Create Agent
curl --request POST \
--url https://api-spectra.duplik.cn/v1/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "sales",
"description": "advanced_single_agent use kb and other tools",
"icon": "https://example.com/chat-icon.png",
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"prompt": "You are a helpful assist"
}
'import requests
url = "https://api-spectra.duplik.cn/v1/agent"
payload = {
"category": "sales",
"description": "advanced_single_agent use kb and other tools",
"icon": "https://example.com/chat-icon.png",
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"prompt": "You are a helpful assist"
}
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',
description: 'advanced_single_agent use kb and other tools',
icon: 'https://example.com/chat-icon.png',
mode: 'advanced_single',
name: 'advanced_single_agent use kb and other tools',
prompt: 'You are a helpful assist'
})
};
fetch('https://api-spectra.duplik.cn/v1/agent', 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",
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',
'description' => 'advanced_single_agent use kb and other tools',
'icon' => 'https://example.com/chat-icon.png',
'mode' => 'advanced_single',
'name' => 'advanced_single_agent use kb and other tools',
'prompt' => 'You are a helpful assist'
]),
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"
payload := strings.NewReader("{\n \"category\": \"sales\",\n \"description\": \"advanced_single_agent use kb and other tools\",\n \"icon\": \"https://example.com/chat-icon.png\",\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"prompt\": \"You are a helpful assist\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"sales\",\n \"description\": \"advanced_single_agent use kb and other tools\",\n \"icon\": \"https://example.com/chat-icon.png\",\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"prompt\": \"You are a helpful assist\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/agent")
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 \"description\": \"advanced_single_agent use kb and other tools\",\n \"icon\": \"https://example.com/chat-icon.png\",\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"prompt\": \"You are a helpful assist\"\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
Create Agent
创建一个 Agent
POST
/
v1
/
agent
Create Agent
curl --request POST \
--url https://api-spectra.duplik.cn/v1/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "sales",
"description": "advanced_single_agent use kb and other tools",
"icon": "https://example.com/chat-icon.png",
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"prompt": "You are a helpful assist"
}
'import requests
url = "https://api-spectra.duplik.cn/v1/agent"
payload = {
"category": "sales",
"description": "advanced_single_agent use kb and other tools",
"icon": "https://example.com/chat-icon.png",
"mode": "advanced_single",
"name": "advanced_single_agent use kb and other tools",
"prompt": "You are a helpful assist"
}
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',
description: 'advanced_single_agent use kb and other tools',
icon: 'https://example.com/chat-icon.png',
mode: 'advanced_single',
name: 'advanced_single_agent use kb and other tools',
prompt: 'You are a helpful assist'
})
};
fetch('https://api-spectra.duplik.cn/v1/agent', 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",
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',
'description' => 'advanced_single_agent use kb and other tools',
'icon' => 'https://example.com/chat-icon.png',
'mode' => 'advanced_single',
'name' => 'advanced_single_agent use kb and other tools',
'prompt' => 'You are a helpful assist'
]),
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"
payload := strings.NewReader("{\n \"category\": \"sales\",\n \"description\": \"advanced_single_agent use kb and other tools\",\n \"icon\": \"https://example.com/chat-icon.png\",\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"prompt\": \"You are a helpful assist\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"sales\",\n \"description\": \"advanced_single_agent use kb and other tools\",\n \"icon\": \"https://example.com/chat-icon.png\",\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"prompt\": \"You are a helpful assist\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/agent")
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 \"description\": \"advanced_single_agent use kb and other tools\",\n \"icon\": \"https://example.com/chat-icon.png\",\n \"mode\": \"advanced_single\",\n \"name\": \"advanced_single_agent use kb and other tools\",\n \"prompt\": \"You are a helpful assist\"\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
Agent create model
Response
Successful Response
Agent read model
