edgequake-sdk 0.3.0

Rust SDK for the EdgeQuake RAG platform
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Chat resource.

use crate::client::EdgeQuakeClient;
use crate::error::Result;
use crate::types::chat::*;

pub struct ChatResource<'a> {
    pub(crate) client: &'a EdgeQuakeClient,
}

impl<'a> ChatResource<'a> {
    /// `POST /api/v1/chat/completions`
    pub async fn completions(&self, req: &ChatCompletionRequest) -> Result<ChatCompletionResponse> {
        self.client
            .post("/api/v1/chat/completions", Some(req))
            .await
    }
}