Salt la conținut
Documentație

Caută în documentație

    English

    Ghid rapid

    Pune o întrebare propriei instalări și citește răspunsul, cu fișierul pe care se sprijină.

    Pe această pagină

    Ai nevoie de adresa de bază a instalării tale, de un token API și de acces la un spațiu de cunoștințe. Parcurge întâi Autentificare. Cererile folosesc $RDC_BASE_URL, adresa propriei instalări, și $RDC_TOKEN din mediu.

    Alege un spațiu

    Listează spațiile vizibile clientului tău. Păstrează id‑ul spațiului care conține fișierele căutate. Identificatorii cererilor de mai jos provin din înregistrările returnate; folosește identificatorii primiți de la instalarea ta.

    curl

    curl "$RDC_BASE_URL/private-ai/v1/spaces?limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/spaces?limit=20`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/private-ai/v1/spaces?limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/spaces?limit=20');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/private-ai/v1/spaces?limit=20");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 200

    {
      "items": [
        {
          "id": "warehouse",
          "name": "Warehouse",
          "permissionSource": "directory",
          "lastSync": "2026-11-23T06:00:00Z"
        },
        {
          "id": "finance",
          "name": "Finance",
          "permissionSource": "directory",
          "lastSync": "2026-11-23T06:00:00Z"
        }
      ],
      "nextCursor": null
    }

    Verifică fișierele și modelul

    Citește documentele și alege un fișier indexat din spațiul tău. Fișierele în așteptare și cele în curs de indexare nu sunt încă disponibile căutării; cele eșuate cer corectarea cauzei raportate. Administratorul atribuie echipei tale un model încărcat.

    curl

    curl "$RDC_BASE_URL/private-ai/v1/documents?limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/documents?limit=20`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/private-ai/v1/documents?limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/documents?limit=20');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/private-ai/v1/documents?limit=20");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 200

    {
      "items": [
        {
          "id": "doc-procedure",
          "spaceId": "warehouse",
          "title": "Receiving procedure",
          "status": "ready",
          "revision": 1,
          "readable": true,
          "attempt": 1,
          "error": null
        },
        {
          "id": "doc-scan",
          "spaceId": "warehouse",
          "title": "Receiving checklist",
          "status": "failed",
          "revision": 1,
          "readable": false,
          "attempt": 1,
          "error": "unreadable_file"
        },
        {
          "id": "doc-delivery",
          "spaceId": "warehouse",
          "title": "Delivery instructions",
          "status": "ready",
          "revision": 1,
          "readable": true,
          "attempt": 1,
          "error": null
        },
        {
          "id": "doc-finance",
          "spaceId": "finance",
          "title": "Payment review",
          "status": "ready",
          "revision": 1,
          "readable": true,
          "attempt": 1,
          "error": null
        }
      ],
      "nextCursor": null
    }

    Trimite întrebarea

    Creează un UUID pentru operationId și folosește expectedRevision 0 pentru conversația nouă. Trimite spaceId, modelId și întrebarea. Adaugă antetul Prefer: wait=10 ca să primești conversația încheiată în răspuns, dacă modelul e destul de rapid; fără el, răspunsul 202 confirmă doar acceptarea și citești operația.

    curl

    curl -X POST "$RDC_BASE_URL/private-ai/v1/chat" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "8a000001-0000-4000-8000-000000000001",
      "expectedRevision": 0,
      "spaceId": "warehouse",
      "modelId": "model-primary",
      "question": "What do we do with damaged goods at receiving?"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/chat`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "8a000001-0000-4000-8000-000000000001",
        "expectedRevision": 0,
        "spaceId": "warehouse",
        "modelId": "model-primary",
        "question": "What do we do with damaged goods at receiving?"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/private-ai/v1/chat',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '8a000001-0000-4000-8000-000000000001',
            'expectedRevision': 0,
            'spaceId': 'warehouse',
            'modelId': 'model-primary',
            'question': 'What do we do with damaged goods at receiving?',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "8a000001-0000-4000-8000-000000000001",
      "expectedRevision": 0,
      "spaceId": "warehouse",
      "modelId": "model-primary",
      "question": "What do we do with damaged goods at receiving?"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/chat');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
            'Content-Type: application/json',
        ],
        CURLOPT_POSTFIELDS => $body,
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/private-ai/v1/chat");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "8a000001-0000-4000-8000-000000000001",
      "expectedRevision": 0,
      "spaceId": "warehouse",
      "modelId": "model-primary",
      "question": "What do we do with damaged goods at receiving?"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 202

    {
      "operationId": "8a000001-0000-4000-8000-000000000001",
      "status": "completed",
      "aggregateId": "8a000002-0000-4000-8000-000000000001",
      "aggregateRevision": 1,
      "chat": {
        "id": "8a000002-0000-4000-8000-000000000001",
        "revision": 1,
        "spaceId": "warehouse",
        "modelId": "model-primary",
        "question": "What do we do with damaged goods at receiving?",
        "status": "answered",
        "path": [
          "received",
          "authorized",
          "retrieved",
          "drafted",
          "answered"
        ],
        "answer": "Photograph the damaged goods, move them to the quarantine bay and report them to the supplier within one working day.",
        "citations": [
          {
            "documentId": "doc-procedure",
            "title": "Receiving procedure",
            "locator": "Section 4, Damaged goods",
            "passage": "Damaged goods are photographed, moved to the quarantine bay and reported to the supplier within one working day."
          }
        ],
        "documentIds": [
          "doc-procedure"
        ],
        "code": null
      }
    }

    Urmărește operația

    Dacă răspunsul nu a venit odată cu 202, citește operația după operationId trimis. Cât timp este accepted, așteaptă înainte de următoarea verificare. completed arată că rezultatul conversației este disponibil la aggregateId; rejected poartă un cod stabil. După expirare, repetă cererea identică cu operationId inițial.

    curl

    curl "$RDC_BASE_URL/private-ai/v1/operations/8a000001-0000-4000-8000-000000000001" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/operations/8a000001-0000-4000-8000-000000000001`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/private-ai/v1/operations/8a000001-0000-4000-8000-000000000001',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/operations/8a000001-0000-4000-8000-000000000001');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/private-ai/v1/operations/8a000001-0000-4000-8000-000000000001");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 200

    {
      "operationId": "8a000001-0000-4000-8000-000000000001",
      "status": "completed",
      "aggregateId": "8a000002-0000-4000-8000-000000000001",
      "aggregateRevision": 1
    }

    Citește rezultatul

    Citește conversația folosind aggregateId. Înregistrarea answered conține răspunsul și citările lui: fișierul, secțiunea și pasajul pe care se sprijină. Când niciun fișier accesibil nu răspunde la întrebare, înregistrarea este answered, fără răspuns și fără citare. Înregistrarea refused nu are răspuns și indică motivul în code. Corectează accesul, indexarea ori starea modelului înainte de o întrebare nouă.

    curl

    curl "$RDC_BASE_URL/private-ai/v1/chat/8a000002-0000-4000-8000-000000000001" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/chat/8a000002-0000-4000-8000-000000000001`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/private-ai/v1/chat/8a000002-0000-4000-8000-000000000001',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/chat/8a000002-0000-4000-8000-000000000001');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/private-ai/v1/chat/8a000002-0000-4000-8000-000000000001");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 200

    {
      "id": "8a000002-0000-4000-8000-000000000001",
      "revision": 1,
      "spaceId": "warehouse",
      "modelId": "model-primary",
      "question": "What do we do with damaged goods at receiving?",
      "status": "answered",
      "path": [
        "received",
        "authorized",
        "retrieved",
        "drafted",
        "answered"
      ],
      "answer": "Photograph the damaged goods, move them to the quarantine bay and report them to the supplier within one working day.",
      "citations": [
        {
          "documentId": "doc-procedure",
          "title": "Receiving procedure",
          "locator": "Section 4, Damaged goods",
          "passage": "Damaged goods are photographed, moved to the quarantine bay and reported to the supplier within one working day."
        }
      ],
      "documentIds": [
        "doc-procedure"
      ],
      "code": null
    }

    Continuă cu Abonamente și Verificări înainte de producție.