pub struct CustomKnowledgeBase {
pub provider: Provider,
pub server: Server,
pub id: String,
pub org_id: String,
}Fields§
§provider: ProviderThis knowledge base is bring your own knowledge base implementation.
server: ServerThis 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 }
id: StringThis is the id of the knowledge base.
org_id: StringThis is the org id of the knowledge base.
Implementations§
Trait Implementations§
Source§impl Clone for CustomKnowledgeBase
impl Clone for CustomKnowledgeBase
Source§fn clone(&self) -> CustomKnowledgeBase
fn clone(&self) -> CustomKnowledgeBase
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more