Référence de l'API

Images

Vérifier app.capabilities pour la prise en charge des fonctionnalités et app.access ainsi que les permissions de l’hôte pour les autorisations. Les exemples utilisent des valeurs synthétiques ; remplacer les chemins, ID, entrées et filtres avant tout appel.

Définitions de types

graphql
type Subscription {
  imageModelsUpdated: ImageModelsUpdate!
}

type Mutation {
  cancelImageIndex: Boolean!
  cancelImageModelDownload: Boolean!
  disableImageSearch: Boolean!
  enableImageSearch: Boolean!
  importImageSearchModel: Boolean!
  startImageIndex(force: Boolean): Boolean!
}

type Query {
  imageCount(query: String!): Int!
  imageSearchStatus: ImageSearchStatus!
  images(query: String!, offset: Int!, limit: Int!, sortBy: ImageSortBy!): [Image!]!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

type Image implements MediaItem {
	id: ID!
	title: String!
	path: String!
	size: Long!
	width: Int!
	height: Int!
	rotation: Int!
	bucketId: ID!
	createdAt: Instant!
	updatedAt: Instant!
	takenAt: Instant
	isFavorite: Boolean!
	tags: [Tag!]!
}

type ImageModelsUpdate {
	version: Long!
	status: ImageSearchStatusType!
	downloadProgress: Int!
	errorMessage: String!
	modelSize: Long!
	modelDir: String!
	isIndexing: Boolean!
	totalImages: Int!
	indexedImages: Int!
}

type ImageSearchStatus {
	status: ImageSearchStatusType!
	downloadProgress: Int!
	errorMessage: String!
	modelSize: Long!
	modelDir: String!
	isIndexing: Boolean!
	totalImages: Int!
	indexedImages: Int!
}

enum ImageSearchStatusType {
	UNAVAILABLE
	DOWNLOADING
	LOADING
	READY
	ERROR
}

enum ImageSortBy {
	UPDATED_AT_ASC
	UPDATED_AT_DESC
	SIZE_ASC
	SIZE_DESC
	NAME_ASC
	NAME_DESC
	TAKEN_AT_DESC
}

scalar Instant

scalar Long

interface MediaItem {
	id: ID!
	title: String!
	path: String!
	size: Long!
	bucketId: ID!
	createdAt: Instant!
	updatedAt: Instant!
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

Opérations

subscription

imageModelsUpdated

Recevoir les mises à jour de téléchargement ou de disponibilité du modèle de recherche d’images.

graphql
subscription imageModelsUpdated {
  imageModelsUpdated { version status downloadProgress errorMessage modelSize modelDir isIndexing totalImages }
}
mutation

cancelImageIndex

Annuler l’indexation en cours.

graphql
mutation cancelImageIndex {
  cancelImageIndex
}
mutation

cancelImageModelDownload

Annuler le téléchargement du modèle d’IA en cours.

graphql
mutation cancelImageModelDownload {
  cancelImageModelDownload
}
mutation

disableImageSearch

Désactiver la recherche sémantique d’images par IA et libérer les ressources.

graphql
mutation disableImageSearch {
  disableImageSearch
}
mutation

enableImageSearch

Activer la recherche sémantique d’images par IA. Télécharge le modèle sur l’appareil s’il n’est pas déjà présent.

graphql
mutation enableImageSearch {
  enableImageSearch
}
mutation

importImageSearchModel

Valider et activer un paquet complet de modèle de recherche d’images déjà téléversé.

graphql
mutation importImageSearchModel {
  importImageSearchModel
}
mutation

startImageIndex

Démarrer l’indexation des images pour la recherche par IA. Fournir force=true pour tout réindexer.

graphql
# `force` re-scans images that already have an embedding.
mutation startImageIndex($force: Boolean) {
  startImageIndex(force: $force)
}
query

imageCount

Compter les images correspondant à une requête.

graphql
query imageCount($query: String!) {
  imageCount(query: $query)
}
query

imageSearchStatus

Obtenir l’état actuel de l’indexation pour la recherche sémantique par IA.

graphql
query imageSearchStatus {
  imageSearchStatus { status downloadProgress errorMessage modelSize modelDir isIndexing totalImages indexedImages }
}
query

images

Rechercher dans le catalogue d’images avec filtrage, pagination et tri.

graphql
query images($query: String!, $offset: Int!, $limit: Int!, $sortBy: ImageSortBy!) {
  images(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { id title path size width height rotation bucketId }
}