maas

package
v1.0.107 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ServiceName   = "ml_maas"
	APIChat       = "chat"
	APIStreamChat = "stream_chat"

	ServiceTimeout       = 30 * time.Second
	APIStreamChatTimeout = time.Minute

	ChatRoleOfUser      = "user"
	ChatRoleOfAssistant = "assistant"
	ChatRoleOfSystem    = "system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MaaS

type MaaS struct {
	*base.Client
}

MaaS ... use base client

func NewInstance

func NewInstance(host, region string) *MaaS

NewInstance ...

func (*MaaS) Chat

func (cli *MaaS) Chat(req *api.ChatReq) (*api.ChatResp, int, error)

POST method Chat ...

func (*MaaS) StreamChat

func (cli *MaaS) StreamChat(req *api.ChatReq) (ch <-chan *api.ChatResp, err error)

POST method StreamChat make stream chat request

  1. if any error returned, a channel=`nil` is returned;
  2. if no error returned, the channel are closed after all responses processed.

Directories

Path Synopsis
models
api

Jump to

Keyboard shortcuts

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