-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.yaml
More file actions
210 lines (210 loc) · 6.33 KB
/
openapi.yaml
File metadata and controls
210 lines (210 loc) · 6.33 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
openapi: 3.0.3
info:
title: LLM Mock Service
version: 1.0.0
description: Mock endpoints for LLM API compatibility (Ollama, Gemini, OpenAI, AWS Bedrock)
servers:
- url: http://localhost:8083
tags:
- name: Control API
description: Endpoints for controlling the mock service (push/clear response queue)
- name: Models API
description: Endpoints for model-compatible chat APIs (Ollama, Gemini, OpenAI, AWS Bedrock)
paths:
/v1/control/push:
post:
summary: Push mock response(s) to the queue
description: |
Payload validation rules:
- At least one of `text` or a valid `tool` must be present.
- Valid tool must provide `tool.name` and `tool.args`.
tags:
- Control API
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/MockResponse'
- type: array
items:
$ref: '#/components/schemas/MockResponse'
responses:
'204':
description: No Content
/v1/control/clear:
post:
summary: Clear mock response queue
tags:
- Control API
responses:
'204':
description: No Content
/api/chat:
post:
summary: Ollama mock endpoint
tags:
- Models API
responses:
'200':
description: Streamed chat response
content:
application/json:
schema:
type: object
properties:
model:
type: string
created_at:
type: string
message:
type: object
done:
type: boolean
/v1beta/models/{path}:
post:
summary: Gemini mock endpoint
tags:
- Models API
parameters:
- in: path
name: path
required: true
description: |
Path parameter in the format {model}:{api-name}, e.g. gemini-flash-2.0:streamGenerateContent
schema:
type: string
responses:
'200':
description: Streamed Gemini response (JSON or SSE)
content:
application/json:
schema:
type: object
properties:
candidates:
type: array
items:
type: object
modelVersion:
type: string
responseId:
type: string
/chat/completions:
post:
summary: OpenAI mock completions
tags:
- Models API
responses:
'200':
description: Streamed OpenAI chat response (SSE)
content:
application/json:
schema:
type: object
properties:
id:
type: string
object:
type: string
created:
type: integer
model:
type: string
choices:
type: array
items:
type: object
/model/{model}/converse:
post:
summary: Bedrock mock Converse endpoint
tags:
- Models API
parameters:
- in: path
name: model
required: true
description: Bedrock model name
schema:
type: string
responses:
'200':
description: Streamed Bedrock Converse response (JSON)
content:
application/json:
schema:
type: object
properties:
output:
type: object
properties:
message:
type: object
properties:
role:
type: string
content:
type: array
items:
oneOf:
- type: object
properties:
text:
type: string
- type: object
properties:
toolUse:
type: object
properties:
id:
type: string
type:
type: string
name:
type: string
arguments:
type: object
stopReason:
type: string
usage:
type: object
properties:
inputTokens:
type: integer
outputTokens:
type: integer
totalTokens:
type: integer
components:
schemas:
MockResponse:
type: object
properties:
agent:
type: string
description:
Agent name to be selected by the Agent for adaptive agent requests. If provided, this will be pushed first to simulate agent selection behavior
text:
type: object
description: Text response chunks
properties:
chunks:
type: array
items:
type: string
tool:
type: object
description: Tool response.
if provided,
- Both `name` and `args` must be present
- It must be one of the tools supported by the agent in the request, when an agent is provided.
properties:
name:
type: string
args:
oneOf:
- type: object
- type: array
required:
- text