vapi_client/models/update_custom_knowledge_base_dto.rs
1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use utoipa::OpenApi;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
18pub struct UpdateCustomKnowledgeBaseDto {
19 /// This is where the knowledge base request will be sent. Request Example: POST https://{server.url} Content-Type: application/json { \"messsage\": { \"type\": \"knowledge-base-request\", \"messages\": [ { \"role\": \"user\", \"content\": \"Why is ocean blue?\" } ], ...other metadata about the call... } } Response Expected: ``` { \"message\": { \"role\": \"assistant\", \"content\": \"The ocean is blue because water absorbs everything but blue.\", }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK \"documents\": [ { \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\", \"similarity\": 1 }, { \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\", \"similarity\": .5 } ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL } ```
20 #[serde(rename = "server", skip_serializing_if = "Option::is_none")]
21 pub server: Option<models::Server>,
22}
23
24impl UpdateCustomKnowledgeBaseDto {
25 pub fn new() -> UpdateCustomKnowledgeBaseDto {
26 UpdateCustomKnowledgeBaseDto { server: None }
27 }
28}