pub struct Language(/* private fields */);
Expand description
APIs for /v1/language
endpoints.
Implementations§
Source§impl Language
impl Language
Sourcepub async fn list(&self) -> Result<RouterConfigs>
pub async fn list(&self) -> Result<RouterConfigs>
Retrieves a list of all router
configs.
GET /v1/language
§Errors
Returns an Error
if the response StatusCode
is not in the 200-299 range.
Sourcepub async fn chat(
&self,
router: &str,
data: ChatRequest,
) -> Result<ChatResponse>
pub async fn chat( &self, router: &str, data: ChatRequest, ) -> Result<ChatResponse>
Sends a single chat request to a specified router
and retrieves the response.
POST /v1/language/{router}/chat
§Errors
Returns an Error
if the response StatusCode
is not in the 200-299 range.
Sourcepub async fn stream(&self, router: &str) -> Result<Chat>
Available on crate feature streaming
only.
pub async fn stream(&self, router: &str) -> Result<Chat>
streaming
only.Establishes a WebSocket
connection for streaming chat messages from a specified router
.
GET /v1/language/{router}/chatStream
§Errors
Returns an Error
if the response StatusCode
is not in the 200-299 range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Language
impl !RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl !UnwindSafe for Language
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more