Skip to content

Commit 842c9bc

Browse files
authored
chore(documentation): fix some broken links and bad example code (#736)
1 parent c11402d commit 842c9bc

1 file changed

Lines changed: 20 additions & 31 deletions

File tree

README.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ After completing any modifications to this project, ensure `llms.txt` and `READM
6666

6767
### Runloop SDK
6868

69-
The main SDK class that provides access to all Runloop functionality construct view the [RunloopSDK documentation](https://runloopai.github.io/api-client-ts/stable/classes/RunloopSDK.html) to see specific capabilities.
69+
The main SDK class that provides access to all Runloop functionality. View the [RunloopSDK documentation](https://runloopai.github.io/api-client-ts/stable/) to see specific capabilities.
7070

7171
### Available Resources
7272

7373
The SDK provides object-oriented interfaces for all major Runloop resources:
7474

75-
- **[`runloop.devbox`](https://runloopai.github.io/api-client-ts/stable/classes/DevboxOps.html)** - Devbox management (create, list, execute commands, file operations)
76-
- **[`runloop.blueprint`](https://runloopai.github.io/api-client-ts/stable/classes/BlueprintOps.html)** - Blueprint management (create, list, build blueprints)
77-
- **[`runloop.snapshot`](https://runloopai.github.io/api-client-ts/stable/classes/SnapshotOps.html)** - Snapshot management (list disk snapshots)
78-
- **[`runloop.storageObject`](https://runloopai.github.io/api-client-ts/stable/classes/StorageObjectOps.html)** - Storage object management (upload, download, list objects)
79-
- **[`runloop.agent`](https://runloopai.github.io/api-client-ts/stable/classes/AgentOps.html)** - Agent management (create, list agents from npm/pip/git)
80-
- **[`runloop.scenario`](https://runloopai.github.io/api-client-ts/stable/classes/ScenarioOps.html)** - Scenario management (list scenarios, start runs)
81-
- **[`runloop.scorer`](https://runloopai.github.io/api-client-ts/stable/classes/ScorerOps.html)** - Scorer management (create, list, update)
82-
- **[`runloop.api`](https://runloopai.github.io/api-client-ts/stable/classes/Runloop.html)** - Direct access to the REST API client
75+
- **[`runloop.devbox`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.DevboxOps.html)** - Devbox management (create, list, execute commands, file operations)
76+
- **[`runloop.blueprint`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.BlueprintOps.html)** - Blueprint management (create, list, build blueprints)
77+
- **[`runloop.snapshot`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.SnapshotOps.html)** - Snapshot management (list disk snapshots)
78+
- **[`runloop.storageObject`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.StorageObjectOps.html)** - Storage object management (upload, download, list objects)
79+
- **[`runloop.agent`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.AgentOps.html)** - Agent management (create, list agents from npm/pip/git)
80+
- **[`runloop.scenario`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.ScenarioOps.html)** - Scenario management (list scenarios, start runs)
81+
- **[`runloop.scorer`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.ScorerOps.html)** - Scorer management (create, list, update)
82+
- **[`runloop.api`](https://runloopai.github.io/api-client-ts/stable/modules/types.html)** - Direct access to the REST API client
8383

8484
## TypeScript Support
8585

@@ -122,7 +122,7 @@ await scorer.update({ bash_script: 'echo "0.5"' });
122122

123123
### Scenarios
124124

125-
Scenarios define tasks with a well defined starting environment, task evaluation scorer and an optional reference solution.. Use `runloop.scenario.fromId()` to get a scenario, then `scenario.run()` to start a run with your agent mounted:
125+
Scenarios define tasks with a well defined starting environment, task evaluation scorer and an optional reference solution. Use `runloop.scenario.fromId()` to get a scenario, then `scenario.run()` to start a run with your agent mounted:
126126

127127
```typescript
128128
const scenario = runloop.scenario.fromId('scn_123');
@@ -170,7 +170,7 @@ const runloop = new RunloopSDK();
170170
const secretResult = await runloop.api.secrets.create({ ... });
171171
```
172172

173-
Once you've migrated your existing code to the new SDK client you can optionally go through and move from the API paradime to the object oriented SDK.
173+
Once you've migrated your existing code to the new SDK client you can optionally go through and move from the API paradigm to the object oriented SDK.
174174

175175
```ts
176176
// Before (Legacy api client)
@@ -203,23 +203,23 @@ await devbox.shutdown();
203203

204204
## File write
205205

206+
```ts
206207
// You can also pass a `fetch` `Response`:
207208
await client.devboxes.uploadFile('id', {
208-
path: 'path',
209-
file: await fetch('https://somesite/file'),
209+
path: 'path',
210+
file: await fetch('https://somesite/file'),
210211
});
211212

212213
// Finally, if none of the above are convenient, you can use our `toFile` helper:
213214
await client.devboxes.uploadFile('id', {
214-
path: 'path',
215-
file: await toFile(Buffer.from('my bytes'), 'file'),
215+
path: 'path',
216+
file: await toFile(Buffer.from('my bytes'), 'file'),
216217
});
217218
await client.devboxes.uploadFile('id', {
218-
path: 'path',
219-
file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
219+
path: 'path',
220+
file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
220221
});
221-
222-
````
222+
```
223223

224224
## Handling errors
225225

@@ -238,18 +238,7 @@ const devboxView = await client.devboxes.create().catch(async (err) => {
238238
throw err;
239239
}
240240
});
241-
```typescript
242-
import { RunloopSDK, type DevboxView } from '@runloop/api-client';
243-
244-
const runloop = new RunloopSDK();
245-
const devbox: DevboxView = await runloop.devbox.create();
246-
````
247-
248-
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
249-
await client.devboxes.uploadFile('id', {
250-
path: 'path',
251-
file: fs.createReadStream('/path/to/file'),
252-
});
241+
```
253242

254243
## Advanced Configuration
255244

0 commit comments

Comments
 (0)