Commit a5513dc
add user-agent header to inference requests (#1150)
This PR updates the inference client to include a user-agent header in
outgoing API requests.
The value is derived from the `name` and `version` of the inference
package, e.g. `@huggingface/[email protected]`
This will allow third-party inference providers to identify API requests
that originate from HF's new inference integration.
See https://huggingface.co/blog/inference-providers
cc @julien-c @SBrandeis
---------
Co-authored-by: coyotte508 <[email protected]>
Co-authored-by: Simon Brandeis <[email protected]>1 parent 7508458 commit a5513dc
File tree
3 files changed
+10
-2
lines changed- packages/inference
- src/lib
- test
3 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments