| 63 | }; |
| 64 | |
| 65 | export interface Summarizer { |
| 66 | /** Load the model into memory. Must be called before summarize(). */ |
| 67 | init(): Promise<void>; |
| 68 | |
| 69 | /** |
| 70 | * Generate a one-sentence summary for a code snippet. |
| 71 | * |
| 72 | * @param source - The source code to summarize (will be truncated internally). |
| 73 | * @param kind - What kind of code entity this is (function, class, file). |
| 74 | * @returns The generated summary string. |
| 75 | */ |
| 76 | summarize(source: string, kind: NodeKind): Promise<string>; |
| 77 | |
| 78 | /** |
| 79 | * Summarize multiple items in a single batched forward pass. |
| 80 | * Much faster than calling summarize() in a loop. |
| 81 | * |
| 82 | * @param items - Array of {source, kind} pairs to summarize. |
| 83 | * @returns Array of summary strings (same order as input). |
| 84 | */ |
| 85 | summarizeBatch( |
| 86 | items: Array<{ source: string; kind: NodeKind }>, |
| 87 | ): Promise<string[]>; |
| 88 | |
| 89 | /** Release model resources. */ |
| 90 | dispose(): Promise<void>; |
| 91 | } |
no outgoing calls
no test coverage detected