curl --request PATCH \
--url https://api.langdock.com/agent/v1/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"instruction": "<string>",
"emoji": "<string>",
"model": "<string>",
"creativity": 0.5,
"conversationStarters": [
"<string>"
],
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requiresConfirmation": true
}
],
"inputFields": [
{
"slug": "<string>",
"label": "<string>",
"order": 1,
"description": "<string>",
"required": false,
"options": [],
"fileTypes": "<string>",
"emailDomain": "<string>"
}
],
"webSearch": true,
"imageGeneration": true,
"dataAnalyst": true,
"extendedThinking": true,
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"knowledgeFolderIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.langdock.com/agent/v1/update"
payload = {
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"instruction": "<string>",
"emoji": "<string>",
"model": "<string>",
"creativity": 0.5,
"conversationStarters": ["<string>"],
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requiresConfirmation": True
}
],
"inputFields": [
{
"slug": "<string>",
"label": "<string>",
"order": 1,
"description": "<string>",
"required": False,
"options": [],
"fileTypes": "<string>",
"emailDomain": "<string>"
}
],
"webSearch": True,
"imageGeneration": True,
"dataAnalyst": True,
"extendedThinking": True,
"attachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"knowledgeFolderIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
instruction: '<string>',
emoji: '<string>',
model: '<string>',
creativity: 0.5,
conversationStarters: ['<string>'],
actions: [{actionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', requiresConfirmation: true}],
inputFields: [
{
slug: '<string>',
label: '<string>',
order: 1,
description: '<string>',
required: false,
options: [],
fileTypes: '<string>',
emailDomain: '<string>'
}
],
webSearch: true,
imageGeneration: true,
dataAnalyst: true,
extendedThinking: true,
attachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
knowledgeFolderIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.langdock.com/agent/v1/update', 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.langdock.com/agent/v1/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'instruction' => '<string>',
'emoji' => '<string>',
'model' => '<string>',
'creativity' => 0.5,
'conversationStarters' => [
'<string>'
],
'actions' => [
[
'actionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'requiresConfirmation' => true
]
],
'inputFields' => [
[
'slug' => '<string>',
'label' => '<string>',
'order' => 1,
'description' => '<string>',
'required' => false,
'options' => [
],
'fileTypes' => '<string>',
'emailDomain' => '<string>'
]
],
'webSearch' => true,
'imageGeneration' => true,
'dataAnalyst' => true,
'extendedThinking' => true,
'attachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'knowledgeFolderIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.langdock.com/agent/v1/update"
payload := strings.NewReader("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instruction\": \"<string>\",\n \"emoji\": \"<string>\",\n \"model\": \"<string>\",\n \"creativity\": 0.5,\n \"conversationStarters\": [\n \"<string>\"\n ],\n \"actions\": [\n {\n \"actionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requiresConfirmation\": true\n }\n ],\n \"inputFields\": [\n {\n \"slug\": \"<string>\",\n \"label\": \"<string>\",\n \"order\": 1,\n \"description\": \"<string>\",\n \"required\": false,\n \"options\": [],\n \"fileTypes\": \"<string>\",\n \"emailDomain\": \"<string>\"\n }\n ],\n \"webSearch\": true,\n \"imageGeneration\": true,\n \"dataAnalyst\": true,\n \"extendedThinking\": true,\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"knowledgeFolderIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.langdock.com/agent/v1/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instruction\": \"<string>\",\n \"emoji\": \"<string>\",\n \"model\": \"<string>\",\n \"creativity\": 0.5,\n \"conversationStarters\": [\n \"<string>\"\n ],\n \"actions\": [\n {\n \"actionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requiresConfirmation\": true\n }\n ],\n \"inputFields\": [\n {\n \"slug\": \"<string>\",\n \"label\": \"<string>\",\n \"order\": 1,\n \"description\": \"<string>\",\n \"required\": false,\n \"options\": [],\n \"fileTypes\": \"<string>\",\n \"emailDomain\": \"<string>\"\n }\n ],\n \"webSearch\": true,\n \"imageGeneration\": true,\n \"dataAnalyst\": true,\n \"extendedThinking\": true,\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"knowledgeFolderIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/agent/v1/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instruction\": \"<string>\",\n \"emoji\": \"<string>\",\n \"model\": \"<string>\",\n \"creativity\": 0.5,\n \"conversationStarters\": [\n \"<string>\"\n ],\n \"actions\": [\n {\n \"actionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requiresConfirmation\": true\n }\n ],\n \"inputFields\": [\n {\n \"slug\": \"<string>\",\n \"label\": \"<string>\",\n \"order\": 1,\n \"description\": \"<string>\",\n \"required\": false,\n \"options\": [],\n \"fileTypes\": \"<string>\",\n \"emailDomain\": \"<string>\"\n }\n ],\n \"webSearch\": true,\n \"imageGeneration\": true,\n \"dataAnalyst\": true,\n \"extendedThinking\": true,\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"knowledgeFolderIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Agent updated successfully",
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"instruction": "<string>",
"emojiIcon": "<string>",
"model": "<string>",
"temperature": 0.5,
"conversationStarters": [
"<string>"
],
"inputType": "PROMPT",
"webSearchEnabled": true,
"imageGenerationEnabled": true,
"canvasEnabled": true,
"extendedThinking": true,
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requiresConfirmation": true
}
],
"inputFields": [
{
"type": "TEXT",
"label": "<string>",
"description": "<string>",
"required": true,
"order": 1
}
],
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"knowledgeFolderIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"preservedUnavailableActionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Agent Update API
Einen vorhandenen Agenten programmatisch aktualisieren
curl --request PATCH \
--url https://api.langdock.com/agent/v1/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"instruction": "<string>",
"emoji": "<string>",
"model": "<string>",
"creativity": 0.5,
"conversationStarters": [
"<string>"
],
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requiresConfirmation": true
}
],
"inputFields": [
{
"slug": "<string>",
"label": "<string>",
"order": 1,
"description": "<string>",
"required": false,
"options": [],
"fileTypes": "<string>",
"emailDomain": "<string>"
}
],
"webSearch": true,
"imageGeneration": true,
"dataAnalyst": true,
"extendedThinking": true,
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"knowledgeFolderIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.langdock.com/agent/v1/update"
payload = {
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"instruction": "<string>",
"emoji": "<string>",
"model": "<string>",
"creativity": 0.5,
"conversationStarters": ["<string>"],
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requiresConfirmation": True
}
],
"inputFields": [
{
"slug": "<string>",
"label": "<string>",
"order": 1,
"description": "<string>",
"required": False,
"options": [],
"fileTypes": "<string>",
"emailDomain": "<string>"
}
],
"webSearch": True,
"imageGeneration": True,
"dataAnalyst": True,
"extendedThinking": True,
"attachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"knowledgeFolderIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
instruction: '<string>',
emoji: '<string>',
model: '<string>',
creativity: 0.5,
conversationStarters: ['<string>'],
actions: [{actionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', requiresConfirmation: true}],
inputFields: [
{
slug: '<string>',
label: '<string>',
order: 1,
description: '<string>',
required: false,
options: [],
fileTypes: '<string>',
emailDomain: '<string>'
}
],
webSearch: true,
imageGeneration: true,
dataAnalyst: true,
extendedThinking: true,
attachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
knowledgeFolderIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.langdock.com/agent/v1/update', 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.langdock.com/agent/v1/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'instruction' => '<string>',
'emoji' => '<string>',
'model' => '<string>',
'creativity' => 0.5,
'conversationStarters' => [
'<string>'
],
'actions' => [
[
'actionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'requiresConfirmation' => true
]
],
'inputFields' => [
[
'slug' => '<string>',
'label' => '<string>',
'order' => 1,
'description' => '<string>',
'required' => false,
'options' => [
],
'fileTypes' => '<string>',
'emailDomain' => '<string>'
]
],
'webSearch' => true,
'imageGeneration' => true,
'dataAnalyst' => true,
'extendedThinking' => true,
'attachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'knowledgeFolderIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.langdock.com/agent/v1/update"
payload := strings.NewReader("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instruction\": \"<string>\",\n \"emoji\": \"<string>\",\n \"model\": \"<string>\",\n \"creativity\": 0.5,\n \"conversationStarters\": [\n \"<string>\"\n ],\n \"actions\": [\n {\n \"actionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requiresConfirmation\": true\n }\n ],\n \"inputFields\": [\n {\n \"slug\": \"<string>\",\n \"label\": \"<string>\",\n \"order\": 1,\n \"description\": \"<string>\",\n \"required\": false,\n \"options\": [],\n \"fileTypes\": \"<string>\",\n \"emailDomain\": \"<string>\"\n }\n ],\n \"webSearch\": true,\n \"imageGeneration\": true,\n \"dataAnalyst\": true,\n \"extendedThinking\": true,\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"knowledgeFolderIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.langdock.com/agent/v1/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instruction\": \"<string>\",\n \"emoji\": \"<string>\",\n \"model\": \"<string>\",\n \"creativity\": 0.5,\n \"conversationStarters\": [\n \"<string>\"\n ],\n \"actions\": [\n {\n \"actionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requiresConfirmation\": true\n }\n ],\n \"inputFields\": [\n {\n \"slug\": \"<string>\",\n \"label\": \"<string>\",\n \"order\": 1,\n \"description\": \"<string>\",\n \"required\": false,\n \"options\": [],\n \"fileTypes\": \"<string>\",\n \"emailDomain\": \"<string>\"\n }\n ],\n \"webSearch\": true,\n \"imageGeneration\": true,\n \"dataAnalyst\": true,\n \"extendedThinking\": true,\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"knowledgeFolderIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/agent/v1/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instruction\": \"<string>\",\n \"emoji\": \"<string>\",\n \"model\": \"<string>\",\n \"creativity\": 0.5,\n \"conversationStarters\": [\n \"<string>\"\n ],\n \"actions\": [\n {\n \"actionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requiresConfirmation\": true\n }\n ],\n \"inputFields\": [\n {\n \"slug\": \"<string>\",\n \"label\": \"<string>\",\n \"order\": 1,\n \"description\": \"<string>\",\n \"required\": false,\n \"options\": [],\n \"fileTypes\": \"<string>\",\n \"emailDomain\": \"<string>\"\n }\n ],\n \"webSearch\": true,\n \"imageGeneration\": true,\n \"dataAnalyst\": true,\n \"extendedThinking\": true,\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"knowledgeFolderIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Agent updated successfully",
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"instruction": "<string>",
"emojiIcon": "<string>",
"model": "<string>",
"temperature": 0.5,
"conversationStarters": [
"<string>"
],
"inputType": "PROMPT",
"webSearchEnabled": true,
"imageGenerationEnabled": true,
"canvasEnabled": true,
"extendedThinking": true,
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requiresConfirmation": true
}
],
"inputFields": [
{
"type": "TEXT",
"label": "<string>",
"description": "<string>",
"required": true,
"order": 1
}
],
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"knowledgeFolderIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"preservedUnavailableActionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Bevor du startest
- API-Key-Scope: Erfordert einen API-Schlüssel mit dem Agenten API-Scope und Zugriff auf den Agenten, den du aktualisieren möchtest.
- Veraltete Assistants API: Dies ist die neue Agents API mit nativer Vercel AI SDK Kompatibilität. Wenn du die veraltete Assistants API verwendest, siehe den Migrations-Guide.
- Nur Entwurf: Änderungen werden nur auf den Entwurf des Agenten angewendet. Die aktive (veröffentlichte) Version bleibt unverändert, bis der Agent in der Langdock-Oberfläche veröffentlicht wird. Die Antwort dieses Endpoints gibt den Entwurf zurück.
Basis-URL
https://api.langdock.com/agent/v1/update
api.langdock.com durch <your-deployment-url>/api/public in allen Anfragen.Aktualisierungsverhalten
Der Update-Endpunkt verwendet partielle Update-Semantik mit spezifischem Verhalten für verschiedene Feldtypen:- Partielle Updates - Nur in der Anfrage enthaltene Felder werden aktualisiert; ausgelassene Felder bleiben unverändert
- Array-Felder ersetzen -
actions,inputFields,conversationStarters,attachmentsundknowledgeFolderIdsersetzen bei Angabe vollständig die vorhandenen Werte - Leere Arrays - Sende
[]um alle Actions/Felder/Anhänge zu entfernen - Null-Behandlung - Sende
nullfüremojium es zu löschen. Fürdescriptionundinstructionsende einen leeren String""zum Löschen - Unveränderte Felder - Felder, die nicht in der Anfrage enthalten sind, behalten ihre aktuellen Werte
Parameter
Setze einen der folgenden Parameter, um die aktuellen Einstellungen des Agenten zu überschreiben. Felder, die du weglässt, bleiben unverändert. NuragentId ist erforderlich.
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
agentId | string | Ja | UUID des zu aktualisierenden Agenten |
name | string | Nein | Name des Agenten (1-80 Zeichen) |
description | string | Nein | Beschreibung (max. 800 Zeichen, "" zum Löschen) |
emoji | string | Nein | Emoji-Icon (max. 16 Zeichen, null zum Löschen) |
instruction | string | Nein | Systemanweisung (max. 50000 Zeichen, "" zum Löschen) |
model | string | Nein | id von der Models API. Eindeutige Namen und Anthropic-Aliase bleiben gültig |
creativity | number | Nein | Temperatur zwischen 0 und 1 |
conversationStarters | string[] | Nein | Vorgeschlagene Prompts, max. 20, je 1-255 Zeichen (ersetzt vorhandene) |
actions | array | Nein | Actions (ersetzt vorhandene) |
inputFields | array | Nein | Formularfelder (ersetzt vorhandene) |
attachments | string[] | Nein | Bis zu 50 Anhang-UUIDs (ersetzt vorhandene) |
knowledgeFolderIds | string[] | Nein | Ordner-UUIDs (ersetzt vorhandene) |
webSearch | boolean | Nein | Websuche aktivieren |
imageGeneration | boolean | Nein | Bildgenerierung aktivieren |
dataAnalyst | boolean | Nein | Zur Kompatibilität akzeptiert. Siehe Warnhinweis unten |
inputType | string | Nein | Eingabetyp: “PROMPT”, “STRUCTURED”, “INTEGRATION”, “SCHEDULED” oder “WEBHOOK” |
extendedThinking | boolean | Nein | Extended Thinking aktivieren |
dataAnalyst ist veraltet und hat keine Wirkung. Anfragen mit diesem Parameter sind aus Gründen der Abwärtskompatibilität weiterhin erfolgreich, aber Langdock ignoriert den Wert und aktiviert weder Dateiarbeit noch Codeausführung. Lass diesen Parameter in neuen Integrationen weg.actions, inputFields, conversationStarters, attachments, knowledgeFolderIds) werden vollständig ersetzt, nicht zusammengeführt. Gib immer das vollständige gewünschte Array an, einschließlich aller vorhandenen Elemente, die du behalten möchtest.Actions-Konfiguration
Jede Action imactions Array sollte enthalten:
actionId(erforderlich) - UUID der ActionrequiresConfirmation(optional) - Ob vor der Ausführung eine Benutzerbestätigung erforderlich ist (Standard: true)
Eingabefelder-Konfiguration
Für dieinputFields Array-Struktur, siehe die Agent Create API Dokumentation.
Beispiele
Grundlegende Eigenschaften aktualisieren
const axios = require("axios");
async function updateAgentName() {
const response = await axios.patch(
"https://api.langdock.com/agent/v1/update",
{
agentId: "550e8400-e29b-41d4-a716-446655440000",
name: "Erweiterter Dokumentenanalyst",
description: "Analysiert Dokumente mit erweiterten Fähigkeiten",
creativity: 0.7
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Agent aktualisiert:", response.data.message);
}
Validierungsregeln
Die API wendet mehrere Validierungsregeln an:- Agent-Zugriff - Dein API-Schlüssel muss Zugriff auf den Agenten haben
- Workspace-Übereinstimmung - Der Agent muss zum selben Workspace wie dein API-Schlüssel gehören
- Modell - Falls angegeben, muss es in der Liste der aktiven Modelle deines Workspaces sein
- Actions - Falls angegeben, ersetzt das Array die Liste im Entwurf. Lass eine ID weg, um sie zu entfernen.
- Action-IDs im Entwurf - Fehlende oder gelöschte IDs, die schon im Entwurf stehen, werden weggelassen. Nicht verfügbare IDs, die schon im Entwurf stehen, bleiben.
- Neue Action-IDs - Müssen existieren und zu in deinem Workspace aktivierten Integrationen gehören. Sonst antwortet die Anfrage mit 400 und
missingActionIdsoderunavailableActionIds. - Anhänge - Falls angegeben, müssen sie in deinem Workspace existieren und nicht gelöscht sein
- Ordner - Falls angegeben, müssen sie in deinem Workspace existieren und nicht gelöscht sein
- Name - Falls angegeben, muss zwischen 1-80 Zeichen sein
- Beschreibung - Falls angegeben, maximal 800 Zeichen
- Instruktion - Falls angegeben, maximal 50000 Zeichen
- Creativity - Falls angegeben, muss zwischen 0 und 1 liegen
Antwortformat
Erfolgreiche Antwort (200 OK)
{
status: "success";
message: "Agent updated successfully";
agent: {
id: string;
name: string;
description: string | null;
instruction: string | null;
emojiIcon: string | null;
model: string | null;
temperature: number;
conversationStarters: string[];
inputType: "PROMPT" | "STRUCTURED" | "INTEGRATION" | "SCHEDULED" | "WEBHOOK";
webSearchEnabled: boolean;
imageGenerationEnabled: boolean;
canvasEnabled: boolean;
extendedThinking: boolean;
actions: Array<{
actionId: string;
requiresConfirmation: boolean;
}>;
inputFields: Array<{
type: "TEXT" | "MULTI_LINE_TEXT" | "NUMBER" | "CHECKBOX" | "FILE" | "SELECT" | "MULTI_SELECT" | "DATE" | "EMAIL";
label: string;
description: string | null;
required: boolean;
order: number;
}>;
attachments: string[];
knowledgeFolderIds: string[];
owner: {
id: string;
name: string | null;
email: string;
} | null;
createdAt: string;
updatedAt: string;
};
preservedUnavailableActionIds?: string[];
}
preservedUnavailableActionIds ist nur enthalten, wenn die Anfrage nicht verfügbare IDs behalten hat, die schon im Entwurf standen.
Fehlerbehandlung
try {
const response = await axios.patch('https://api.langdock.com/agent/v1/update', ...);
} catch (error) {
if (error.response) {
switch (error.response.status) {
case 400:
console.error('Ungültige Parameter oder Ressource nicht gefunden:', error.response.data.message);
break;
case 401:
console.error('Ungültiger oder fehlender API-Schlüssel');
break;
case 403:
console.error('Unzureichende Berechtigungen - kein Zugriff auf diesen Agenten');
break;
case 404:
console.error('Agent nicht gefunden oder API-Schlüssel hat keinen Zugriff');
break;
case 429:
console.error('Rate Limit überschritten');
break;
case 500:
console.error('Server-Fehler');
break;
}
}
}
Best Practices
actions oder attachments aktualisierst, füge immer vorhandene Elemente ein, die du behalten möchtest, da das gesamte Array ersetzt wird.- Vor dem Update abrufen - Wenn du vorhandene Array-Werte beibehalten musst, rufe den Agenten zuerst ab. GET gibt die veröffentlichte Version zurück, wenn eine existiert, sonst den Entwurf.
- Inkrementelle Updates - Aktualisiere nur die Felder, die geändert werden müssen
- Anhänge validieren - Stelle sicher, dass Anhang-UUIDs gültig sind, bevor du sie einfügst
- Actions im Entwurf behalten - Schicke jede Action-ID mit, die du behalten willst. Fehlende IDs, die schon im Entwurf stehen, werden weggelassen. Nicht verfügbare IDs, die schon im Entwurf stehen, bleiben.
- Fehler elegant behandeln - Implementiere eine ordnungsgemäße Fehlerbehandlung für Validierungsfehler
Autorisierungen
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Body
Name of the agent or assistant
1 - 80Description of what the agent or assistant does. Send an empty string to clear it during an update.
800System prompt or instructions. Send an empty string to clear it during an update.
50000Input type
PROMPT, STRUCTURED, INTEGRATION, SCHEDULED, WEBHOOK Emoji icon
16id from GET /agent/v1/models. Unique deployment names and Anthropic aliases stay valid. When several accessible rows share a name, send the UUID id.
Temperature for response generation
0 <= x <= 1Suggested prompts
201 - 255Actions that the agent or assistant can use. On update, the array replaces the draft list.
Show child attributes
Show child attributes
Form fields for STRUCTURED input
Show child attributes
Show child attributes
Enable web search
Enable image generation
Deprecated. Accepted for compatibility and ignored.
Enable extended thinking
Attachment UUIDs
50Folder UUIDs
Antwort
Agent updated successfully
War diese Seite hilfreich?