1
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
2
+
3
+ imports :
4
+ commons : commons.yml
5
+
6
+ service :
7
+ auth : true
8
+ base-path : /snippets
9
+ endpoints :
10
+ get :
11
+ path : " "
12
+ docs : Get snippet by endpoint method and path
13
+ display-name : Get snippet for endpoint
14
+ availability : pre-release
15
+ audiences :
16
+ - external
17
+ - fiddle
18
+ method : POST
19
+ request :
20
+ name : GetSnippetRequest
21
+ body :
22
+ properties :
23
+ orgId :
24
+ type : optional<commons.OrgId>
25
+ docs : |
26
+ If the same API is defined across multiple organization,
27
+ you must specify an organization ID.
28
+ apiId :
29
+ type : optional<commons.ApiId>
30
+ docs : |
31
+ If you have more than one API, you must specify its ID.
32
+ sdks :
33
+ type : optional<list<SDK>>
34
+ docs : |
35
+ The SDKs for which to load snippets. If unspecified,
36
+ snippets for the latest published SDKs will be returned.
37
+ loadLevel :
38
+ type : optional<SnippetLoadLevel>
39
+ docs : |
40
+ The level of detail to load for the snippet. If unspecified,
41
+ the full snippet will be returned.
42
+ endpoint : EndpointIdentifier
43
+ response : list<Snippet>
44
+ examples :
45
+ - request :
46
+ endpoint :
47
+ method : GET
48
+ path : /v1/search
49
+ response :
50
+ body :
51
+ - type : python
52
+ sdk :
53
+ package : vellum-ai
54
+ version : 1.2.1
55
+ sync_client : |
56
+ import Vellum from vellum.client
57
+
58
+ client = Vellum(api_key="YOUR_API_KEY")
59
+ client.search(query="Find documents written in the last 5 days")
60
+ async_client : |
61
+ import VellumAsync from vellum.client
62
+
63
+ client = VellumAsync(api_key="YOUR_API_KEY")
64
+ await client.search(query="Find documents written in the last 5 days")
65
+ - type : typescript
66
+ sdk :
67
+ package : vellum-ai
68
+ version : 1.2.1
69
+ client : |
70
+ import { VellumClient } from "vellum-ai";
71
+
72
+ const vellum = VellumClient({
73
+ apiKey="YOUR_API_KEY"
74
+ })
75
+ vellum.search({
76
+ query: "Find documents written in the last 5 days"
77
+ })
78
+
79
+ load :
80
+ path : /load
81
+ display-name : Load all snippets
82
+ method : POST
83
+ availability : pre-release
84
+ audiences :
85
+ - external
86
+ - fiddle
87
+ request :
88
+ name : ListSnippetsRequest
89
+ query-parameters :
90
+ page : optional<integer>
91
+ body :
92
+ properties :
93
+ orgId :
94
+ type : optional<commons.OrgId>
95
+ docs : |
96
+ If the same API is defined across multiple organization,
97
+ you must specify an organization ID.
98
+ apiId :
99
+ type : optional<commons.ApiId>
100
+ docs : |
101
+ If you have more than one API, you must specify its ID.
102
+ sdks :
103
+ type : optional<list<SDK>>
104
+ docs : |
105
+ The SDKs for which to load snippets. If unspecified,
106
+ snippets for the latest published SDKs will be returned.
107
+ loadLevel :
108
+ type : optional<SnippetLoadLevel>
109
+ docs : |
110
+ The level of detail to load for the snippet. If unspecified,
111
+ the full snippet will be returned.
112
+ response : SnippetsPage
113
+ examples :
114
+ - query-parameters :
115
+ page : 1
116
+ request :
117
+ orgId : vellum
118
+ apiId : vellum-ai
119
+ sdks :
120
+ - type : python
121
+ package : vellum-ai
122
+ version : 1.2.1
123
+ response :
124
+ body :
125
+ next : 2
126
+ snippets :
127
+ /v1/search :
128
+ GET :
129
+ - type : python
130
+ sdk :
131
+ package : vellum-ai
132
+ version : 1.2.1
133
+ sync_client : |
134
+ import Vellum from vellum.client
135
+
136
+ client = Vellum(api_key="YOUR_API_KEY")
137
+ client.search(query="Find documents written in the last 5 days")
138
+ async_client : |
139
+ import Vellum from vellum.client
140
+
141
+ client = Vellum(api_key="YOUR_API_KEY")
142
+ client.search(query="Find documents written in the last 5 days")
143
+ - type : typescript
144
+ sdk :
145
+ package : vellum-ai
146
+ version : 1.2.1
147
+ client : |
148
+ import { VellumClient } from "vellum-ai";
149
+
150
+ const vellum = VellumClient({
151
+ apiKey="YOUR_API_KEY"
152
+ })
153
+ vellum.search({
154
+ query: "Find documents written in the last 5 days"
155
+ })
156
+ v1/document-indexes :
157
+ POST :
158
+ - type : python
159
+ sdk :
160
+ package : vellum-ai
161
+ version : 1.2.1
162
+ sync_client : |
163
+ import Vellum from vellum.client
164
+
165
+ client = Vellum(api_key="YOUR_API_KEY")
166
+ client.document_indexes.create(name="meeting-reports", status="ACTIVE")
167
+ async_client : |
168
+ import VellumAsync from vellum.client
169
+
170
+ client = VellumAsync(api_key="YOUR_API_KEY")
171
+ await client.document_indexes.create(name="meeting-reports", status="ACTIVE")
172
+ - type : typescript
173
+ sdk :
174
+ package : vellum-ai
175
+ version : 1.2.1
176
+ client : |
177
+ import { VellumClient } from "vellum-ai";
178
+
179
+ const vellum = VellumClient({
180
+ apiKey="YOUR_API_KEY"
181
+ })
182
+ vellum.documentIndexes.create({
183
+ name: "meeting-reports",
184
+ status: "ACTIVE"
185
+ })
186
+
187
+ types :
188
+ SnippetLoadLevel :
189
+ enum :
190
+ - value : full
191
+ docs : |
192
+ The full snippet including client instantiation and method call.
193
+ - value : endpoint
194
+ docs : |
195
+ Only returns the part of the snippet for the endpoint call. In
196
+ other words, the client instantiation is not included.
197
+
198
+ EndpointIdentifier :
199
+ properties :
200
+ path : EndpointPath
201
+ method : EndpointMethod
202
+
203
+ EndpointPath :
204
+ type : string
205
+ docs : The relative path for an endpont (e.g. `/users/{userId}`)
206
+
207
+ EndpointMethod :
208
+ enum :
209
+ - PUT
210
+ - POST
211
+ - GET
212
+ - PATCH
213
+ - DELETE
214
+
215
+ SDK :
216
+ union :
217
+ typescript : TypeScriptSDK
218
+ python : PythonSDK
219
+ go : GoSDK
220
+ java : JavaSDK
221
+
222
+ TypeScriptSDK :
223
+ properties :
224
+ package : string
225
+ version : string
226
+
227
+ PythonSDK :
228
+ properties :
229
+ package : string
230
+ version : string
231
+
232
+ GoSDK :
233
+ properties :
234
+ githubRepo : string
235
+ version : string
236
+
237
+ JavaSDK :
238
+ properties :
239
+ group :
240
+ type : string
241
+ docs : The maven repository group (e.g. `com.stripe.java`)
242
+ artifact :
243
+ type : string
244
+ docs : The artifact (e.g. `stripe-java`)
245
+ version : string
246
+
247
+ # ###### Load Snippets #######
248
+
249
+ SnippetsPage :
250
+ properties :
251
+ next :
252
+ type : optional<integer>
253
+ docs : If present, pass this into the `page` query parameter to load the next page.
254
+ snippets :
255
+ type : map<EndpointPath, SnippetsByEndpointMethod>
256
+ docs : |
257
+ The snippets are returned as a map of endpoint path (e.g. `/api/users`)
258
+ to a map of endpoint method (e.g. `POST`) to snippets.
259
+
260
+ SnippetsByEndpointMethod :
261
+ type : map<EndpointMethod, list<Snippet>>
262
+
263
+ Snippet :
264
+ union :
265
+ typescript : TypeScriptSnippet
266
+ python : PythonSnippet
267
+ java : JavaSnippet
268
+ go : GoSnippet
269
+
270
+ TypeScriptSnippet :
271
+ properties :
272
+ sdk : TypeScriptSDK
273
+ client : string
274
+
275
+ PythonSnippet :
276
+ properties :
277
+ sdk : PythonSDK
278
+ async_client : string
279
+ sync_client : string
280
+
281
+ GoSnippet :
282
+ properties :
283
+ sdk : GoSDK
284
+ client : string
285
+
286
+ JavaSnippet :
287
+ properties :
288
+ sdk : JavaSDK
289
+ async_client : string
290
+ sync_client : string
0 commit comments