MCPcopy Create free account
hub / github.com/coder/aibridge / TestBasicAndMetadata

Function TestBasicAndMetadata

intercept/actor_headers_test.go:38–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestBasicAndMetadata(t *testing.T) {
39 t.Parallel()
40
41 actorID := uuid.NewString()
42 actor := &context.Actor{
43 ID: actorID,
44 Metadata: recorder.Metadata{
45 "This": "That",
46 "And": "The other",
47 },
48 }
49
50 // We can't peek inside since these opts require an internal type to apply onto.
51 // All we can do is check the length.
52 // See TestActorHeaders for an integration test.
53 oaiOpts := intercept.ActorHeadersAsOpenAIOpts(actor)
54 require.Len(t, oaiOpts, 1+len(actor.Metadata))
55 antOpts := intercept.ActorHeadersAsAnthropicOpts(actor)
56 require.Len(t, antOpts, 1+len(actor.Metadata))
57}

Callers

nothing calls this directly

Calls 2

ActorHeadersAsOpenAIOptsFunction · 0.92

Tested by

no test coverage detected