Documentation ¶
Index ¶
- type MaaS
- func (cli *MaaS) Chat(endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)
- func (cli *MaaS) ChatImpl(ctx context.Context, endpointId string, body []byte) (*api.ChatResp, int, error)
- func (cli *MaaS) ChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)
- func (cli *MaaS) Classification(endpointId string, req *api.ClassificationReq) (*api.ClassificationResp, int, error)
- func (cli *MaaS) ClassificationWithCtx(ctx context.Context, endpointId string, req *api.ClassificationReq) (*api.ClassificationResp, int, error)
- func (cli *MaaS) Embeddings(endpointId string, req *api.EmbeddingsReq) (*api.EmbeddingsResp, int, error)
- func (cli *MaaS) EmbeddingsWithCtx(ctx context.Context, endpointId string, req *api.EmbeddingsReq) (*api.EmbeddingsResp, int, error)
- func (cli *MaaS) SecretChat(endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)
- func (cli *MaaS) SecretChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (*api.ChatResp, int, error)
- func (cli *MaaS) SecretStreamChat(endpointId string, req *api.ChatReq) (ch <-chan *api.ChatResp, err error)
- func (cli *MaaS) SecretStreamChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (ch <-chan *api.ChatResp, err error)
- func (cli *MaaS) StreamChat(endpointId string, req *api.ChatReq) (ch <-chan *api.ChatResp, err error)
- func (cli *MaaS) StreamChatImpl(ctx context.Context, endpointId string, body []byte) (<-chan *api.ChatResp, error)
- func (cli *MaaS) StreamChatWithCtx(ctx context.Context, endpointId string, req *api.ChatReq) (ch <-chan *api.ChatResp, err error)
- func (cli *MaaS) Tokenization(endpointId string, req *api.TokenizeReq) (*api.TokenizeResp, int, error)
- func (cli *MaaS) TokenizationWithCtx(ctx context.Context, endpointId string, req *api.TokenizeReq) (*api.TokenizeResp, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MaaS ¶
MaaS ... use base client
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 (*MaaS) Embeddings ¶
func (cli *MaaS) Embeddings(endpointId string, req *api.EmbeddingsReq) (*api.EmbeddingsResp, int, error)
POST method Embeddings
func (*MaaS) EmbeddingsWithCtx ¶
func (*MaaS) SecretChat ¶
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
- if any error returned, a channel=`nil` is returned;
- if no error returned, the channel are closed after all responses processed.
func (*MaaS) StreamChatImpl ¶
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
- if any error returned, a channel=`nil` is returned;
- if no error returned, the channel are closed after all responses processed.