summaryrefslogtreecommitdiff
path: root/libpanto/src/config.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-15 17:08:00 -0600
committert <t@tjp.lol>2026-06-15 17:18:20 -0600
commit9f8719929dbd1326d9b327885c4da319c6d2673c (patch)
treecb7cd72f0be46c099e9831364ba7d5cbedebeb09 /libpanto/src/config.zig
parentd9d4131cb321a9ce29b000cd7aed8ced9a18efc1 (diff)
anthropic credentials in oauth providers (eg copilot)
Diffstat (limited to 'libpanto/src/config.zig')
-rw-r--r--libpanto/src/config.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpanto/src/config.zig b/libpanto/src/config.zig
index 7c8a495..f2f04e7 100644
--- a/libpanto/src/config.zig
+++ b/libpanto/src/config.zig
@@ -122,6 +122,11 @@ pub const AnthropicMessagesConfig = struct {
/// between tool calls. Ignored when `thinking == .adaptive` (interleaving
/// is automatic there) or `.disabled`.
thinking_interleaved: bool = false,
+ /// Use `Authorization: Bearer ...` instead of `x-api-key`. This is set
+ /// by the embedder from the configured auth family (not guessed from the
+ /// base URL): standard Anthropic uses `false`, while OAuth-backed
+ /// Anthropic-compatible providers such as Copilot set `true`.
+ use_bearer_auth: bool = false,
/// Place one `cache_control` breakpoint on the last cacheable block of
/// each request, replicating Anthropic's "automatic caching" (a single
/// advancing breakpoint) via the broadly-supported per-block marker
@@ -344,6 +349,7 @@ test "ProviderConfig - anthropic_messages variant" {
try t.expectEqual(APIStyle.anthropic_messages, cfg.style());
try t.expectEqualStrings("2023-06-01", cfg.anthropic_messages.api_version);
try t.expectEqual(@as(u32, 64_000), cfg.anthropic_messages.max_tokens);
+ try t.expectEqual(false, cfg.anthropic_messages.use_bearer_auth);
try t.expectEqual(Thinking.disabled, cfg.anthropic_messages.thinking);
try t.expectEqual(Effort.medium, cfg.anthropic_messages.effort);
try t.expectEqual(@as(?u32, 32_000), cfg.anthropic_messages.thinking_budget_tokens);