Skip to content

Commit

Permalink
fix: tag format for zhipu output
Browse files Browse the repository at this point in the history
  • Loading branch information
tychenjiajun committed Oct 1, 2024
1 parent 3f2d7cb commit 8618567
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exif-ai",
"version": "3.2.2",
"version": "3.2.3",
"description": "A Node.js CLI and library that uses Ollama, ZhipuAI, Google Gemini, Coze or OpenAI to intelligently write image description and/or tags to exif metadata by it's content.",
"homepage": "https://github.com/tychenjiajun/exif-ai",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/exif-ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function findFilesRecursive(
}
const program = new Command();
program
.version("3.2.2")
.version("3.2.3")
.description(getText("description") ?? "")
.requiredOption("-a, --api-provider <provider>", getText("api-provider"))
.option("-T, --tasks <tasks...>", getText("tasks"))
Expand Down
4 changes: 1 addition & 3 deletions src/provider/zhipu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export async function getDescription({
],
},
],
temperature: 0.5,
}),
},
);
Expand Down Expand Up @@ -129,7 +128,6 @@ export async function getTags({
],
},
],
temperature: 0.5,
}),
},
);
Expand All @@ -146,4 +144,4 @@ export async function getTags({
console.error("An error occurred while getting the tags:", error);
throw error; // Re-throw the error to be handled by the caller
}
}
}
4 changes: 3 additions & 1 deletion src/tasks/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function formatTags(tags: string | string[] | undefined): string[] {
.replaceAll(/[\[\]\.{}<>/*'"()。]/g, "")
.replace(/\n$/g, "")
.replace(/[0-9]+(.*)/g, "$1")
.replace(/[::]*/g, "")
.trim();
}) ?? [])
: (tags
Expand All @@ -37,7 +38,8 @@ function formatTags(tags: string | string[] | undefined): string[] {
s
.trim()
.replace(/\n$/g, "")
.replace(/[0-9]+[ ]+(.*)/g, "$1"),
.replace(/[0-9]+[ ]+(.*)/g, "$1")
.replace(/[::]*/g, ""),
)
.filter(
(s) =>
Expand Down

0 comments on commit 8618567

Please sign in to comment.