newMessage routes between BYOK (single attempt) and centralized failover.
(ctx context.Context, svc anthropic.MessageService)
| 345 | // newMessage routes between BYOK (single attempt) and centralized |
| 346 | // failover. |
| 347 | func (i *BlockingInterception) newMessage(ctx context.Context, svc anthropic.MessageService) (*anthropic.Message, error) { |
| 348 | // BYOK: single attempt, no failover. |
| 349 | if i.cfg.KeyPool == nil { |
| 350 | return i.newMessageWithKey(ctx, svc) |
| 351 | } |
| 352 | return i.newMessageWithKeyFailover(ctx, svc) |
| 353 | } |
| 354 | |
| 355 | // newMessageWithKey performs a single upstream call. |
| 356 | func (i *BlockingInterception) newMessageWithKey(ctx context.Context, svc anthropic.MessageService, extraOpts ...option.RequestOption) (_ *anthropic.Message, outErr error) { |
no test coverage detected