llms

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ZhiPuAILite  string = "chatglm_lite"
	ZhiPuAIStd   string = "chatglm_std"
	ZhiPuAIPro   string = "chatglm_pro"
	ZhiPuAITurbo string = "chatglm_turbo"
)
View Source
var OpenAIModels = []string{"gpt-3.5", "gpt-3.5-turbo"}

Functions

This section is empty.

Types

type LLM

type LLM interface {
	Type() LLMType
	Call([]byte) (Response, error)
	Validate(context.Context, ...langchainllms.CallOption) (Response, error)
}

type LLMType

type LLMType string
const (
	OpenAI    LLMType = "openai"
	ZhiPuAI   LLMType = "zhipuai"
	DashScope LLMType = "dashscope"
	Unknown   LLMType = "unknown"
)

type ModelParams

type ModelParams interface {
	Marshal() []byte
	Unmarshal([]byte) error
}

type Response

type Response interface {
	Type() LLMType
	String() string
	Bytes() []byte
	Unmarshal([]byte) error
}

type UnknowLLM

type UnknowLLM struct{}

func NewUnknowLLM

func NewUnknowLLM() UnknowLLM

func (UnknowLLM) Call

func (unknown UnknowLLM) Call(data []byte) (Response, error)

func (UnknowLLM) Type

func (unknown UnknowLLM) Type() LLMType

func (UnknowLLM) Validate

func (unknown UnknowLLM) Validate(ctx context.Context, options ...langchainllms.CallOption) (Response, error)

Directories

Path Synopsis
NOTE: Reference zhipuai's python sdk: utils/jwt_token.py
NOTE: Reference zhipuai's python sdk: utils/jwt_token.py

Jump to

Keyboard shortcuts

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