#[async_trait::async_trait]
pub trait DeveloperKnowledge: std::fmt::Debug + Send + Sync {
async fn search_document_chunks(
&self,
req: crate::model::SearchDocumentChunksRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::SearchDocumentChunksResponse>>;
async fn get_document(
&self,
req: crate::model::GetDocumentRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::Document>>;
async fn batch_get_documents(
&self,
req: crate::model::BatchGetDocumentsRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::BatchGetDocumentsResponse>>;
async fn answer_query(
&self,
req: crate::model::AnswerQueryRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::AnswerQueryResponse>>;
}
#[async_trait::async_trait]
impl<T: super::DeveloperKnowledge> DeveloperKnowledge for T {
async fn search_document_chunks(
&self,
req: crate::model::SearchDocumentChunksRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::SearchDocumentChunksResponse>> {
T::search_document_chunks(self, req, options).await
}
async fn get_document(
&self,
req: crate::model::GetDocumentRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::Document>> {
T::get_document(self, req, options).await
}
async fn batch_get_documents(
&self,
req: crate::model::BatchGetDocumentsRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::BatchGetDocumentsResponse>> {
T::batch_get_documents(self, req, options).await
}
async fn answer_query(
&self,
req: crate::model::AnswerQueryRequest,
options: crate::RequestOptions,
) -> crate::Result<crate::Response<crate::model::AnswerQueryResponse>> {
T::answer_query(self, req, options).await
}
}