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

Function generator

packages/agent-runtime/src/__tests__/test-utils.ts:32–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 chunks: (string | { toolName: string; input: Record<string, unknown> })[],
31): AsyncGenerator<StreamChunk, PromptResult<string | null>> {
32 async function* generator(): AsyncGenerator<
33 StreamChunk,
34 PromptResult<string | null>
35 > {
36 for (const chunk of chunks) {
37 if (typeof chunk === 'string') {
38 yield { type: 'text' as const, text: chunk }
39 } else {
40 yield createToolCallChunk(chunk.toolName, chunk.input)
41 }
42 }
43 return promptSuccess('mock-message-id')
44 }
45 return generator()
46}
47

Callers 1

Calls 2

promptSuccessFunction · 0.90
createToolCallChunkFunction · 0.70

Tested by

no test coverage detected