@diegopetrucci/pi-brrr 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi-fleet-tested-version +1 -1
- package/index.ts +4 -3
- package/package.json +1 -1
package/.pi-fleet-tested-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.80.3
|
package/index.ts
CHANGED
|
@@ -159,8 +159,9 @@ function extractTextContent(content: unknown): string {
|
|
|
159
159
|
}
|
|
160
160
|
if (typeof part !== "object" || part === null) continue;
|
|
161
161
|
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
162
|
+
const typedPart = part as { type?: unknown; text?: unknown };
|
|
163
|
+
if (typedPart.type !== undefined && typedPart.type !== "text") continue;
|
|
164
|
+
if (typeof typedPart.text === "string") parts.push(typedPart.text);
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
return parts.join("\n");
|
|
@@ -173,7 +174,7 @@ function lastAssistantMessage(messages: readonly unknown[]): string | undefined
|
|
|
173
174
|
if ((message as { role?: unknown }).role !== "assistant") continue;
|
|
174
175
|
|
|
175
176
|
const text = extractTextContent((message as { content?: unknown }).content).trim();
|
|
176
|
-
|
|
177
|
+
return text || undefined;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
return undefined;
|