Documentation
¶
Index ¶
Constants ¶
const APIKeyEnvVar = "GROK_API_KEY"
APIKeyEnvVar is the environment variable name for the API key
Variables ¶
This section is empty.
Functions ¶
func ChatExample ¶
func ChatExample()
ChatExample demonstrates a basic chat completion request using the X.AI API It shows how to initialize a client, create a request, and process the response
func ImageGenerationExample ¶
func ImageGenerationExample()
ImageGenerationExample demonstrates how to use the image generation API. It shows how to create image generation requests and handle the response.
func StreamingChatExample ¶
func StreamingChatExample()
StreamingChatExample demonstrates how to use the streaming API for chat completions It shows how to establish a streaming connection and process chunks of the response as they arrive
func ToolsExample ¶
func ToolsExample()
ToolsExample demonstrates how to use function tools with the chat completion API. It shows how to define tools, create tool-enabled requests, and handle tool call responses.
Types ¶
This section is empty.