Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct {
Content CandidateContent `json:"content"`
FinishReason string `json:"finishReason"`
FinishMessage string `json:"finishMessage"`
}
Candidate represents a single response candidate
type CandidateContent ¶
type CandidateContent struct {
Parts []Part `json:"parts"`
}
CandidateContent is the content of a candidate
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with the Vertex AI Gemini API
type ContentItem ¶
ContentItem holds a role and parts
type GenerationConfig ¶
type GenerationConfig struct {
ResponseMIMEType string `json:"responseMimeType"`
ResponseJSONSchema any `json:"responseJsonSchema,omitempty"`
}
GenerationConfig configures the generation
type Request ¶
type Request struct {
SystemInstruction *Content `json:"systemInstruction,omitempty"`
Contents []ContentItem `json:"contents"`
GenerationConfig GenerationConfig `json:"generationConfig"`
}
Request represents the Gemini API request
type Response ¶
type Response struct {
Candidates []Candidate `json:"candidates"`
UsageMetadata UsageMetadata `json:"usageMetadata"`
}
Response represents the Gemini API response
type UsageMetadata ¶
type UsageMetadata struct {
PromptTokenCount int `json:"promptTokenCount"`
CandidatesTokenCount int `json:"candidatesTokenCount"`
TotalTokenCount int `json:"totalTokenCount"`
}
UsageMetadata contains token usage information
Click to show internal directories.
Click to hide internal directories.