Criar/Editar Conhecimento do Agente
curl --request POST \
--url https://api.wppfy.com/knowledge/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "",
"delete": false,
"knowledge": {
"isActive": true,
"tittle": "Informações sobre a WppFy",
"content": "A WppFy foi originalmente desenvolvida..."
}
}
'import requests
url = "https://api.wppfy.com/knowledge/edit"
payload = {
"id": "",
"delete": False,
"knowledge": {
"isActive": True,
"tittle": "Informações sobre a WppFy",
"content": "A WppFy foi originalmente desenvolvida..."
}
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '',
delete: false,
knowledge: {
isActive: true,
tittle: 'Informações sobre a WppFy',
content: 'A WppFy foi originalmente desenvolvida...'
}
})
};
fetch('https://api.wppfy.com/knowledge/edit', 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.wppfy.com/knowledge/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'delete' => false,
'knowledge' => [
'isActive' => true,
'tittle' => 'Informações sobre a WppFy',
'content' => 'A WppFy foi originalmente desenvolvida...'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$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.wppfy.com/knowledge/edit"
payload := strings.NewReader("{\n \"id\": \"\",\n \"delete\": false,\n \"knowledge\": {\n \"isActive\": true,\n \"tittle\": \"Informações sobre a WppFy\",\n \"content\": \"A WppFy foi originalmente desenvolvida...\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
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.post("https://api.wppfy.com/knowledge/edit")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"\",\n \"delete\": false,\n \"knowledge\": {\n \"isActive\": true,\n \"tittle\": \"Informações sobre a WppFy\",\n \"content\": \"A WppFy foi originalmente desenvolvida...\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/knowledge/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"delete\": false,\n \"knowledge\": {\n \"isActive\": true,\n \"tittle\": \"Informações sobre a WppFy\",\n \"content\": \"A WppFy foi originalmente desenvolvida...\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "r1a2b3c4",
"active": false,
"tittle": "",
"content": "",
"vectorStatus": "",
"isVectorized": false,
"lastVectorizedAt": 0,
"owner": "",
"priority": 0,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}{
"id": "r1a2b3c4",
"active": false,
"tittle": "",
"content": "",
"vectorStatus": "",
"isVectorized": false,
"lastVectorizedAt": 0,
"owner": "",
"priority": 0,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}Conhecimento dos Agentes
Criar/Editar Conhecimento do Agente
Gerencia o conhecimento base usado pelos agentes de IA para responder consultas. O conhecimento pode ser fornecido como texto direto ou através de arquivos PDF/CSV.
Características principais:
- Suporta criação, edição e exclusão de conhecimento
- Aceita conteúdo em:
- Texto puro
- URLs públicas
- Base64 encoded de arquivos
- Upload direto de arquivos
- Formatos suportados: PDF, CSV, TXT, HTML
- Processa automaticamente qualquer formato de entrada
- Vetoriza automaticamente o conteúdo para busca semântica
Nota sobre URLs e Base64:
- URLs devem ser públicas e acessíveis
- Para PDFs/CSVs, especifique fileType se não for detectável da extensão
- Base64 deve incluir o encoding completo do arquivo
- O servidor detecta e processa automaticamente conteúdo Base64
POST
/
knowledge
/
edit
Criar/Editar Conhecimento do Agente
curl --request POST \
--url https://api.wppfy.com/knowledge/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "",
"delete": false,
"knowledge": {
"isActive": true,
"tittle": "Informações sobre a WppFy",
"content": "A WppFy foi originalmente desenvolvida..."
}
}
'import requests
url = "https://api.wppfy.com/knowledge/edit"
payload = {
"id": "",
"delete": False,
"knowledge": {
"isActive": True,
"tittle": "Informações sobre a WppFy",
"content": "A WppFy foi originalmente desenvolvida..."
}
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '',
delete: false,
knowledge: {
isActive: true,
tittle: 'Informações sobre a WppFy',
content: 'A WppFy foi originalmente desenvolvida...'
}
})
};
fetch('https://api.wppfy.com/knowledge/edit', 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.wppfy.com/knowledge/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'delete' => false,
'knowledge' => [
'isActive' => true,
'tittle' => 'Informações sobre a WppFy',
'content' => 'A WppFy foi originalmente desenvolvida...'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$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.wppfy.com/knowledge/edit"
payload := strings.NewReader("{\n \"id\": \"\",\n \"delete\": false,\n \"knowledge\": {\n \"isActive\": true,\n \"tittle\": \"Informações sobre a WppFy\",\n \"content\": \"A WppFy foi originalmente desenvolvida...\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
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.post("https://api.wppfy.com/knowledge/edit")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"\",\n \"delete\": false,\n \"knowledge\": {\n \"isActive\": true,\n \"tittle\": \"Informações sobre a WppFy\",\n \"content\": \"A WppFy foi originalmente desenvolvida...\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/knowledge/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"delete\": false,\n \"knowledge\": {\n \"isActive\": true,\n \"tittle\": \"Informações sobre a WppFy\",\n \"content\": \"A WppFy foi originalmente desenvolvida...\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "r1a2b3c4",
"active": false,
"tittle": "",
"content": "",
"vectorStatus": "",
"isVectorized": false,
"lastVectorizedAt": 0,
"owner": "",
"priority": 0,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}{
"id": "r1a2b3c4",
"active": false,
"tittle": "",
"content": "",
"vectorStatus": "",
"isVectorized": false,
"lastVectorizedAt": 0,
"owner": "",
"priority": 0,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}Autorizações
Corpo
application/json
Resposta
Conhecimento atualizado com sucesso
ID único gerado automaticamente
Exemplo:
"r1a2b3c4"
Indica se o conhecimento está ativo
Título do conhecimento
Conteúdo textual do conhecimento
Status da vetorização no sistema
Indica se o conteúdo foi vetorizado
Timestamp da última vetorização
Proprietário do conhecimento
Prioridade de uso do conhecimento
Data de criação
Data de atualização
