1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2025 Michael Dippery <michael@monkey-robot.com>
//! Services for communicating with AI service providers over HTTP.
//!
//! [`Service`] acts as a proxy for an AI service provider's API (often
//! implemented as a REST API). As an implementation-agnostic definition
//! of a service, it allows consumers to implement a single API client
//! that can communicate with the AI using various mechanisms. In
//! particular, it provides an easy way to "mock" an API client's
//! HTTP functionality in testing by providing a mocked `Service`
//! implementation for an API client under test, or an actual HTTP
//! client when the API client is used in production.
//!
//! # See Also
//!
//! - [`hypertyper.service`] for an example of how to use `Service` to mock
//! HTTP calls.
//!
//! [`hypertyper.service`]: https://docs.rs/hypertyper/latest/hypertyper/service/index.html
pub use Auth;
use *;
use header;
use Serialize;
use DeserializeOwned;
/// A concrete implementation of an HTTP API service.
///
/// This is the "default" service used by most AI API clients. It more or
/// less just wraps a Reqwest client, making it easier to swap out the
/// service for a deterministic service when writing tests. Most AI API
/// clients should use this `Service` by default.