Criar Base de Conhecimento
curl --request POST \
--url https://api.example.com/knowledge-basesimport requests
url = "https://api.example.com/knowledge-bases"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/knowledge-bases', 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.example.com/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/knowledge-bases"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/knowledge-bases")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/knowledge-bases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyBases de conhecimento
Criar Base de Conhecimento
Cria uma nova base de conhecimento.
POST
/
knowledge-bases
Criar Base de Conhecimento
curl --request POST \
--url https://api.example.com/knowledge-basesimport requests
url = "https://api.example.com/knowledge-bases"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/knowledge-bases', 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.example.com/knowledge-bases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/knowledge-bases"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/knowledge-bases")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/knowledge-bases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
Requer cabeçalho
###Interface de referência:
POST https://gateway.orkeia.ai/knowledge-bases
AutenticaçãoRequer cabeçalho
authorization: <seu_token>.
Request body
O serviço espera um wrapper comknowledgeBaseefilename.
{
"knowledgeBase": {
"name": "Políticas Internas",
"description": "Documentos corporativos oficiais",
"enabled": true,
"sectors": ["hr", "legal"],
"content": "https://storage.orkeia.ai/kb/policies.pdf",
"type": "file",
"multimodal": false,
"tags": ["compliance", "contracts"]
},
"filename": "policies.pdf"
}
Notas
- Para
type: "file", enviefilenamecorrespondente ao conteúdo armazenado.- Para
type: "url"outype: "text",filenamepode ser ignorado/ficar vazio, mas o campo existe no payload por consistência do endpoint.content:
file: caminho/URL de armazenamento do arquivo (ex.: S3/Storage).url: link público/privado a ser referenciado.text: conteúdo textual direto.
Exemplo (cURL)
curl -X POST "https://gateway.orkeia.ai/knowledge-bases" -H "Authorization: Bearer <seu_token>" -H "Content-Type: application/json" -d '{
"knowledgeBase": {
"name": "Políticas Internas",
"description": "Documentos corporativos oficiais",
"enabled": true,
"sectors": ["hr", "legal"],
"content": "https://storage.orkeia.ai/kb/policies.pdf",
"type": "file",
"multimodal": false,
"tags": ["compliance", "contracts"]
},
"filename": "policies.pdf",
}'
export interface KnowledgeBase {
id?: string;
name: string;
description: string;
enabled: boolean;
sectors: string[];
content: string;
type: 'file' | 'url' | 'text';
multimodal: boolean;
tags: string[];
}
| Nome | Tipo | Obrigatório | Descrição | Exemplo |
|---|---|---|---|---|
| id | string | Não | Identificador único da base de conhecimento (retornado pelo backend). | ”KB_123456” |
| name | string | Sim | Nome da base de conhecimento. | ”Políticas Internas” |
| description | string | Sim | Descrição breve do conteúdo/uso. | ”Documentos corporativos oficiais” |
| enabled | boolean | Sim | Indica se a base estará ativa no ambiente. | true |
| sectors | string[] | Sim | Setores que podem consumir essa base (governança de acesso). | [“hr”, “legal”] |
| content | string | Sim | Fonte do conteúdo: caminho/URL do arquivo, link externo, ou texto literal (conforme type). | “https://storage.orkeia.ai/kb/policies.pdf” |
| type | ”file” | “url” | “text” | Sim | Tipo do conteúdo. | ”file” |
| multimodal | boolean | Sim | Se a base contém modalidades além de texto (imagens/áudio/vídeo). | false |
| tags | string[] | Sim | Metadados/etiquetas para busca e organização. | [“compliance”,“contracts”] |
Respostas
Response - Success
response
{
"status": "OK",
"data": { "id": "KB_123456" }
}
500 — Bad Request
{
"status": "ERROR",
"code": "server/error",
"data": null
}
400 — Client Error
{
"status": "ERROR",
"code": "client/error",
"data": null
}
Esta página foi útil?
