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

Function measureJSONSize

aibridge/provider/openai_internal_test.go:131–137  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

129}
130
131func measureJSONSize(v any) int {
132 data, err := json.Marshal(v)
133 if err != nil {
134 return 0
135 }
136 return len(data)
137}
138
139// generateChatCompletionsPayload creates a JSON payload with the specified number of messages.
140// Messages alternate between user and assistant roles to simulate a conversation.

Callers 1

generateConversationFunction · 0.70

Calls 1

MarshalMethod · 0.45

Tested by

no test coverage detected