AI: Generate captions using the Ollama API #5011 #5123

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-07-21 10:43:49 +02:00
parent f67ba0e634
commit ae42af54d8
16 changed files with 313 additions and 41 deletions

View File

@@ -33,6 +33,15 @@ func TypeLowerUnderscore(s string) string {
return strings.ReplaceAll(TypeLower(s), " ", "_")
}
// TypeLowerDash converts a string to a lowercase type string and replaces spaces with dashes.
func TypeLowerDash(s string) string {
if s == "" {
return s
}
return strings.ReplaceAll(TypeLower(s), " ", "-")
}
// ShortType omits invalid runes, ensures a maximum length of 8 characters, and returns the result.
func ShortType(s string) string {
if s == "" {