Documentation ¶
Index ¶
- func GenerateContentGemini(ctx context.Context, modelName string, cfg Config, w io.Writer, ...) error
- func UseClaudeModel(ctx context.Context, modelName string, cfg Config, args []string) error
- func UseGeminiModel(ctx context.Context, modelName string, cfg Config, args []string) error
- func UsePaLMModel(ctx context.Context, modelName string, cfg Config, args []string) error
- type AnthropicContent
- type AnthropicMessage
- type AnthropicRequest
- type AnthropicResponse
- type AnthropicUsage
- type CitationMetadata
- type Config
- type ConfigBuilder
- func (b *ConfigBuilder) Build() (Config, error)
- func (b *ConfigBuilder) ConfigFile(configFile string) *ConfigBuilder
- func (b *ConfigBuilder) Describe() string
- func (b *ConfigBuilder) LogType(logType string) *ConfigBuilder
- func (b *ConfigBuilder) OutputType(outputType string) *ConfigBuilder
- func (b *ConfigBuilder) ProjectID(p string) *ConfigBuilder
- func (b *ConfigBuilder) RegionID(r string) *ConfigBuilder
- type Metadata
- type Model
- type PaLMResponse
- type Prediction
- type SafetyAttributes
- type SafetyRating
- type TokenMetadata
- type TokenMetadataDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateContentGemini ¶
func GenerateContentGemini(ctx context.Context, modelName string, cfg Config, w io.Writer, parts []genai.Part) error
GenerateContentGemini calls Gemini's generate content method
func UseClaudeModel ¶
TODO - Add documentation for function
func UseGeminiModel ¶
UseGeminiModel calls Gemini's generate content method
Types ¶
type AnthropicContent ¶
type AnthropicContent struct { Text string `json:"text,omitempty"` Type string `json:"type,omitempty"` }
AnthropicContent is the content of a message to the Claude model.
type AnthropicMessage ¶
type AnthropicMessage struct { Content []AnthropicContent `json:"content,omitempty"` Role string `json:"role,omitempty"` }
AnthropicMessage is a message to the Claude model.
type AnthropicRequest ¶
type AnthropicRequest struct { AnthropicVersion string `json:"anthropic_version,omitempty"` MaxTokens int `json:"max_tokens,omitempty"` Messages []AnthropicMessage `json:"messages,omitempty"` Stream bool `json:"stream,omitempty"` TopP float32 `json:"top_p,omitempty"` TopK int `json:"top_k,omitempty"` Temperature float32 `json:"temperature,omitempty"` }
AnthropicRequest is the request to the Claude model.
type AnthropicResponse ¶
type AnthropicResponse struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Role string `json:"role,omitempty"` Content []AnthropicContent `json:"content,omitempty"` Model string `json:"model,omitempty"` StopReason string `json:"stop_reason,omitempty"` StopSequence string `json:"stop_sequence,omitempty"` Usage AnthropicUsage `json:"usage,omitempty"` }
AnthropicResponse is the response from the Claude model.
type AnthropicUsage ¶
type AnthropicUsage struct { InputTokens int `json:"input_tokens,omitempty"` OutputTokens int `json:"output_tokens,omitempty"` }
TODO - Add documentation for type
type CitationMetadata ¶
type CitationMetadata struct {
Citations []interface{} `json:"citations"`
}
type Config ¶
type Config struct { ProjectID string RegionID string ConfigFile string LogType string OutputType string }
func (Config) ReadModelConfigFile ¶
readModelConfigFile reads the model configuration file (JSON text file)
type ConfigBuilder ¶
type ConfigBuilder struct {
// contains filtered or unexported fields
}
func (*ConfigBuilder) Build ¶
func (b *ConfigBuilder) Build() (Config, error)
func (*ConfigBuilder) ConfigFile ¶
func (b *ConfigBuilder) ConfigFile(configFile string) *ConfigBuilder
func (*ConfigBuilder) Describe ¶
func (b *ConfigBuilder) Describe() string
func (*ConfigBuilder) LogType ¶
func (b *ConfigBuilder) LogType(logType string) *ConfigBuilder
TODO - Need to document allowed values and validate input
func (*ConfigBuilder) OutputType ¶
func (b *ConfigBuilder) OutputType(outputType string) *ConfigBuilder
TODO - Need to document allowed values and validate input
func (*ConfigBuilder) ProjectID ¶
func (b *ConfigBuilder) ProjectID(p string) *ConfigBuilder
func (*ConfigBuilder) RegionID ¶
func (b *ConfigBuilder) RegionID(r string) *ConfigBuilder
TODO - Need to document allowed values and validate input
type Metadata ¶
type Metadata struct {
TokenMetadata TokenMetadata `json:"tokenMetadata"`
}
type Model ¶
type Model struct { Family string `json:"family"` Mode string `json:"mode"` Name string `json:"name"` // contains filtered or unexported fields }
A Model sends prompts to a specific GenAI model using an Endpoint location, where the model is enabled and billed
type PaLMResponse ¶
type PaLMResponse struct { Predictions []Prediction `json:"predictions"` Metadata Metadata `json:"metadata"` }
PaLMResponse is the response from the PaLM model.
type Prediction ¶
type Prediction struct { CitationMetadata CitationMetadata `json:"citationMetadata,omitempty"` Content string `json:"content,omitempty"` SafetyAttributes SafetyAttributes `json:"safetyAttributes,omitempty"` }
type SafetyAttributes ¶
type SafetyAttributes struct { Blocked bool `json:"blocked,omitempty"` Categories []string `json:"categories,omitempty"` SafetyRatings []SafetyRating `json:"safetyRatings,omitempty"` }
type SafetyRating ¶
type TokenMetadata ¶
type TokenMetadata struct { InputTokenCount TokenMetadataDetails `json:"inputTokenCount,omitempty"` OutputTokenCount TokenMetadataDetails `json:"outputTokenCount,omitempty"` }