@@ -121,180 +121,8 @@ const httpClient = axios.create({
121121const sdk = new UnstructuredClient ({defaultClient : httpClient });
122122` ` `
123123<!-- End Custom HTTP Client -->
124-
125-
126-
127- <!-- Start Retries -->
128- # Retries
129-
130- 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.
131-
132- To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
133-
134-
135- ## Example
136-
137- ` ` ` typescript
138- import { UnstructuredClient } from " unstructured-client" ;
139-
140- (async () => {
141- const sdk = new UnstructuredClient ({
142- security: {
143- apiKeyAuth: " YOUR_API_KEY" ,
144- },
145- });
146-
147- const res = await sdk .general .partition (
148- {
149- chunkingStrategy: " by_title" ,
150- combineUnderNChars: 500 ,
151- encoding: " utf-8" ,
152- files: {
153- content: new TextEncoder ().encode (" 0x2cC94b2FEF" ),
154- fileName: " um.shtml" ,
155- },
156- gzUncompressedContentType: " application/pdf" ,
157- hiResModelName: " yolox" ,
158- languages: [" [" , " e" , " n" , " g" , " ]" ],
159- maxCharacters: 1500 ,
160- newAfterNChars: 1500 ,
161- outputFormat: " application/json" ,
162- skipInferTableTypes: [" p" , " d" , " f" ],
163- strategy: " hi_res" ,
164- },
165- {
166- strategy: " backoff" ,
167- backoff: {
168- initialInterval: 1 ,
169- maxInterval: 50 ,
170- exponent: 1.1 ,
171- maxElapsedTime: 100 ,
172- },
173- retryConnectionErrors: false ,
174- }
175- );
176-
177- if (res .statusCode == 200 ) {
178- // handle response
179- }
180- })();
181-
182- ```
183-
184- If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
185-
186-
187- ## Example
188-
189- ``` typescript
190- import { UnstructuredClient } from " unstructured-client" ;
191-
192- (async () => {
193- const sdk = new UnstructuredClient ({
194- retry_config: {
195- strategy: " backoff" ,
196- backoff: {
197- initialInterval: 1 ,
198- maxInterval: 50 ,
199- exponent: 1.1 ,
200- maxElapsedTime: 100 ,
201- },
202- retryConnectionErrors: false ,
203- }
204- security : {
205- apiKeyAuth: " YOUR_API_KEY" ,
206- },
207- });
208-
209- const res = await sdk .general .partition ({
210- chunkingStrategy: " by_title" ,
211- combineUnderNChars: 500 ,
212- encoding: " utf-8" ,
213- files: {
214- content: new TextEncoder ().encode (" 0x2cC94b2FEF" ),
215- fileName: " um.shtml" ,
216- },
217- gzUncompressedContentType: " application/pdf" ,
218- hiResModelName: " yolox" ,
219- languages: [
220- " [" ,
221- " e" ,
222- " n" ,
223- " g" ,
224- " ]" ,
225- ],
226- maxCharacters: 1500 ,
227- newAfterNChars: 1500 ,
228- outputFormat: " application/json" ,
229- skipInferTableTypes: [
230- " p" ,
231- " d" ,
232- " f" ,
233- ],
234- strategy: " hi_res" ,
235- });
236-
237-
238- if (res .statusCode == 200 ) {
239- // handle response
240- }
241- })();
242- ```
243-
244-
245- <!-- End Retries -->
246-
247-
248-
249- <!-- Start Authentication -->
250-
251- # Authentication
252-
253- ## Per-Client Security Schemes
254-
255- Your SDK supports the following security scheme globally:
256-
257- | Name | Type | Scheme |
258- | ------------ | ------------ | ------------ |
259- | ` apiKeyAuth ` | apiKey | API key |
260-
261- You can set the security parameters through the ` security ` optional parameter when initializing the SDK client instance. For example:
262-
263- ``` typescript
264- import { UnstructuredClient } from " unstructured-client" ;
265-
266- (async () => {
267- const sdk = new UnstructuredClient ({
268- security: {
269- apiKeyAuth: " YOUR_API_KEY" ,
270- },
271- });
272-
273- const res = await sdk .general .partition ({
274- chunkingStrategy: " by_title" ,
275- combineUnderNChars: 500 ,
276- encoding: " utf-8" ,
277- files: {
278- content: new TextEncoder ().encode (" 0x2cC94b2FEF" ),
279- fileName: " um.shtml" ,
280- },
281- gzUncompressedContentType: " application/pdf" ,
282- hiResModelName: " yolox" ,
283- languages: [" [" , " e" , " n" , " g" , " ]" ],
284- maxCharacters: 1500 ,
285- newAfterNChars: 1500 ,
286- outputFormat: " application/json" ,
287- skipInferTableTypes: [" p" , " d" , " f" ],
288- strategy: " hi_res" ,
289- });
290-
291- if (res .statusCode == 200 ) {
292- // handle response
293- }
294- })();
295-
296- ```
297- <!-- End Authentication -->
124+ <!-- No Retries -->
125+ <!-- No Authentication -->
298126
299127<!-- Placeholder for Future Speakeasy SDK Sections -->
300128
0 commit comments