MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / testSdk

Function testSdk

sdk/test/test-sdk.ts:4–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { getUserCredentials } from '../src/credentials'
3
4export 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
25testSdk()

Callers 1

test-sdk.tsFile · 0.85

Calls 2

runMethod · 0.95
getUserCredentialsFunction · 0.90

Tested by

no test coverage detected