-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtuling-chatbot-api.yaml
More file actions
170 lines (168 loc) · 3.58 KB
/
Copy pathtuling-chatbot-api.yaml
File metadata and controls
170 lines (168 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
swagger: "2.0"
info:
description: "图灵聊天机器人API"
version: 1.0.0
title: 图灵聊天机器人API
license:
name: Apache-2.0
url: "https://www.apache.org/licenses/LICENSE-2.0.html"
host: openapi.tuling123.com
basePath: /
schemes:
- http
paths:
/openapi/api/v2:
post:
summary: 问答
description: 问答
operationId: chat
consumes:
- application/json
produces:
- application/json
- text/plain
parameters:
- in: body
name: body
schema:
$ref: "#/definitions/ChatReq"
required: true
responses:
"200":
description: successful operation
schema:
$ref: "#/definitions/ChatRsp"
definitions:
ChatReq:
type: object
properties:
reqType:
type: integer
format: int32
description: 输入类型:0-文本(默认)、1-图片、2-音频
perception:
$ref: "#/definitions/Perception"
userInfo:
$ref: "#/definitions/UserInfo"
UserInfo:
type: object
description: 用户参数
properties:
apiKey:
type: string
description: 机器人标识
required: true
userId:
type: string
description: 用户唯一标识
required: true
groupId:
type: string
description: 群聊唯一标识
required: false
userIdName:
type: string
description: 群内用户昵称
required: false
Perception:
type: object
description: 输入信息
properties:
inputText:
$ref: "#/definitions/InputText"
inputImage:
$ref: "#/definitions/InputImage"
inputMedia:
description: 音频信息
$ref: "#/definitions/InputMedia"
selfInfo:
$ref: "#/definitions/SelfInfo"
SelfInfo:
type: object
description: 地理位置信息
properties:
location:
$ref: "#/definitions/Location"
InputText:
type: object
description: 文本信息
properties:
text:
type: string
InputImage:
type: object
description: 图片信息
properties:
url:
type: string
InputMedia:
type: object
properties:
url:
type: string
description: 音频地址
Location:
type: object
properties:
city:
type: string
province:
type: string
street:
type: string
Inspect:
type: object
properties:
id:
type: string
question:
type: string
confidence:
type: float
accept:
type: bool
ChatRsp:
type: object
properties:
intent:
$ref: "#/definitions/Intent"
results:
type: array
items:
$ref: "#/definitions/ReplyResult"
Intent:
type: object
description: 请求意图
properties:
code:
type: integer
format: int32
description: 输出功能code
required: true
intentName:
type: string
description: 意图名称
required: false
actionName:
type: string
description: 意图动作名称
required: false
parameters:
type: map
description: 功能相关参数
required: false
ReplyResult:
type: object
description: 输出结果集
properties:
resultType:
type: string
description: 输出类型
required: true
values:
type: map
required: true
groupType:
type: integer
format: int32
required: true