Files
photoprism/internal/ai/vision/api_request.go
Michael Mayer f3e066af45 AI: Add Vision API service endpoint for image classification #127 #1090
This is a proof of concept and still under development. The other
Vision API endpoints are stubs for testing and not yet functional.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-04-07 12:19:39 +02:00

23 lines
640 B
Go

package vision
import (
"github.com/photoprism/photoprism/pkg/rnd"
)
// ApiRequest represents a Vision API service request.
type ApiRequest struct {
Id string `form:"id" yaml:"Id,omitempty" json:"id,omitempty"`
Model string `form:"model" yaml:"Model,omitempty" json:"model,omitempty"`
Images []string `form:"images" yaml:"Images,omitempty" json:"images,omitempty"`
Videos []string `form:"videos" yaml:"Videos,omitempty" json:"videos,omitempty"`
}
// GetId returns the request ID string and generates a random ID if none was set.
func (r *ApiRequest) GetId() string {
if r.Id == "" {
r.Id = rnd.UUID()
}
return r.Id
}