minimax

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 11 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 注册驱动

Types

type BaseResp added in v0.19.5

type BaseResp struct {
	StatusCode int    `json:"status_code"`
	StatusMsg  string `json:"status_msg"`
}

type Chat

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

func NewChat

func NewChat() *Chat

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 {
	Messages []*Message `json:"messages"`
}

* 返回示例

{
    "id": "03c13c50d5d579fc940572bb6fdf6f0a",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "message": {
                "content": "I’m a language model, so I can answer questions about language, or about the world.",
                "role": "assistant",
                "name": "MM智能助理",
                "audio_content": ""
            }
        }
    ],
    "created": 1735526736,
    "model": "abab6.5s-chat",
    "object": "chat.completion",
    "usage": {
        "total_tokens": 94,
        "total_characters": 0,
        "prompt_tokens": 75,
        "completion_tokens": 19
    },
    "input_sensitive": false,
    "output_sensitive": false,
    "input_sensitive_type": 0,
    "output_sensitive_type": 0,
    "output_sensitive_int": 0,
    "base_resp": {
        "status_code": 0,
        "status_msg": ""
    }
}

type CompletionTokensDetails

type CompletionTokensDetails struct {
	ReasoningTokens int `json:"reasoning_tokens"`
}

type Config

type Config struct {
	APIKey string `json:"minimax_api_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 IModelMode

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

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
	Name    string `json:"name"`
}

type ModelConfig

type ModelConfig struct {
	MaxTokens   int     `json:"max_tokens"`
	Temperature float64 `json:"temperature"`
	TopP        float64 `json:"top_p"`
}

type Response

type Response struct {
	Id       string           `json:"id"`
	Object   string           `json:"object"`
	Created  int              `json:"created"`
	Model    string           `json:"model"`
	Choices  []ResponseChoice `json:"choices"`
	Usage    Usage            `json:"usage"`
	BaseResp BaseResp         `json:"base_resp"`
}

type ResponseChoice

type ResponseChoice struct {
	Index        int     `json:"index"`
	Message      Message `json:"message"`
	FinishReason string  `json:"finish_reason"`
}

type Usage

type Usage struct {
	TotalTokens      int `json:"total_tokens"`
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalCharacters  int `json:"total_characters"`
}

Jump to

Keyboard shortcuts

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