Zum Hauptinhalt springen
GET
/
assistant
/
v1
/
get
[Deprecated] Retrieves details of an existing assistant
curl --request GET \
  --url https://api.langdock.com/assistant/v1/get \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "assistant": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "emojiIcon": "<string>",
    "model": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "temperature": 0.5,
    "inputType": "PROMPT",
    "webSearchEnabled": true,
    "imageGenerationEnabled": true,
    "codeInterpreterEnabled": true,
    "canvasEnabled": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "instruction": "<string>",
    "conversationStarters": [
      "<string>"
    ],
    "actions": [
      {
        "actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "requiresConfirmation": true
      }
    ],
    "inputFields": [
      {
        "slug": "<string>",
        "type": "TEXT",
        "label": "<string>",
        "required": true,
        "order": 1,
        "description": "<string>",
        "options": [
          "<string>"
        ],
        "fileTypes": [
          "<string>"
        ]
      }
    ],
    "attachments": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ]
  }
}
Ruft die vollständige Konfiguration und Details eines vorhandenen Assistenten in deinem Workspace ab.
Erfordert einen API-Schlüssel mit dem AGENT_API Scope und Zugriff auf den Assistenten, den du abrufen möchtest.
Die Assistants API wird in einem zukünftigen Release eingestellt.Für neue Projekte empfehlen wir die Agents API. Die Agents API bietet native Vercel AI SDK Kompatibilität und entfernt benutzerdefinierte Transformationen.Siehe den Migrations-Guide für Details zu den Unterschieden.

Query-Parameter

ParameterTypErforderlichBeschreibung
assistantIdstringJaUUID des abzurufenden Assistenten

Beispiele

Einfacher Abruf

const axios = require("axios");

async function getAssistant() {
  const response = await axios.get(
    "https://api.langdock.com/assistant/v1/get",
    {
      params: {
        assistantId: "550e8400-e29b-41d4-a716-446655440000"
      },
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log("Assistenten-Details:", response.data.assistant);
}

Validierungsregeln

Die API wendet folgende Validierungsregeln an:
  • Assistenten-Zugriff - Dein API-Schlüssel muss Zugriff auf den Assistenten haben
  • Workspace-Übereinstimmung - Der Assistent muss zum selben Workspace wie dein API-Schlüssel gehören

Antwortformat

Erfolgreiche Antwort (200 OK)

{
  status: "success";
  assistant: {
    id: string;
    name: string;
    description: string;
    instruction: string;
    emojiIcon: string;
    model: string;
    temperature: number;
    conversationStarters: string[];
    inputType: "PROMPT" | "STRUCTURED";
    webSearchEnabled: boolean;
    imageGenerationEnabled: boolean;
    codeInterpreterEnabled: boolean;
    canvasEnabled: boolean;
    actions: Array<{
      actionId: string;
      requiresConfirmation: boolean;
    }>;
    inputFields: Array<{
      slug: string;
      type: string;
      label: string;
      description: string;
      required: boolean;
      order: number;
      options: string[];
      fileTypes: string[] | null;
    }>;
    attachments: string[];
    createdAt: string;
    updatedAt: string;
  };
}

Fehlerbehandlung

try {
  const response = await axios.get('https://api.langdock.com/assistant/v1/get', ...);
} catch (error) {
  if (error.response) {
    switch (error.response.status) {
      case 400:
        console.error('Ungültiges Assistenten-ID-Format');
        break;
      case 401:
        console.error('Ungültiger oder fehlender API-Schlüssel');
        break;
      case 403:
        console.error('Unzureichende Berechtigungen - kein Zugriff auf diesen Assistenten');
        break;
      case 404:
        console.error('Assistent nicht gefunden');
        break;
      case 500:
        console.error('Server-Fehler');
        break;
    }
  }
}

Migration zur Agents API

Die neue Agents API bietet verbesserte Kompatibilität mit modernen AI SDKs. Der Get-Endpunkt hat ähnliche Funktionalität mit aktualisierten Parameternamen. Siehe den entsprechenden Endpunkt in der Agents API:
Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu Best Practices für API-Schlüssel.

Autorisierungen

Authorization
string
header
erforderlich

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Abfrageparameter

assistantId
string<uuid>
erforderlich

UUID of the agent to retrieve

Antwort

Agent details retrieved successfully

status
enum<string>
erforderlich
Verfügbare Optionen:
success
assistant
object