Documentation ¶
Index ¶
Constants ¶
View Source
const ApiBaseUrl = "https://generativelanguage.googleapis.com"
View Source
const ApiVersion = "v1beta"
View Source
const ChatMessageRoleAssistant = "model"
View Source
const ChatMessageRoleSystem = "user"
View Source
const ChatMessageRoleUser = "user"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct { Content Content `json:"content"` FinishReason string `json:"finishReason"` Index int `json:"index"` SafetyRatings []SafetyRating `json:"safetyRatings"` }
type Client ¶
type Client struct { ApiBaseUrl string ApiVersion string ApiKey string Model string SafetySettings []SafetySetting }
func (*Client) CreateChatCompletion ¶
func (c *Client) CreateChatCompletion(contents []Content) (*ResponseBody, error)
func (*Client) CreateImageCompletion ¶
func (c *Client) CreateImageCompletion(contents []Content) (*ResponseBody, error)
type InlineData ¶
type Part ¶
type Part struct { Text string `json:"text,omitempty"` InlineData InlineData `json:"inline_data,omitempty"` }
type RequestBody ¶
type RequestBody struct { Contents []Content `json:"contents"` SafetySettings []SafetySetting `json:"safetySettings"` }
type ResponseBody ¶
type ResponseBody struct { Candidates []Candidate `json:"candidates"` Error Error `json:"error"` PromptFeedback struct { BlockReason string `json:"blockReason"` SafetyRatings []SafetyRating `json:"safetyRatings"` } `json:"promptFeedback"` }
type SafetyRating ¶
type SafetySetting ¶
Click to show internal directories.
Click to hide internal directories.