mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 06:53:43 +00:00
refactor(pi): simplify image reference detection
This commit is contained in:
@@ -63,7 +63,6 @@ describe("detectImageReferences", () => {
|
||||
|
||||
expect(refs).toHaveLength(1);
|
||||
expect(refs.some((r) => r.type === "path")).toBe(true);
|
||||
expect(refs.some((r) => r.type === "url")).toBe(false);
|
||||
});
|
||||
|
||||
it("handles various image extensions", () => {
|
||||
@@ -83,6 +82,17 @@ describe("detectImageReferences", () => {
|
||||
expect(refs).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("dedupe casing follows host filesystem conventions", () => {
|
||||
const prompt = "Look at /tmp/Image.png and /tmp/image.png";
|
||||
const refs = detectImageReferences(prompt);
|
||||
|
||||
if (process.platform === "win32") {
|
||||
expect(refs).toHaveLength(1);
|
||||
return;
|
||||
}
|
||||
expect(refs).toHaveLength(2);
|
||||
});
|
||||
|
||||
it("returns empty array when no images found", () => {
|
||||
const prompt = "Just some text without any image references";
|
||||
const refs = detectImageReferences(prompt);
|
||||
|
||||
Reference in New Issue
Block a user