llms

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OpenAIModels = []string{"gpt-3.5", "gpt-3.5-turbo"}
	GeminiModels = []string{"gemini-pro"}
)
View Source
var (
	ZhiPuAILite  string = "chatglm_lite"
	ZhiPuAIStd   string = "chatglm_std"
	ZhiPuAIPro   string = "chatglm_pro"
	ZhiPuAITurbo string = "chatglm_turbo"
	// ChatGLM3
	ZhiPuAIGLM3Turbo string = "glm-3-turbo"
	// ChatGLM4
	ZhiPuAIGLM4 string = "glm-4"
	// Character LLM
	ZhiPuAICharGLM3 string = "charglm-3"
)

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"
	Gemini    LLMType = "gemini"
	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