Added Ai Image Analyzer support (#386)

* Added Ai Image Analyzer support

* removed unnecessary null check
This commit is contained in:
Swaggeroo
2024-07-23 09:51:43 +02:00
committed by GitHub
parent 26867000dd
commit 58cc6400e8
5 changed files with 57 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ import {
indexingStep,
IndexingStepType,
type TextExtractorApi,
type AIImageAnalyzerAPI,
} from './globals'
import { notifyOnIndexed, registerAPI } from './tools/api'
import { Database } from './database'
@@ -206,6 +207,14 @@ export default class OmnisearchPlugin extends Plugin {
return (this.app as any).plugins?.plugins?.['text-extractor']?.api
}
/**
* Plugin dependency - Ai Image Analyzer
* @returns
*/
public getAIImageAnalyzer(): AIImageAnalyzerAPI | undefined {
return (this.app as any).plugins?.plugins?.['ai-image-analyzer']?.api
}
private async populateIndex(): Promise<void> {
console.time('Omnisearch - Indexing total time')
indexingStep.set(IndexingStepType.ReadingFiles)