@@ -58,35 +58,6 @@ const memoryStatus: Hyperspell.MemoryStatus = await client.memories.add(params);
5858
5959Documentation 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
9263When the library is unable to connect to the API,
0 commit comments