Documentation ¶
Index ¶
- Constants
- func Create(id, name string, v *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)
- func NewFactory() eosc.IExtenderDriverFactory
- func Register(register eosc.IExtenderDriverRegister)
- type Candidate
- type Chat
- type ClientRequest
- type Config
- type Content
- type Converter
- type Error
- type FNewModelMode
- type IModelMode
- type ModelConfig
- type ModelFactory
- type Response
- type UsageMetadata
Constants ¶
View Source
const ( FinishReasonUnspecified = "FINISH_REASON_UNSPECIFIED" FinishStop = "STOP" FinishMaxTokens = "MAX_TOKENS" FinishSafety = "SAFETY" FinishRecitation = "RECITATION" FinishLanguage = "LANGUAGE" FinishOther = "OTHER" FinishBlocklist = "BLOCKLIST" FinishProhibitedContent = "PROHIBITED_CONTENT" FinishSPII = "SPII" FinishMalformedFunctionCall = "MALFORMED_FUNCTION_CALL" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
func (*Chat) RequestConvert ¶
type ClientRequest ¶
type ClientRequest struct {
Contents []*Content `json:"contents"`
}
* 返回示例
{ "candidates": [ { "content": { "parts": [ { "text": "Hello there! How can I help you today?\n" } ], "role": "model" }, "finishReason": "STOP", "avgLogprobs": -0.0011556809768080711 } ], "usageMetadata": { "promptTokenCount": 2, "candidatesTokenCount": 11, "totalTokenCount": 13 }, "modelVersion": "gemini-1.5-flash-latest" }
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
func (*Converter) RequestConvert ¶
type FNewModelMode ¶
type FNewModelMode func(string) IModelMode
type IModelMode ¶
type IModelMode interface { Endpoint() string convert.IConverter }
func NewChat ¶
func NewChat(model string) IModelMode
type ModelConfig ¶
type ModelFactory ¶
type ModelFactory struct { }
type Response ¶
type Response struct { Candidates []Candidate `json:"candidates"` UsageMetadata UsageMetadata `json:"usageMetadata"` Error Error `json:"error"` }
type UsageMetadata ¶ added in v0.19.5
Click to show internal directories.
Click to hide internal directories.