Knowledge Bases
Creates a Knowledge Base Chat Response for the given Messages.
Totoy API
Explanation
Knowledge Bases
- GETReturns a list of Knowledge Bases.
- POSTCreates a Knowledge Base.
- GETRetrieves a Knowledge Base.
- DELDeletes a Knowledge Base.
- PATCHModifies a Knowledge Base.
- POSTCreates a Knowledge Base Chat Response for the given Messages.
- GETReturns a list of Knowledge Base Sources.
- POSTAdds Sources to a Knowledge Base.
- GETRetrieves a Knowledge Base Source.
- DELRemoves a Knowledge Base Source from a Knowledge Base.
Sources
Projects
Organization
Knowledge Bases
Creates a Knowledge Base Chat Response for the given Messages.
POST
/
knowledge-bases
/
{knowledge_base_id}
/
chat
curl --request POST \
--url https://api.totoy.ai/v1/knowledge-bases/{knowledge_base_id}/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"output_language": "en",
"language_level": "plain",
"markdown_response": true,
"messages": [
{
"role": "user",
"content": "Who are the co-founders of Totoy?"
}
]
}'
{
"project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
"output_language": "en",
"language_level": "plain",
"answer": {
"role": "assistant",
"content": "Hi!\nThe co-founders of Totoy are Benedikt Hielscher, Francis Rafal, Marcel Koller, Michael Perger and Simon Hoffmann.[R1]",
"references": [
{
"text": "[R1]",
"source_id": "src_oXiYDg8QOc9JsOk86idRXiywD",
"page_number": 5,
"backlink": "https://www.totoy.ai/totoy-company-overview.pdf",
"custom_metadata": {
"internal_tag": "general_documents"
}
}
]
},
"knowledge_base_id": "kb_feMfJbeqbAEj4u8K5HqmKpUbY",
"markdown_response": true
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Unique identifier for a Knowledge Base
.
Maximum length:
28
Body
application/json
Response
200
application/json
OK
The response is of type object
.
curl --request POST \
--url https://api.totoy.ai/v1/knowledge-bases/{knowledge_base_id}/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"output_language": "en",
"language_level": "plain",
"markdown_response": true,
"messages": [
{
"role": "user",
"content": "Who are the co-founders of Totoy?"
}
]
}'
{
"project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
"output_language": "en",
"language_level": "plain",
"answer": {
"role": "assistant",
"content": "Hi!\nThe co-founders of Totoy are Benedikt Hielscher, Francis Rafal, Marcel Koller, Michael Perger and Simon Hoffmann.[R1]",
"references": [
{
"text": "[R1]",
"source_id": "src_oXiYDg8QOc9JsOk86idRXiywD",
"page_number": 5,
"backlink": "https://www.totoy.ai/totoy-company-overview.pdf",
"custom_metadata": {
"internal_tag": "general_documents"
}
}
]
},
"knowledge_base_id": "kb_feMfJbeqbAEj4u8K5HqmKpUbY",
"markdown_response": true
}