v2

package
v1.0.139 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

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(endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)

POST method Chat ...

func (*MaaS) ChatImpl

func (cli *MaaS) ChatImpl(ctx context.Context, endpointId string, body []byte) (*api.ChatResp, int, error)

func (*MaaS) ChatWithCtx

func (cli *MaaS) ChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)

POST method ChatWithCtx ...

func (*MaaS) Classification

func (cli *MaaS) Classification(endpointId string, req *api.ClassificationReq) (*api.ClassificationResp, int, error)

POST method Classification

func (*MaaS) ClassificationWithCtx

func (cli *MaaS) ClassificationWithCtx(ctx context.Context, endpointId string, req *api.ClassificationReq) (*api.ClassificationResp, int, error)

func (*MaaS) Embeddings

func (cli *MaaS) Embeddings(endpointId string, req *api.EmbeddingsReq) (*api.EmbeddingsResp, int, error)

POST method Embeddings

func (*MaaS) EmbeddingsWithCtx

func (cli *MaaS) EmbeddingsWithCtx(ctx context.Context, endpointId string, req *api.EmbeddingsReq) (*api.EmbeddingsResp, int, error)

func (*MaaS) SecretChat

func (cli *MaaS) SecretChat(endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)

POST method SecretChat is like `Chat`, except its messages are encrypted to ensure that messages are not intercepted by receivers other than the model.

func (*MaaS) SecretChatWithCtx

func (cli *MaaS) SecretChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)

POST method SecretChatWithCtx is like `ChatWithCtx`, except its messages are encrypted to ensure that messages are not intercepted by receivers other than the model.

func (*MaaS) SecretStreamChat

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

POST method SecretStreamChat is like `StreamChat`, except its messages are encrypted to ensure that messages are not intercepted by receivers other than the model.

func (*MaaS) SecretStreamChatWithCtx

func (cli *MaaS) SecretStreamChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (ch <-chan *api.ChatResp, err error)

POST method SecretStreamChatWithCtx is like `StreamChatWithCtx`, except its messages are encrypted to ensure that messages are not intercepted by receivers other than the model.

func (*MaaS) StreamChat

func (cli *MaaS) StreamChat(endpointId string, 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.

func (*MaaS) StreamChatImpl

func (cli *MaaS) StreamChatImpl(ctx context.Context, endpointId string, body []byte) (<-chan *api.ChatResp, error)

func (*MaaS) StreamChatWithCtx

func (cli *MaaS) StreamChatWithCtx(ctx context.Context, endpointId string, 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.

func (*MaaS) Tokenization

func (cli *MaaS) Tokenization(endpointId string, req *api.TokenizeReq) (*api.TokenizeResp, int, error)

POST method Tokenization

func (*MaaS) TokenizationWithCtx

func (cli *MaaS) TokenizationWithCtx(ctx context.Context, endpointId string, req *api.TokenizeReq) (*api.TokenizeResp, int, error)

Jump to

Keyboard shortcuts

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