-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.json
388 lines (388 loc) · 17.1 KB
/
openapi.json
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
{
"openapi": "3.1.0",
"info": {
"title": "Generated API",
"summary": "API documentation for the SDK",
"description": "Automatically generated OpenAPI documentation.",
"version": "1.0.0"
},
"servers": [
{
"url": "/"
}
],
"paths": {
"/upload/upload": {
"post": {
"tags": [
"upload"
],
"summary": "upload",
"description": "Upload all system traces and dataset to the server.\nReturns a tuple of (response, questions_json, reward_signals_json, traces_json)\nNote that you can directly upload questions, reward_signals, and traces to the server using the Website\n\nresponse is the response from the server.\nquestions_json is the formatted questions array\nreward_signals_json is the formatted reward signals array\ntraces_json is the formatted traces array\n\n**Function Signature:** `upload(dataset, traces, verbose, show_payload)`\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/upload.py#L213)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/upload.py#L213"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/trackers/track_lm": {
"post": {
"tags": [
"trackers"
],
"summary": "track_lm",
"description": "Track a language model interaction within the current trace.\nAutomatically detects whether to use sync or _async tracking.\n\nArgs:\n messages (List[Dict[str, str]]): List of message dictionaries containing the conversation.\n Each message should have:\n - 'role': str - The role of the speaker (e.g., \"user\", \"assistant\", \"system\")\n - 'content': str - The content of the message\n\n model_name (str): Name of the language model being used\n Examples: \"gpt-4\", \"gpt-3.5-turbo\", \"claude-3-opus-20240229\"\n\n finetune (bool, optional): Whether this interaction is part of a fine-tuning process.\n Defaults to False.\n\nRaises:\n RuntimeError: If called outside a traced context (use with @trace_system_sync \n or @trace_system_async decorator)\n TypeError: If messages or model_name are not of the correct type\n\nExample:\n ```python\n @trace_system_sync(origin=\"agent\", event_type=\"chat\")\n def process_chat(self, user_input: str):\n messages = [\n {\"role\": \"user\", \"content\": user_input}\n ]\n SynthTracker.track_lm(\n messages=messages,\n model_name=\"gpt-4\"\n )\n ```\n\n**Function Signature:** `track_lm(cls, messages, model_name, finetune)`\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py#L204)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py#L204"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/trackers/track_state": {
"post": {
"tags": [
"trackers"
],
"summary": "track_state",
"description": "Track a state change or variable value within the current trace.\nAutomatically detects whether to use sync or _async tracking.\n\nArgs:\n variable_name (str): Name of the variable or state being tracked\n\n variable_value (Union[BaseModel, str, dict, int, float, bool, list, None]): \n Value to track. Must be one of the supported types:\n - BaseModel (Pydantic models)\n - Basic Python types (str, dict, int, float, bool, list)\n - None\n\n origin (Literal[\"agent\", \"environment\"]): Source of the state change\n - \"agent\": Changes from the AI/agent system\n - \"environment\": Changes from external sources/environment\n\n annotation (Optional[str], optional): Additional notes about the state change.\n Defaults to None.\n\nRaises:\n RuntimeError: If called outside a traced context (use with @trace_system_sync \n or @trace_system_async decorator)\n TypeError: If variable_value is not one of the supported types\n ValueError: If origin is not \"agent\" or \"environment\"\n\nExample:\n ```python\n @trace_system_sync(origin=\"agent\", event_type=\"process\")\n def update_state(self, new_value: dict):\n SynthTracker.track_state(\n variable_name=\"system_state\",\n variable_value=new_value,\n origin=\"agent\",\n annotation=\"Updated after processing\"\n )\n ```\n\n**Function Signature:** `track_state(cls, variable_name, variable_value, origin, annotation)`\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py#L254)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py#L254"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/decorators/trace_system_sync": {
"post": {
"tags": [
"decorators"
],
"summary": "trace_system_sync",
"description": "Decorator for tracing synchronous functions.\n\nPurpose is to keep track of inputs and outputs for compute steps for sync functions.\n\n**Function Signature:** `trace_system_sync(origin, event_type, log_result, manage_event, increment_partition, verbose, finetune_step)`\n\n**Return Type:** `Callable`\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/decorators.py#L42)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/decorators.py#L42"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/decorators/trace_system_async": {
"post": {
"tags": [
"decorators"
],
"summary": "trace_system_async",
"description": "Decorator for tracing asynchronous functions.\n\nPurpose is to keep track of inputs and outputs for compute steps for _async functions.\n\n**Function Signature:** `trace_system_async(origin, event_type, log_result, manage_event, increment_partition, verbose, finetune_step)`\n\n**Return Type:** `Callable`\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/decorators.py#L246)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/decorators.py#L246"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/decorators/trace_system": {
"post": {
"tags": [
"decorators"
],
"summary": "trace_system",
"description": "Decorator that chooses the correct tracing method (sync or _async) based on\nwhether the wrapped function is synchronous or asynchronous.\n\nPurpose is to keep track of inputs and outputs for compute steps for both sync and _async functions.\n\n**Function Signature:** `trace_system(origin, event_type, log_result, manage_event, increment_partition, verbose)`\n\n**Return Type:** `Callable`\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/decorators.py#L453)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/decorators.py#L453"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/abstractions/abstractions.TrainingQuestion": {
"get": {
"tags": [
"Classes"
],
"summary": "abstractions.TrainingQuestion",
"description": "A training question is a question that an agent (system_instance_id) is trying to answer.\nIt contains an intent and criteria that the agent is trying to meet.\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/abstractions.py)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/abstractions.py"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/abstractions/abstractions.RewardSignal": {
"get": {
"tags": [
"Classes"
],
"summary": "abstractions.RewardSignal",
"description": "A reward signal tells us how well an agent (system_instance_id) is doing on a particular question (question_id).\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/abstractions.py)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/abstractions.py"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/abstractions/abstractions.Dataset": {
"get": {
"tags": [
"Classes"
],
"summary": "abstractions.Dataset",
"description": "A dataset is a collection of training questions and reward signals. \nThis better represents the data that is used to train a model, and gives us more information about the data.\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/abstractions.py)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/abstractions.py"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/trackers/trackers.SynthTrackerSync": {
"get": {
"tags": [
"Classes"
],
"summary": "trackers.SynthTrackerSync",
"description": "Tracker for synchronous functions.\n\nPurpose is to annotate the inside of your sync functions to track intermediate values.\nDecorator @trace_system_sync is used to annotate the functions and track the inputs and outputs.\nThis tracker is instead used to access the data inside of decorated functions.\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/trackers/trackers.SynthTrackerAsync": {
"get": {
"tags": [
"Classes"
],
"summary": "trackers.SynthTrackerAsync",
"description": "Tracker for synchronous functions.\n\nPurpose is to annotate the inside of your sync functions to track intermediate values.\nDecorator @trace_system_sync is used to annotate the functions and track the inputs and outputs.\nThis tracker is instead used to access the data inside of decorated functions.\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
},
"/trackers/trackers.SynthTracker": {
"get": {
"tags": [
"Classes"
],
"summary": "trackers.SynthTracker",
"description": "Tracker for synchronous and asynchronous functions. Intelligently chooses between sync and _async trackers.\n\nPurpose is to annotate the inside of your sync and _async functions to track intermediate values.\nDecorators @trace_system_sync and @trace_system_async are used to annotate the functions and track the inputs and outputs.\nThis tracker is instead used to access the data inside of decorated functions.\n\n[View source on GitHub](https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py)",
"externalDocs": {
"description": "View source on GitHub",
"url": "https://github.com/synth-laboratories/synth-sdk/blob/main/synth_sdk/tracing/trackers.py"
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"properties": {
"result": {
"type": "string"
}
},
"type": "object"
}
}
}
}
},
"deprecated": false
}
}
}
}