MCPcopy Index your code
hub / github.com/coder/coder / newMessageWithKey

Method newMessageWithKey

aibridge/intercept/messages/blocking.go:356–362  ·  view source on GitHub ↗

newMessageWithKey performs a single upstream call.

(ctx context.Context, svc anthropic.MessageService, extraOpts ...option.RequestOption)

Source from the content-addressed store, hash-verified

354
355// newMessageWithKey performs a single upstream call.
356func (i *BlockingInterception) newMessageWithKey(ctx context.Context, svc anthropic.MessageService, extraOpts ...option.RequestOption) (_ *anthropic.Message, outErr error) {
357 _, span := i.tracer.Start(ctx, "Intercept.ProcessRequest.Upstream", trace.WithAttributes(tracing.InterceptionAttributesFromContext(ctx)...))
358 defer tracing.EndSpanErr(span, &outErr)
359
360 opts := append([]option.RequestOption{i.withBody()}, extraOpts...)
361 return svc.New(ctx, anthropic.MessageNewParams{}, opts...)
362}
363
364// newMessageWithKeyFailover walks the centralized key pool,
365// trying each key until one succeeds or the pool is exhausted.

Callers 2

newMessageMethod · 0.95

Calls 5

EndSpanErrFunction · 0.92
withBodyMethod · 0.80
StartMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected