上游鉴权头:按当前 provider 的 auth_style 装 x-api-key / bearer / both。 deepseek 未设 → 默认 x-api-key(保持原状);relay = both。
()
| 342 | |
| 343 | |
| 344 | def _upstream_auth_headers(): |
| 345 | """上游鉴权头:按当前 provider 的 auth_style 装 x-api-key / bearer / both。 |
| 346 | deepseek 未设 → 默认 x-api-key(保持原状);relay = both。""" |
| 347 | style = PROV.get("auth_style", "x-api-key") |
| 348 | h = {} |
| 349 | if style in ("x-api-key", "both"): |
| 350 | h["x-api-key"] = KEY |
| 351 | if style in ("bearer", "both"): |
| 352 | h["Authorization"] = f"Bearer {KEY}" |
| 353 | return h |
| 354 | |
| 355 | |
| 356 | def fetch_relay_models(): |
no outgoing calls
no test coverage detected