mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 17:03:28 +00:00
feat: sprites support
This commit is contained in:
parent
9cd9252725
commit
5da35e6dfa
35 changed files with 746 additions and 1257 deletions
21
examples/sprites/src/index.ts
Normal file
21
examples/sprites/src/index.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { SandboxAgent } from "sandbox-agent";
|
||||
import { sprites } from "sandbox-agent/sprites";
|
||||
|
||||
const env: Record<string, string> = {};
|
||||
if (process.env.ANTHROPIC_API_KEY) env.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
|
||||
if (process.env.OPENAI_API_KEY) env.OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
||||
|
||||
const client = await SandboxAgent.start({
|
||||
sandbox: sprites({
|
||||
token: process.env.SPRITES_API_KEY ?? process.env.SPRITE_TOKEN ?? process.env.SPRITES_TOKEN,
|
||||
env,
|
||||
}),
|
||||
});
|
||||
|
||||
console.log(`UI: ${client.inspectorUrl}`);
|
||||
console.log(await client.getHealth());
|
||||
|
||||
process.once("SIGINT", async () => {
|
||||
await client.destroySandbox();
|
||||
process.exit(0);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue