-
Notifications
You must be signed in to change notification settings - Fork 525
Closed
Labels
Description
- I have looked for existing issues (including closed) about this
Feature Request
We should have a way to allow users to use their own generic HTTP client.
It will need two methods:
- Making a POST request
- Making a stream of items (... that then get mapped to rig's own stream item type)
Motivation
Better DX, integrate literally whatever HTTP client you want rather than having to use reqwest::Client
Proposal
Something like this (not intended to be the final implementation - the following code snippet is primarily a stub):
trait ModelClientExt {
type Response;
fn post<T>(&self, body: T) -> Self::Response;
fn post_streaming<T>(&self, body: T) -> SomeStreamingResponse;
fn post_ndjson(&self) -> SomeOtherStreamingResponse;
}