Documentation
¶
Index ¶
- Constants
- Variables
- type ModelGenerator
- func (g *ModelGenerator) Generate(ctx context.Context, ...) (*ai.ModelResponse, error)
- func (g *ModelGenerator) WithConfig(config any) *ModelGenerator
- func (g *ModelGenerator) WithMessages(messages []*ai.Message) *ModelGenerator
- func (g *ModelGenerator) WithTools(tools []*ai.ToolDefinition) *ModelGenerator
- type VolcEngine
Constants ¶
View Source
const (
// PluginName is the name of this plugin.
PluginName = "volcengine"
)
Variables ¶
View Source
var ( BasicText = &ai.ModelSupports{ Multiturn: true, Tools: true, ToolChoice: true, SystemRole: true, Media: false, Constrained: ai.ConstrainedSupportAll, } Multimodal = &ai.ModelSupports{ Multiturn: true, Tools: true, ToolChoice: true, SystemRole: true, Media: true, Constrained: ai.ConstrainedSupportNoTools, } )
Functions ¶
This section is empty.
Types ¶
type ModelGenerator ¶
type ModelGenerator struct {
// contains filtered or unexported fields
}
ModelGenerator handles VolcEngine generation requests
func NewModelGenerator ¶
func NewModelGenerator(client *arkruntime.Client, modelName string) *ModelGenerator
NewModelGenerator creates a new ModelGenerator instance
func (*ModelGenerator) Generate ¶
func (g *ModelGenerator) Generate(ctx context.Context, handleChunk func(context.Context, *ai.ModelResponseChunk) error) (*ai.ModelResponse, error)
Generate executes the generation request
func (*ModelGenerator) WithConfig ¶
func (g *ModelGenerator) WithConfig(config any) *ModelGenerator
WithConfig adds configuration parameters from the model request see https://www.volcengine.com/docs/82379/1494384 for more details on openai's request fields
func (*ModelGenerator) WithMessages ¶
func (g *ModelGenerator) WithMessages(messages []*ai.Message) *ModelGenerator
func (*ModelGenerator) WithTools ¶
func (g *ModelGenerator) WithTools(tools []*ai.ToolDefinition) *ModelGenerator
WithTools adds tools to the request
type VolcEngine ¶
type VolcEngine struct {
// contains filtered or unexported fields
}
VolcEngine is the Genkit go plugin for VolcEngine.
func VolcEngineWithAPIKey ¶
func VolcEngineWithAPIKey(apiKey string) *VolcEngine
func VolcEngineWithClient ¶
func VolcEngineWithClient(client *arkruntime.Client) *VolcEngine
func (*VolcEngine) DefineModel ¶
func (v *VolcEngine) DefineModel(id string, opts *ai.ModelOptions) ai.Model
func (*VolcEngine) Name ¶
func (v *VolcEngine) Name() string
Click to show internal directories.
Click to hide internal directories.