vertex_ai

package
v0.19.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(id, name string, v *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

Create 创建驱动实例

func NewChat

func NewChat(model string) convert.IChildConverter

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

NewFactory 创建service_http驱动工厂

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册驱动

Types

type Candidate

type Candidate struct {
	Content      Content `json:"content"`
	FinishReason string  `json:"finishReason"`
}

type Chat

type Chat struct {
	// contains filtered or unexported fields
}

func (*Chat) Endpoint

func (c *Chat) Endpoint() string

func (*Chat) RequestConvert

func (c *Chat) RequestConvert(ctx eocontext.EoContext, extender map[string]interface{}) error

func (*Chat) ResponseConvert

func (c *Chat) ResponseConvert(ctx eocontext.EoContext) error

type ClientRequest

type ClientRequest struct {
	Contents []*Content `json:"contents"`
}

type Config

type Config struct {
	ProjectID         string `json:"vertex_project_id"`
	Location          string `json:"vertex_location"`
	ServiceAccountKey string `json:"vertex_service_account_key"`
	Base              string `json:"vertex_api_base"`
}

type Content

type Content struct {
	Parts []map[string]interface{} `json:"parts"`
	Role  string                   `json:"role"`
}

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

func (*Converter) RequestConvert

func (c *Converter) RequestConvert(ctx eocontext.EoContext, extender map[string]interface{}) error

func (*Converter) ResponseConvert

func (c *Converter) ResponseConvert(ctx eocontext.EoContext) error

type FNewModelMode

type FNewModelMode func(string) convert.IChildConverter

type ModelConfig

type ModelConfig struct {
	MaxOutputTokens  int     `json:"max_tokens"`
	Temperature      float64 `json:"temperature"`
	FrequencyPenalty float64 `json:"frequency_penalty"`
	PresencePenalty  float64 `json:"presence_penalty"`
	TopP             float64 `json:"top_p"`
	TopK             int     `json:"top_k"`
}

type Response

type Response struct {
	Candidates []Candidate `json:"candidates"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL