Skip to main content
The Go SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

ChatResult

sendChatCompletionRequestResponse := operations.CreateSendChatCompletionRequestResponseChatResult(components.ChatResult{/* values here */})

sendChatCompletionRequestResponse := operations.CreateSendChatCompletionRequestResponseEventStream(*stream.EventStream[components.ChatStreamingResponse]{/* values here */})

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:
switch sendChatCompletionRequestResponse.Type {
	case operations.SendChatCompletionRequestResponseTypeChatResult:
		// sendChatCompletionRequestResponse.ChatResult is populated
	case operations.SendChatCompletionRequestResponseTypeEventStream:
		// sendChatCompletionRequestResponse.EventStream is populated
}