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