hunyuan

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 NewFactory

func NewFactory() eosc.IExtenderDriverFactory

NewFactory 创建service_http驱动工厂

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册驱动

func Sign

func Sign(ctx http_service.IHttpContext, secretId string, secretKey string) error

Types

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 Choice

type Choice struct {
	FinishReason string  `json:"FinishReason"`
	Message      Message `json:"Message"`
}

type ClientRequest

type ClientRequest struct {
	Messages []*Message `json:"Messages"`
}

type Config

type Config struct {
	SecretID  string `json:"secret_id"`
	SecretKey string `json:"secret_key"`
}

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) IModelMode

type IModelMode

type IModelMode interface {
	Endpoint() string
	convert.IConverter
}

func NewChat

func NewChat(model string) IModelMode

type Message

type Message struct {
	Role    string `json:"Role"`
	Content string `json:"Content"`
}

type ModelConfig

type ModelConfig struct {
	Temperature   float64 `json:"temperature"`
	TopP          float64 `json:"top_p"`
	EnableEnhance bool    `json:"enable_enhance"`
}

type Response

type Response struct {
	Response *ResponseInfo `json:"Response"`
}

type ResponseInfo

type ResponseInfo struct {
	RequestId string `json:"RequestId"`
	Error     struct {
		Code    string `json:"Code"`
		Message string `json:"Message"`
	} `json:"Error"`
	Note    string   `json:"Note"`
	Choices []Choice `json:"Choices"`
	Created int      `json:"Created"`
	Id      string   `json:"Id"`
	Usage   Usage    `json:"Usage"`
}

type Usage

type Usage struct {
	PromptTokens     int `json:"PromptTokens"`
	CompletionTokens int `json:"CompletionTokens"`
	TotalTokens      int `json:"TotalTokens"`
}

Jump to

Keyboard shortcuts

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