Skip to content

feat: generic HTTP client #838

@joshua-mo-143

Description

@joshua-mo-143
  • 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;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions