lib.rs 675 Bytes
Newer Older
Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
1
2
3
4
5
6
7
//! BLOOM Inference gRPC client library

mod client;
mod pb;
mod sharded_client;

pub use client::Client;
Olivier Dehaene's avatar
Olivier Dehaene committed
8
pub use pb::generate::v1::{Batch, GeneratedText, LogitsWarperParameters, Request};
Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
pub use sharded_client::ShardedClient;
use thiserror::Error;
pub use tonic::transport::Uri;
use tonic::Status;

#[derive(Error, Debug, Clone)]
#[error("Text generation client error: {msg:?}")]
pub struct ClientError {
    msg: String,
    // source: Status,
}

impl From<Status> for ClientError {
    fn from(err: Status) -> Self {
        Self {
            msg: err.to_string(),
            // source: err,
        }
    }
}

pub type Result<T> = std::result::Result<T, ClientError>;