(content: string)
| 155 | } |
| 156 | |
| 157 | private async writeToStream(content: string): Promise<void> { |
| 158 | const tokens = this.llm.countTokens(content); |
| 159 | |
| 160 | if (this.contentTokens + tokens > this.maxRepoMapTokens) { |
| 161 | content = pruneLinesFromTop( |
| 162 | content, |
| 163 | this.maxRepoMapTokens - this.contentTokens, |
| 164 | this.llm.model, |
| 165 | ); |
| 166 | } |
| 167 | |
| 168 | this.contentTokens += this.llm.countTokens(content); |
| 169 | |
| 170 | await new Promise((resolve) => this.writeStream.write(content, resolve)); |
| 171 | } |
| 172 | |
| 173 | private indentMultilineString(str: string) { |
| 174 | return str |
no test coverage detected