Documentation
¶
Index ¶
- func CallGrok(systemPrompt, userPrompt string) (string, error)
- func CallGrokConv(systemPrompt, userPrompt, convID string) (string, error)
- func CallGrokConvParts(systemPrompt string, parts []ContentPart, convID string) (string, error)
- type ContentPart
- type GrokMessage
- type GrokRequest
- type GrokResponse
- type ImageURL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallGrokConv ¶
CallGrokConv is like CallGrok but sets the x-grok-conv-id header so requests sharing a conv ID route to the same server, maximizing prompt cache hits on a constant system prompt.
func CallGrokConvParts ¶
func CallGrokConvParts(systemPrompt string, parts []ContentPart, convID string) (string, error)
CallGrokConvParts sends a multimodal user message (text + images).
Types ¶
type ContentPart ¶
type GrokMessage ¶
GrokMessage is a chat message. Content is either a string or []ContentPart.
type GrokRequest ¶
type GrokRequest struct {
Model string `json:"model"`
ReasoningEffort string `json:"reasoning_effort"`
Messages []GrokMessage `json:"messages"`
}
type GrokResponse ¶
type GrokResponse struct {
Choices []struct {
Message struct {
Content string `json:"content"`
} `json:"message"`
} `json:"choices"`
}