You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Start Available Resources and Operations [operations] -->
144
115
## Available Resources and Operations
145
116
@@ -178,7 +149,6 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
178
149
</details>
179
150
<!-- End Standalone functions [standalone-funcs] -->
180
151
181
-
<!-- Start File uploads [file-upload] -->
182
152
## File uploads
183
153
184
154
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
@@ -194,111 +164,32 @@ Certain SDK methods accept files as part of a multi-part request. It is possible
194
164
195
165
```typescript
196
166
import { SDK } from"@speakeasyapi/code-samples";
197
-
import { openAsBlob} from"node:fs";
167
+
import { promisesasfs} from"fs"
198
168
199
169
const sdk =newSDK({
200
170
security: {
201
171
apiKey: "<YOUR_API_KEY_HERE>",
202
172
},
203
173
});
204
174
205
-
asyncfunction run() {
206
-
const result =awaitsdk.codesamples.preview({
207
-
languages: [
208
-
"<value>",
209
-
],
210
-
schemaFile: awaitopenAsBlob("example.file"),
211
-
});
212
-
213
-
// Handle the result
214
-
console.log(result);
215
-
}
216
-
217
-
run();
218
-
219
-
```
220
-
<!-- End File uploads [file-upload] -->
221
-
222
-
<!-- Start Retries [retries] -->
223
-
## Retries
224
-
225
-
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
226
-
227
-
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
0 commit comments