MCPcopy Index your code
hub / github.com/kirodotdev/Kiro / parseCommentResponse

Function parseCommentResponse

scripts/bedrock_comment_generator.ts:195–211  ·  view source on GitHub ↗

* Parse Bedrock response to extract comment text

(responseBody: string)

Source from the content-addressed store, hash-verified

193 * Parse Bedrock response to extract comment text
194 */
195function parseCommentResponse(responseBody: string): string {
196 try {
197 const parsed = JSON.parse(responseBody);
198
199 if (parsed.content && Array.isArray(parsed.content)) {
200 const textContent = parsed.content.find((c: any) => c.type === "text");
201 if (textContent && textContent.text) {
202 return textContent.text.trim();
203 }
204 }
205
206 throw new Error("Unable to parse response content");
207 } catch (error) {
208 console.error("Error parsing Bedrock response:", error);
209 throw error;
210 }
211}
212
213/**
214 * Generate acknowledgment comment using Bedrock Claude Opus 4.6

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected