MCPcopy Create free account
hub / github.com/coder/coder / generateResponsesPayload

Function generateResponsesPayload

aibridge/provider/openai_internal_test.go:155–165  ·  view source on GitHub ↗

generateResponsesPayload creates a JSON payload for the responses API with the specified number of input items. Input items alternate between user and assistant roles to simulate a conversation.

(payloadSize int, inputCount int, stream bool)

Source from the content-addressed store, hash-verified

153// generateResponsesPayload creates a JSON payload for the responses API with the specified number of input items.
154// Input items alternate between user and assistant roles to simulate a conversation.
155func generateResponsesPayload(payloadSize int, inputCount int, stream bool) []byte {
156 provider := &responsesProvider{}
157 inputs := generateConversation(provider, payloadSize, inputCount)
158
159 body := provider.buildRequestBody(provider.DefaultModel(), inputs, stream)
160 bodyBytes, err := json.Marshal(body)
161 if err != nil {
162 panic(err)
163 }
164 return bodyBytes
165}
166
167func TestOpenAI_TypeAndName(t *testing.T) {
168 t.Parallel()

Calls 4

buildRequestBodyMethod · 0.95
DefaultModelMethod · 0.95
generateConversationFunction · 0.70
MarshalMethod · 0.45

Tested by

no test coverage detected