()
| 2 | import { getUserCredentials } from '../src/credentials' |
| 3 | |
| 4 | export async function testSdk() { |
| 5 | const apiKey = getUserCredentials()?.authToken |
| 6 | if (!apiKey) { |
| 7 | throw new Error('Could not load API key from user credentials') |
| 8 | } |
| 9 | |
| 10 | const client = new CodebuffClient({ |
| 11 | apiKey, |
| 12 | }) |
| 13 | |
| 14 | const run = await client.run({ |
| 15 | agent: 'codebuff/base2@latest', |
| 16 | prompt: 'Create a simple calculator class', |
| 17 | handleEvent: (event) => { |
| 18 | console.log(event) |
| 19 | }, |
| 20 | }) |
| 21 | |
| 22 | console.log(run) |
| 23 | } |
| 24 | |
| 25 | testSdk() |
no test coverage detected