Skip to content

Commit 138925b

Browse files
feat(api): api update
1 parent 5f1ad6d commit 138925b

5 files changed

Lines changed: 16 additions & 48 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-7d29d0843a52840291678a3c6d136f496ae1f956853abaa5003c1284ca2c94aa.yml
3-
openapi_spec_hash: 010597ad0ec6376fbf2f01ec062787ad
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-a73d280435ed6084d8ac9d9d7feb235de6141d866d40725ed26a27b87b0cf364.yml
3+
openapi_spec_hash: 91eabc37804d07ce801b1d4ea1778d1c
44
config_hash: bd8505e17db740d82e578d0edaa9bfe0

README.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,6 @@ const memoryStatus: Hyperspell.MemoryStatus = await client.memories.add(params);
5858

5959
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
6060

61-
## File uploads
62-
63-
Request parameters that correspond to file uploads can be passed in many different forms:
64-
65-
- `File` (or an object with the same structure)
66-
- a `fetch` `Response` (or an object with the same structure)
67-
- an `fs.ReadStream`
68-
- the return value of our `toFile` helper
69-
70-
```ts
71-
import fs from 'fs';
72-
import Hyperspell, { toFile } from 'hyperspell';
73-
74-
const client = new Hyperspell();
75-
76-
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
77-
await client.memories.upload({ file: fs.createReadStream('/path/to/file') });
78-
79-
// Or if you have the web `File` API you can pass a `File` instance:
80-
await client.memories.upload({ file: new File(['my bytes'], 'file') });
81-
82-
// You can also pass a `fetch` `Response`:
83-
await client.memories.upload({ file: await fetch('https://somesite/file') });
84-
85-
// Finally, if none of the above are convenient, you can use our `toFile` helper:
86-
await client.memories.upload({ file: await toFile(Buffer.from('my bytes'), 'file') });
87-
await client.memories.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
88-
```
89-
9061
## Handling errors
9162

9263
When the library is unable to connect to the API,

0 commit comments

Comments
 (0)