 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- type MaaS
- func (cli *MaaS) Chat(req *api.ChatReq) (*api.ChatResp, int, error)
- func (cli *MaaS) ChatWithCtx(ctx context.Context, req *api.ChatReq) (*api.ChatResp, int, error)
- func (cli *MaaS) StreamChat(req *api.ChatReq) (ch <-chan *api.ChatResp, err error)
- func (cli *MaaS) StreamChatWithCtx(ctx context.Context, req *api.ChatReq) (ch <-chan *api.ChatResp, err error)
 
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 ¶
MaaS ... use base client
func (*MaaS) ChatWithCtx ¶ added in v1.0.108
POST method Chat ...
func (*MaaS) StreamChat ¶
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) StreamChatWithCtx ¶ added in v1.0.108
func (cli *MaaS) StreamChatWithCtx(ctx context.Context, 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.
 Click to show internal directories. 
   Click to hide internal directories.