skywork

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMV2

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

func NewLLMV2

func NewLLMV2(apiKey, apiSecret string, opt *OptionV2) (*LLMV2, error)

func (*LLMV2) CheckSupport

func (llm *LLMV2) CheckSupport(_ llms.LLMSupportType) bool

func (*LLMV2) Request

func (llm *LLMV2) Request(ctx context.Context, input llms.Input, _ llms.ToolBox) (*llms.Output, error)

type ModelType

type ModelType int

type OptionV2

type OptionV2 struct {
	ReqParamV2
	// contains filtered or unexported fields
}

func NewOptionV2

func NewOptionV2() *OptionV2

func (*OptionV2) SetHost

func (p *OptionV2) SetHost(host, model string) *OptionV2

func (*OptionV2) SetHttpClient

func (p *OptionV2) SetHttpClient(val *http.Client) *OptionV2

type ReqMsg

type ReqMsg struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ReqParamV2

type ReqParamV2 struct {
	GenerateLength    int     `json:"generate_length,omitempty"`
	TopP              float32 `json:"top_p,omitempty"`
	TopK              int     `json:"top_k,omitempty"`
	RepetitionPenalty float32 `json:"repetition_penalty,omitempty"`
	LengthPenalty     float32 `json:"length_penalty,omitempty"`
	MinLen            int     `json:"min_len,omitempty"`
	Temperature       float32 `json:"temperature"`
}

type RequestV2

type RequestV2 struct {
	Messages []*ReqMsg  `json:"messages"`
	Model    string     `json:"model"`
	Param    ReqParamV2 `json:"param"`
}

type RequestV3

type RequestV3 struct {
	Messages []*ReqMsg `json:"messages"`
	Intent   string    `json:"intent"`
}

type RespArgsV3

type RespArgsV3 struct {
	Messages  RespMsgV3 `json:"messages"`
	RequestId string    `json:"requestId"`
}

type RespDataV2

type RespDataV2 struct {
	Reply        string      `json:"reply"`
	FinishReason int         `json:"finish_reason"`
	Status       int         `json:"status"`
	Usage        RespUsageV2 `json:"usage"`
}

type RespMsgV3

type RespMsgV3 struct {
	Text      string `json:"text"`
	Author    string `json:"author"`
	CreatedAt string `json:"createdAt"`
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`
	CardId    string `json:"cardId"`
	Addition  string `json:"addition"`
}

type RespUsageV2

type RespUsageV2 struct {
	PromptTokens     int64 `json:"prompt_tokens"`
	CompletionTokens int64 `json:"completion_tokens"`
	TotalTokens      int64 `json:"total_tokens"`
}

type ResponseV2

type ResponseV2 struct {
	Code     int        `json:"code"`
	CodeMsg  string     `json:"code_msg"`
	TraceId  string     `json:"trace_id"`
	RespData RespDataV2 `json:"resp_data"`
}

type ResponseV3

type ResponseV3 struct {
	Type           int          `json:"type"`
	CardType       string       `json:"card_type"`
	Target         string       `json:"target"`
	Arguments      []RespArgsV3 `json:"arguments"`
	ConversationId string       `json:"conversation_id"`
	RequestId      string       `json:"request_id"`
	AskId          string       `json:"ask_id"`
}

Jump to

Keyboard shortcuts

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