unit

package
v0.0.0-...-8b17fe9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Say string `json:"say"`
}

type Client

type Client struct {
	Sessions    map[string]Session
	AccessToken baidu.AccessToken
}

func NewClient

func NewClient() *Client

func (*Client) Chat

func (c *Client) Chat(contactId string, query string) (say string, err error)

type Context

type Context struct {
	History []string `json:"SYS_PRESUMED_HIST"`
}

type Request

type Request struct {
	TerminalId string `json:"terminal_id"`
	Query      string `json:"query"`
}

type Responses

type Responses struct {
	Status  int32     `json:"status"`
	Msg     string    `json:"msg"`
	Actions []*Action `json:"actions"`
}

type Result

type Result struct {
	Context   *Context     `json:"context"`
	SessionId string       `json:"session_id"`
	Responses []*Responses `json:"responses"`
}

type Session

type Session struct {
	Settime   int64
	SessionId string
}

type UnitRequest

type UnitRequest struct {
	Version   string  `json:"version"`
	ServiceId string  `json:"service_id"`
	LogId     string  `json:"log_id"`
	SessionId string  `json:"session_id"`
	Request   Request `json:"request"`
}

下面开始是request相关结构体

type UnitRespose

type UnitRespose struct {
	ErrorCode int32   `json:"error_code"`
	ErrorMsg  string  `json:"error_msg"`
	Result    *Result `json:"result"`
}

Jump to

Keyboard shortcuts

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