LegalStack

База знаний

Полнотекстовый и векторный поиск, граф знаний.

Рассчитать аналитику

POST
/api/v1/knowledge/analytics/compute
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/analytics/compute"
{
  "property1": null,
  "property2": null
}

Список баз знаний

GET
/api/v1/knowledge/bases
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X GET "https://loading/api/v1/knowledge/bases"
[
  {
    "createdAt": "string",
    "createdBy": "string",
    "description": "string",
    "folderId": "string",
    "id": "string",
    "name": "string",
    "teamId": "string",
    "property1": null,
    "property2": null
  }
]

Создать базу знаний

POST
/api/v1/knowledge/bases
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/bases" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "createdAt": "string",
  "createdBy": "string",
  "description": "string",
  "folderId": "string",
  "id": "string",
  "name": "string",
  "teamId": "string",
  "property1": null,
  "property2": null
}

Получить базу знаний

GET
/api/v1/knowledge/bases/{baseId}
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/knowledge/bases/string"
{
  "createdAt": "string",
  "createdBy": "string",
  "description": "string",
  "folderId": "string",
  "id": "string",
  "name": "string",
  "teamId": "string",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Обновить базу знаний

PATCH
/api/v1/knowledge/bases/{baseId}
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X PATCH "https://loading/api/v1/knowledge/bases/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "createdAt": "string",
  "createdBy": "string",
  "description": "string",
  "folderId": "string",
  "id": "string",
  "name": "string",
  "teamId": "string",
  "property1": null,
  "property2": null
}

Удалить базу знаний

DELETE
/api/v1/knowledge/bases/{baseId}
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело ответа

application/json

curl -X DELETE "https://loading/api/v1/knowledge/bases/string"
{
  "ok": true
}

Список источников базы знаний

GET
/api/v1/knowledge/bases/{baseId}/sources
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело ответа

application/json

curl -X GET "https://loading/api/v1/knowledge/bases/string/sources"
[
  {
    "chunkCount": 0,
    "createdAt": "string",
    "errorMessage": "string",
    "fileSize": 0,
    "id": "string",
    "knowledgeBaseId": "string",
    "mimeType": "string",
    "name": "string",
    "processedAt": "string",
    "status": "string",
    "type": "string",
    "url": "string",
    "property1": null,
    "property2": null
  }
]

Добавить источник из файла

POST
/api/v1/knowledge/bases/{baseId}/sources/file
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело запроса

multipart/form-data

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

application/problem+json

curl -X POST "https://loading/api/v1/knowledge/bases/string/sources/file" \  -F file="string"
{
  "chunkCount": 0,
  "createdAt": "string",
  "errorMessage": "string",
  "fileSize": 0,
  "id": "string",
  "knowledgeBaseId": "string",
  "mimeType": "string",
  "name": "string",
  "processedAt": "string",
  "status": "string",
  "type": "string",
  "url": "string",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Добавить несколько источников из файлов

POST
/api/v1/knowledge/bases/{baseId}/sources/files
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело запроса

multipart/form-data

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

application/problem+json

curl -X POST "https://loading/api/v1/knowledge/bases/string/sources/files" \  -F files="[    \"string\"  ]"
{
  "errors": [
    {
      "error": "string",
      "name": "string"
    }
  ],
  "sources": [
    {
      "chunkCount": 0,
      "createdAt": "string",
      "errorMessage": "string",
      "fileSize": 0,
      "id": "string",
      "knowledgeBaseId": "string",
      "mimeType": "string",
      "name": "string",
      "processedAt": "string",
      "status": "string",
      "type": "string",
      "url": "string",
      "property1": null,
      "property2": null
    }
  ]
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Добавить источник из текста

POST
/api/v1/knowledge/bases/{baseId}/sources/text
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/bases/string/sources/text" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "text": "string"  }'
{
  "chunkCount": 0,
  "createdAt": "string",
  "errorMessage": "string",
  "fileSize": 0,
  "id": "string",
  "knowledgeBaseId": "string",
  "mimeType": "string",
  "name": "string",
  "processedAt": "string",
  "status": "string",
  "type": "string",
  "url": "string",
  "property1": null,
  "property2": null
}

Добавить источник по URL

POST
/api/v1/knowledge/bases/{baseId}/sources/url
АвторизацияBearer <токен>

В: header

Параметры пути

baseId*string

Идентификатор базы знаний

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/bases/string/sources/url" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "url": "http://example.com"  }'
{
  "chunkCount": 0,
  "createdAt": "string",
  "errorMessage": "string",
  "fileSize": 0,
  "id": "string",
  "knowledgeBaseId": "string",
  "mimeType": "string",
  "name": "string",
  "processedAt": "string",
  "status": "string",
  "type": "string",
  "url": "string",
  "property1": null,
  "property2": null
}

Список сообществ

GET
/api/v1/knowledge/communities
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X GET "https://loading/api/v1/knowledge/communities"
[
  {
    "id": "string",
    "summary": "string",
    "property1": null,
    "property2": null
  }
]

Определить и описать сообщества

POST
/api/v1/knowledge/communities/detect
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/communities/detect"
[
  {
    "id": "string",
    "summary": "string",
    "property1": null,
    "property2": null
  }
]

Text-to-Cypher запрос (вопрос на естественном языке)

POST
/api/v1/knowledge/cypher
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

question*string

Вопрос к графу знаний на естественном языке

Тело ответа

application/json

application/problem+json

curl -X POST "https://loading/api/v1/knowledge/cypher" \  -H "Content-Type: application/json" \  -d '{    "question": "string"  }'
{
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Граф знаний команды

GET
/api/v1/knowledge/graph
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X GET "https://loading/api/v1/knowledge/graph"
{
  "edges": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "nodes": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "property1": null,
  "property2": null
}

Поиск по базе знаний

POST
/api/v1/knowledge/search
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/search" \  -H "Content-Type: application/json" \  -d '{    "query": "string"  }'
{
  "results": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "property1": null,
  "property2": null
}

Получить источник

GET
/api/v1/knowledge/sources/{sourceId}
АвторизацияBearer <токен>

В: header

Параметры пути

sourceId*string

Идентификатор источника

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/knowledge/sources/string"
{
  "chunkCount": 0,
  "createdAt": "string",
  "errorMessage": "string",
  "fileSize": 0,
  "id": "string",
  "knowledgeBaseId": "string",
  "mimeType": "string",
  "name": "string",
  "processedAt": "string",
  "status": "string",
  "type": "string",
  "url": "string",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Удалить источник

DELETE
/api/v1/knowledge/sources/{sourceId}
АвторизацияBearer <токен>

В: header

Параметры пути

sourceId*string

Идентификатор источника

Тело ответа

application/json

curl -X DELETE "https://loading/api/v1/knowledge/sources/string"
{
  "ok": true
}

Получить чанки источника

GET
/api/v1/knowledge/sources/{sourceId}/chunks
АвторизацияBearer <токен>

В: header

Параметры пути

sourceId*string

Идентификатор источника

Тело ответа

application/json

curl -X GET "https://loading/api/v1/knowledge/sources/string/chunks"
[
  {
    "id": "string",
    "text": "string",
    "property1": null,
    "property2": null
  }
]

Переобработать источник

POST
/api/v1/knowledge/sources/{sourceId}/reprocess
АвторизацияBearer <токен>

В: header

Параметры пути

sourceId*string

Идентификатор источника

Тело ответа

application/json

curl -X POST "https://loading/api/v1/knowledge/sources/string/reprocess"
{
  "chunkCount": 0,
  "createdAt": "string",
  "errorMessage": "string",
  "fileSize": 0,
  "id": "string",
  "knowledgeBaseId": "string",
  "mimeType": "string",
  "name": "string",
  "processedAt": "string",
  "status": "string",
  "type": "string",
  "url": "string",
  "property1": null,
  "property2": null
}