async_llm/request/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pub mod chat;
pub mod message;

pub use chat::ChatRequest;
pub use message::ChatMessage;

pub trait Requestable {
    fn stream(&self) -> bool;
}

impl Requestable for serde_json::Value {
    fn stream(&self) -> bool {
        match self.get("stream") {
            Some(stream) => match stream {
                serde_json::Value::Bool(v) => v.to_owned(),
                _ => false,
            },
            None => false,
        }
    }
}