Launch
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { IdentificationResult, Language } from '../types';
|
||||
import { backendApiClient } from './backend/backendApiClient';
|
||||
import { createIdempotencyKey } from '../utils/idempotency';
|
||||
|
||||
interface IdentifyOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export const PlantRecognitionService = {
|
||||
identify: async (
|
||||
imageUri: string,
|
||||
lang: Language = 'de',
|
||||
options: IdentifyOptions = {},
|
||||
): Promise<IdentificationResult> => {
|
||||
const idempotencyKey = options.idempotencyKey || createIdempotencyKey('scan');
|
||||
const response = await backendApiClient.scanPlant({
|
||||
idempotencyKey,
|
||||
imageUri,
|
||||
language: lang,
|
||||
});
|
||||
|
||||
return response.result;
|
||||
},
|
||||
};
|
||||
import { IdentificationResult, Language } from '../types';
|
||||
import { backendApiClient } from './backend/backendApiClient';
|
||||
import { createIdempotencyKey } from '../utils/idempotency';
|
||||
|
||||
interface IdentifyOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export const PlantRecognitionService = {
|
||||
identify: async (
|
||||
imageUri: string,
|
||||
lang: Language = 'de',
|
||||
options: IdentifyOptions = {},
|
||||
): Promise<IdentificationResult> => {
|
||||
const idempotencyKey = options.idempotencyKey || createIdempotencyKey('scan');
|
||||
const response = await backendApiClient.scanPlant({
|
||||
idempotencyKey,
|
||||
imageUri,
|
||||
language: lang,
|
||||
});
|
||||
|
||||
return response.result;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user