example

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL