diff --git a/apps/computer-vision/app/ocr_vertical/index.tsx b/apps/computer-vision/app/ocr_vertical/index.tsx index 3e78ead6b..f298a3d5c 100644 --- a/apps/computer-vision/app/ocr_vertical/index.tsx +++ b/apps/computer-vision/app/ocr_vertical/index.tsx @@ -1,7 +1,7 @@ import Spinner from '../../components/Spinner'; import { BottomBar } from '../../components/BottomBar'; import { getImage } from '../../utils'; -import { useVerticalOCR, VERTICAL_OCR_ENGLISH } from 'react-native-executorch'; +import { useVerticalOCR, OCR_ENGLISH } from 'react-native-executorch'; import { View, StyleSheet, Image, Text, ScrollView } from 'react-native'; import ImageWithBboxes2 from '../../components/ImageWithOCRBboxes'; import React, { useContext, useEffect, useState } from 'react'; @@ -16,7 +16,7 @@ export default function VerticalOCRScree() { height: number; }>(); const model = useVerticalOCR({ - model: VERTICAL_OCR_ENGLISH, + model: OCR_ENGLISH, independentCharacters: true, }); const { setGlobalGenerating } = useContext(GeneratingContext); diff --git a/docs/docs/03-hooks/01-natural-language-processing/useLLM.md b/docs/docs/03-hooks/01-natural-language-processing/useLLM.md index 0a3bb483f..ffd407b8b 100644 --- a/docs/docs/03-hooks/01-natural-language-processing/useLLM.md +++ b/docs/docs/03-hooks/01-natural-language-processing/useLLM.md @@ -30,6 +30,10 @@ React Native ExecuTorch supports a variety of LLMs (checkout our [HuggingFace re Lower-end devices might not be able to fit LLMs into memory. We recommend using quantized models to reduce the memory footprint. ::: +## API Reference + +For detailed API Reference for `useLLM` see: [useLLM API Reference](../../06-api-reference/functions/useLLM.md) + ## Initializing In order to load a model into the app, you need to run the following code: @@ -58,101 +62,6 @@ The code snippet above fetches the model from the specified URL, loads it into m For more information on loading resources, take a look at [loading models](../../01-fundamentals/02-loading-models.md) page. -### Returns - -| Field | Type | Description | -| ------------------------ | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| `generate()` | `(messages: Message[], tools?: LLMTool[]) => Promise` | Runs model to complete chat passed in `messages` argument. It doesn't manage conversation context. | -| `interrupt()` | `() => void` | Function to interrupt the current inference. | -| `response` | `string` | State of the generated response. This field is updated with each token generated by the model. | -| `token` | `string` | The most recently generated token. | -| `isReady` | `boolean` | Indicates whether the model is ready. | -| `isGenerating` | `boolean` | Indicates whether the model is currently generating a response. | -| `downloadProgress` | `number` | Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. | -| `error` | string | null | Contains the error message if the model failed to load. | -| `configure` | `({chatConfig?: Partial, toolsConfig?: ToolsConfig, generationConfig?: GenerationConfig}) => void` | Configures chat and tool calling. See more details in [configuring the model](#configuring-the-model). | -| `sendMessage` | `(message: string) => Promise` | Function to add user message to conversation. After model responds, `messageHistory` will be updated with both user message and model response. | -| `deleteMessage` | `(index: number) => void` | Deletes all messages starting with message on `index` position. After deletion `messageHistory` will be updated. | -| `messageHistory` | `Message[]` | History containing all messages in conversation. This field is updated after model responds to `sendMessage`. | -| `getGeneratedTokenCount` | `() => number` | Returns the number of tokens generated in the last response. | - -
-Type definitions - -```typescript -const useLLM: ({ - model, - preventLoad, -}: { - model: { - modelSource: ResourceSource; - tokenizerSource: ResourceSource; - tokenizerConfigSource: ResourceSource; - }; - preventLoad?: boolean; -}) => LLMType; - -interface LLMType { - messageHistory: Message[]; - response: string; - token: string; - isReady: boolean; - isGenerating: boolean; - downloadProgress: number; - error: string | null; - configure: ({ - chatConfig, - toolsConfig, - generationConfig, - }: { - chatConfig?: Partial; - toolsConfig?: ToolsConfig; - generationConfig?: GenerationConfig; - }) => void; - getGeneratedTokenCount: () => number; - generate: (messages: Message[], tools?: LLMTool[]) => Promise; - sendMessage: (message: string) => Promise; - deleteMessage: (index: number) => void; - interrupt: () => void; -} - -type ResourceSource = string | number | object; - -type MessageRole = 'user' | 'assistant' | 'system'; - -interface Message { - role: MessageRole; - content: string; -} -interface ChatConfig { - initialMessageHistory: Message[]; - contextWindowLength: number; - systemPrompt: string; -} - -interface GenerationConfig { - temperature?: number; - topp?: number; - outputTokenBatchSize?: number; - batchTimeInterval?: number; -} - -// tool calling -interface ToolsConfig { - tools: LLMTool[]; - executeToolCallback: (call: ToolCall) => Promise; - displayToolCalls?: boolean; -} - -interface ToolCall { - toolName: string; - arguments: Object; -} - -type LLMTool = Object; -``` - -
## Functional vs managed diff --git a/docs/docs/03-hooks/02-computer-vision/useVerticalOCR.md b/docs/docs/03-hooks/02-computer-vision/useVerticalOCR.md index 0ff3dccd8..af4e0aaf1 100644 --- a/docs/docs/03-hooks/02-computer-vision/useVerticalOCR.md +++ b/docs/docs/03-hooks/02-computer-vision/useVerticalOCR.md @@ -15,11 +15,11 @@ It is recommended to use models provided by us, which are available at our [Hugg ## Reference ```tsx -import { useVerticalOCR, VERTICAL_OCR_ENGLISH } from 'react-native-executorch'; +import { useVerticalOCR, OCR_ENGLISH } from 'react-native-executorch'; function App() { const model = useVerticalOCR({ - model: VERTICAL_OCR_ENGLISH, + model: OCR_ENGLISH, independentCharacters: true, }); @@ -180,11 +180,11 @@ The `text` property contains the text recognized within detected text region. Th ## Example ```tsx -import { useVerticalOCR, VERTICAL_OCR_ENGLISH } from 'react-native-executorch'; +import { useVerticalOCR, OCR_ENGLISH } from 'react-native-executorch'; function App() { const model = useVerticalOCR({ - model: VERTICAL_OCR_ENGLISH, + model: OCR_ENGLISH, independentCharacters: true, }); diff --git a/docs/docs/04-typescript-api/02-computer-vision/VerticalOCRModule.md b/docs/docs/04-typescript-api/02-computer-vision/VerticalOCRModule.md index 677b82d32..d92356967 100644 --- a/docs/docs/04-typescript-api/02-computer-vision/VerticalOCRModule.md +++ b/docs/docs/04-typescript-api/02-computer-vision/VerticalOCRModule.md @@ -9,7 +9,7 @@ TypeScript API implementation of the [useVerticalOCR](../../03-hooks/02-computer ```typescript import { VerticalOCRModule, - VERTICAL_OCR_ENGLISH, + OCR_ENGLISH, } from 'react-native-executorch'; const imageUri = 'path/to/image.png'; @@ -18,7 +18,7 @@ const imageUri = 'path/to/image.png'; const verticalOCRModule = new VerticalOCRModule(); // Loading the model -await verticalOCRModule.load(VERTICAL_OCR_ENGLISH); +await verticalOCRModule.load(OCR_ENGLISH); // Running the model const detections = await verticalOCRModule.forward(imageUri); diff --git a/docs/docs/04-typescript-api/04-error-handling.md b/docs/docs/05-utilities/04-error-handling.md similarity index 100% rename from docs/docs/04-typescript-api/04-error-handling.md rename to docs/docs/05-utilities/04-error-handling.md diff --git a/docs/docs/06-api-reference/classes/ClassificationModule.md b/docs/docs/06-api-reference/classes/ClassificationModule.md new file mode 100644 index 000000000..7cb913786 --- /dev/null +++ b/docs/docs/06-api-reference/classes/ClassificationModule.md @@ -0,0 +1,177 @@ +# Class: ClassificationModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ClassificationModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L12) + +Module for image classification tasks. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new ClassificationModule**(): `ClassificationModule` + +#### Returns + +`ClassificationModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`imageSource`): `Promise`\<\{\[`category`: `string`\]: `number`; \}\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ClassificationModule.ts:43](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L43) + +Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + +#### Parameters + +##### imageSource + +`string` + +The image source to be classified. + +#### Returns + +`Promise`\<\{\[`category`: `string`\]: `number`; \}\> + +The classification result. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ClassificationModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L20) + +Loads the model, where `modelSource` is a string that specifies the location of the model binary. +To track the download progress, supply a callback function `onDownloadProgressCallback`. + +#### Parameters + +##### model + +Object containing `modelSource`. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/ExecutorchModule.md b/docs/docs/06-api-reference/classes/ExecutorchModule.md new file mode 100644 index 000000000..174701ce2 --- /dev/null +++ b/docs/docs/06-api-reference/classes/ExecutorchModule.md @@ -0,0 +1,176 @@ +# Class: ExecutorchModule + +Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L13) + +General module for executing custom Executorch models. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new ExecutorchModule**(): `ExecutorchModule` + +#### Returns + +`ExecutorchModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:45](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L45) + +Executes the model's forward pass, where input is an array of `TensorPtr` objects. +If the inference is successful, an array of tensor pointers is returned. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensor pointers. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +An array of output tensor pointers. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`modelSource`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L21) + +Loads the model, where `modelSource` is a string, number, or object that specifies the location of the model binary. +Optionally accepts a download progress callback. + +#### Parameters + +##### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +Source of the model to be loaded. + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/ImageEmbeddingsModule.md b/docs/docs/06-api-reference/classes/ImageEmbeddingsModule.md new file mode 100644 index 000000000..5541edc66 --- /dev/null +++ b/docs/docs/06-api-reference/classes/ImageEmbeddingsModule.md @@ -0,0 +1,176 @@ +# Class: ImageEmbeddingsModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ImageEmbeddingsModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L12) + +Module for generating image embeddings from input images. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new ImageEmbeddingsModule**(): `ImageEmbeddingsModule` + +#### Returns + +`ImageEmbeddingsModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`imageSource`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ImageEmbeddingsModule.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L42) + +Executes the model's forward pass, where `imageSource` is a URI/URL to image that will be embedded. + +#### Parameters + +##### imageSource + +`string` + +The image source to be embedded. + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A Float32Array containing the image embeddings. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ImageEmbeddingsModule.ts:19](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L19) + +Loads the model, where `modelSource` is a string that specifies the location of the model binary. + +#### Parameters + +##### model + +Object containing `modelSource`. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/ImageSegmentationModule.md b/docs/docs/06-api-reference/classes/ImageSegmentationModule.md new file mode 100644 index 000000000..051d4a5ae --- /dev/null +++ b/docs/docs/06-api-reference/classes/ImageSegmentationModule.md @@ -0,0 +1,189 @@ +# Class: ImageSegmentationModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ImageSegmentationModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts#L13) + +Module for image segmentation tasks. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new ImageSegmentationModule**(): `ImageSegmentationModule` + +#### Returns + +`ImageSegmentationModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`imageSource`, `classesOfInterest?`, `resize?`): `Promise`\<`Partial`\<`Record`\<[`DeeplabLabel`](../enumerations/DeeplabLabel.md), `number`[]\>\>\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ImageSegmentationModule.ts:47](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts#L47) + +Executes the model's forward pass + +#### Parameters + +##### imageSource + +`string` + +a fetchable resource or a Base64-encoded string. + +##### classesOfInterest? + +[`DeeplabLabel`](../enumerations/DeeplabLabel.md)[] + +an optional list of DeeplabLabel used to indicate additional arrays of probabilities to output (see section "Running the model"). The default is an empty list. + +##### resize? + +`boolean` + +an optional boolean to indicate whether the output should be resized to the original image dimensions, or left in the size of the model (see section "Running the model"). The default is `false`. + +#### Returns + +`Promise`\<`Partial`\<`Record`\<[`DeeplabLabel`](../enumerations/DeeplabLabel.md), `number`[]\>\>\> + +A dictionary where keys are `DeeplabLabel` and values are arrays of probabilities for each pixel belonging to the corresponding class. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ImageSegmentationModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts#L22) + +Loads the model, where `modelSource` is a string that specifies the location of the model binary. +To track the download progress, supply a callback function `onDownloadProgressCallback`. + +#### Parameters + +##### model + +Object containing `modelSource`. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/LLMModule.md b/docs/docs/06-api-reference/classes/LLMModule.md new file mode 100644 index 000000000..a034bc620 --- /dev/null +++ b/docs/docs/06-api-reference/classes/LLMModule.md @@ -0,0 +1,291 @@ +# Class: LLMModule + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L14) + +Module for managing a Large Language Model (LLM) instance. + +## Constructors + +### Constructor + +> **new LLMModule**(`optionalCallbacks`): `LLMModule` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L23) + +Creates a new instance of LLMModule with optional callbacks. + +#### Parameters + +##### optionalCallbacks + +Object containing optional callbacks. + +###### messageHistoryCallback? + +(`messageHistory`) => `void` + +Optional callback invoked on message history updates (`Message[]`). + +###### responseCallback? + +(`response`) => `void` + +Optional callback invoked on every response update (`string`). + +###### tokenCallback? + +(`token`) => `void` + +Optional callback invoked on every token batch (`string`). + +#### Returns + +`LLMModule` + +A new LLMModule instance. + +## Methods + +### configure() + +> **configure**(`configuration`): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:90](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L90) + +Configures chat and tool calling and generation settings. +See [Configuring the model](../../03-hooks/01-natural-language-processing/useLLM.md#configuring-the-model) for details. + +#### Parameters + +##### configuration + +[`LLMConfig`](../interfaces/LLMConfig.md) + +Configuration object containing `chatConfig`, `toolsConfig`, and `generationConfig`. + +#### Returns + +`void` + +*** + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:171](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L171) + +Method to delete the model from memory. +Note you cannot delete model while it's generating. +You need to interrupt it first and make sure model stopped generation. + +#### Returns + +`void` + +*** + +### deleteMessage() + +> **deleteMessage**(`index`): [`Message`](../interfaces/Message.md)[] + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:145](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L145) + +Deletes all messages starting with message on `index` position. +After deletion it will call `messageHistoryCallback()` containing new history. +It also returns it. + +#### Parameters + +##### index + +`number` + +The index of the message to delete from history. + +#### Returns + +[`Message`](../interfaces/Message.md)[] + +- Updated message history after deletion. + +*** + +### forward() + +> **forward**(`input`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:107](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L107) + +Runs model inference with raw input string. +You need to provide entire conversation and prompt (in correct format and with special tokens!) in input string to this method. +It doesn't manage conversation context. It is intended for users that need access to the model itself without any wrapper. +If you want a simple chat with model the consider using `sendMessage` + +#### Parameters + +##### input + +`string` + +Raw input string containing the prompt and conversation history. + +#### Returns + +`Promise`\<`string`\> + +The generated response as a string. + +*** + +### generate() + +> **generate**(`messages`, `tools?`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:119](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L119) + +Runs model to complete chat passed in `messages` argument. It doesn't manage conversation context. + +#### Parameters + +##### messages + +[`Message`](../interfaces/Message.md)[] + +Array of messages representing the chat history. + +##### tools? + +`Object`[] + +Optional array of tools that can be used during generation. + +#### Returns + +`Promise`\<`string`\> + +The generated response as a string. + +*** + +### getGeneratedTokenCount() + +> **getGeneratedTokenCount**(): `number` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:162](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L162) + +Returns the number of tokens generated in the last response. + +#### Returns + +`number` + +The count of generated tokens. + +*** + +### interrupt() + +> **interrupt**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:153](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L153) + +Interrupts model generation. It may return one more token after interrupt. + +#### Returns + +`void` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:57](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L57) + +Loads the LLM model and tokenizer. + +#### Parameters + +##### model + +Object containing model, tokenizer, and tokenizer config sources. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the model binary. + +###### tokenizerConfigSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` pointing to the JSON file which contains the tokenizer config. + +###### tokenizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` pointing to the JSON file which contains the tokenizer. + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to track download progress (value between 0 and 1). + +#### Returns + +`Promise`\<`void`\> + +*** + +### sendMessage() + +> **sendMessage**(`message`): `Promise`\<[`Message`](../interfaces/Message.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:132](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L132) + +Method to add user message to conversation. +After model responds it will call `messageHistoryCallback()` containing both user message and model response. +It also returns them. + +#### Parameters + +##### message + +`string` + +The message string to send. + +#### Returns + +`Promise`\<[`Message`](../interfaces/Message.md)[]\> + +- Updated message history including the new user message and model response. + +*** + +### setTokenCallback() + +> **setTokenCallback**(`tokenCallback`): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/LLMModule.ts:76](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L76) + +Sets new token callback invoked on every token batch. + +#### Parameters + +##### tokenCallback + +Callback function to handle new tokens. + +###### tokenCallback + +(`token`) => `void` + +#### Returns + +`void` diff --git a/docs/docs/06-api-reference/classes/OCRModule.md b/docs/docs/06-api-reference/classes/OCRModule.md new file mode 100644 index 000000000..3fc3af5e2 --- /dev/null +++ b/docs/docs/06-api-reference/classes/OCRModule.md @@ -0,0 +1,96 @@ +# Class: OCRModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/OCRModule.ts:10](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts#L10) + +Module for Optical Character Recognition (OCR) tasks. + +## Constructors + +### Constructor + +> **new OCRModule**(): `OCRModule` + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/OCRModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts#L13) + +#### Returns + +`OCRModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/OCRModule.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts#L55) + +Release the memory held by the module. Calling `forward` afterwards is invalid. +Note that you cannot delete model while it's generating. + +#### Returns + +`void` + +*** + +### forward() + +> **forward**(`imageSource`): `Promise`\<`any`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/OCRModule.ts:47](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts#L47) + +Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + +#### Parameters + +##### imageSource + +`string` + +The image source to be processed. + +#### Returns + +`Promise`\<`any`\> + +The OCR result as a string. + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/OCRModule.ts:25](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts#L25) + +Loads the model, where `detectorSource` is a string that specifies the location of the detector binary, +`recognizerSource` is a string that specifies the location of the recognizer binary, +and `language` is a parameter that specifies the language of the text to be recognized by the OCR. + +#### Parameters + +##### model + +Object containing `detectorSource`, `recognizerSource`, and `language`. + +###### detectorSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +###### language + +`"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +###### recognizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/docs/06-api-reference/classes/ObjectDetectionModule.md b/docs/docs/06-api-reference/classes/ObjectDetectionModule.md new file mode 100644 index 000000000..ebd0ffa10 --- /dev/null +++ b/docs/docs/06-api-reference/classes/ObjectDetectionModule.md @@ -0,0 +1,184 @@ +# Class: ObjectDetectionModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ObjectDetectionModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts#L13) + +Module for object detection tasks. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new ObjectDetectionModule**(): `ObjectDetectionModule` + +#### Returns + +`ObjectDetectionModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`imageSource`, `detectionThreshold`): `Promise`\<[`Detection`](../interfaces/Detection.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ObjectDetectionModule.ts:47](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts#L47) + +Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. +`detectionThreshold` can be supplied to alter the sensitivity of the detection. + +#### Parameters + +##### imageSource + +`string` + +The image source to be processed. + +##### detectionThreshold + +`number` = `0.7` + +The threshold for detection sensitivity. Default is 0.7. + +#### Returns + +`Promise`\<[`Detection`](../interfaces/Detection.md)[]\> + +An array of Detection objects representing detected items in the image. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/ObjectDetectionModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts#L22) + +Loads the model, where `modelSource` is a string that specifies the location of the model binary. +To track the download progress, supply a callback function `onDownloadProgressCallback`. + +#### Parameters + +##### model + +Object containing `modelSource`. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/ResourceFetcher.md b/docs/docs/06-api-reference/classes/ResourceFetcher.md new file mode 100644 index 000000000..5c4425015 --- /dev/null +++ b/docs/docs/06-api-reference/classes/ResourceFetcher.md @@ -0,0 +1,208 @@ +# Class: ResourceFetcher + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:63](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L63) + +This module provides functions to download and work with downloaded files stored in the application's document directory inside the `react-native-executorch/` directory. +These utilities can help you manage your storage and clean up the downloaded files when they are no longer needed. + +## Constructors + +### Constructor + +> **new ResourceFetcher**(): `ResourceFetcher` + +#### Returns + +`ResourceFetcher` + +## Properties + +### downloads + +> `static` **downloads**: `Map`\<[`ResourceSource`](../type-aliases/ResourceSource.md), `DownloadResource`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L64) + +## Methods + +### cancelFetching() + +> `static` **cancelFetching**(...`sources`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:284](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L284) + +Cancels an ongoing/paused download of files. + +#### Parameters + +##### sources + +...[`ResourceSource`](../type-aliases/ResourceSource.md)[] + +The resource identifiers used when calling `fetch()`. + +#### Returns + +`Promise`\<`void`\> + +A promise that resolves once the download is canceled. + +*** + +### deleteResources() + +> `static` **deleteResources**(...`sources`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:327](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L327) + +Deletes downloaded resources from the local filesystem. + +#### Parameters + +##### sources + +...[`ResourceSource`](../type-aliases/ResourceSource.md)[] + +The resource identifiers used when calling `fetch`. + +#### Returns + +`Promise`\<`void`\> + +A promise that resolves once all specified resources have been removed. + +*** + +### fetch() + +> `static` **fetch**(`callback`, ...`sources`): `Promise`\<`string`[] \| `null`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:74](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L74) + +Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch. + +#### Parameters + +##### callback + +(`downloadProgress`) => `void` + +Optional callback to track progress of all downloads, reported between 0 and 1. + +##### sources + +...[`ResourceSource`](../type-aliases/ResourceSource.md)[] + +Multiple resources that can be strings, asset references, or objects. + +#### Returns + +`Promise`\<`string`[] \| `null`\> + +If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded/stored resources (without file:// prefix). +If the fetch was interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`. + +*** + +### getFilesTotalSize() + +> `static` **getFilesTotalSize**(...`sources`): `Promise`\<`number`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:345](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L345) + +Fetches the info about files size. Works only for remote files. + +#### Parameters + +##### sources + +...[`ResourceSource`](../type-aliases/ResourceSource.md)[] + +The resource identifiers (URLs). + +#### Returns + +`Promise`\<`number`\> + +A promise that resolves to combined size of files in bytes. + +*** + +### listDownloadedFiles() + +> `static` **listDownloadedFiles**(): `Promise`\<`string`[]\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:306](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L306) + +Lists all the downloaded files used by React Native ExecuTorch. + +#### Returns + +`Promise`\<`string`[]\> + +A promise, which resolves to an array of URIs for all the downloaded files. + +*** + +### listDownloadedModels() + +> `static` **listDownloadedModels**(): `Promise`\<`string`[]\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:316](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L316) + +Lists all the downloaded models used by React Native ExecuTorch. + +#### Returns + +`Promise`\<`string`[]\> + +A promise, which resolves to an array of URIs for all the downloaded models. + +*** + +### pauseFetching() + +> `static` **pauseFetching**(...`sources`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:261](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L261) + +Pauses an ongoing download of files. + +#### Parameters + +##### sources + +...[`ResourceSource`](../type-aliases/ResourceSource.md)[] + +The resource identifiers used when calling `fetch`. + +#### Returns + +`Promise`\<`void`\> + +A promise that resolves once the download is paused. + +*** + +### resumeFetching() + +> `static` **resumeFetching**(...`sources`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/utils/ResourceFetcher.ts:273](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L273) + +Resumes a paused download of files. + +#### Parameters + +##### sources + +...[`ResourceSource`](../type-aliases/ResourceSource.md)[] + +The resource identifiers used when calling fetch. + +#### Returns + +`Promise`\<`void`\> + +If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded resources (without file:// prefix). +If the fetch was again interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`. diff --git a/docs/docs/06-api-reference/classes/RnExecutorchError.md b/docs/docs/06-api-reference/classes/RnExecutorchError.md new file mode 100644 index 000000000..63c706b55 --- /dev/null +++ b/docs/docs/06-api-reference/classes/RnExecutorchError.md @@ -0,0 +1,245 @@ +# Class: RnExecutorchError + +Defined in: [packages/react-native-executorch/src/errors/errorUtils.ts:6](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/errorUtils.ts#L6) + +Custom error class for React Native ExecuTorch errors. + +## Extends + +- `Error` + +## Constructors + +### Constructor + +> **new RnExecutorchError**(`code`, `message`, `cause?`): `RnExecutorchError` + +Defined in: [packages/react-native-executorch/src/errors/errorUtils.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/errorUtils.ts#L17) + +#### Parameters + +##### code + +`number` + +##### message + +`string` + +##### cause? + +`unknown` + +#### Returns + +`RnExecutorchError` + +#### Overrides + +`Error.constructor` + +## Properties + +### cause? + +> `optional` **cause**: `unknown` + +Defined in: [packages/react-native-executorch/src/errors/errorUtils.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/errorUtils.ts#L15) + +The original cause of the error, if any. + +#### Overrides + +`Error.cause` + +*** + +### code + +> **code**: [`RnExecutorchErrorCode`](../enumerations/RnExecutorchErrorCode.md) + +Defined in: [packages/react-native-executorch/src/errors/errorUtils.ts:10](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/errorUtils.ts#L10) + +The error code representing the type of error. + +*** + +### message + +> **message**: `string` + +Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 + +#### Inherited from + +`Error.message` + +*** + +### name + +> **name**: `string` + +Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +`Error.name` + +*** + +### stack? + +> `optional` **stack**: `string` + +Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 + +#### Inherited from + +`Error.stack` + +*** + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +Defined in: node\_modules/@types/node/globals.d.ts:68 + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### Inherited from + +`Error.stackTraceLimit` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Defined in: node\_modules/@types/node/globals.d.ts:52 + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +`Error.captureStackTrace` + +*** + +### isError() + +> `static` **isError**(`error`): `error is Error` + +Defined in: node\_modules/typescript/lib/lib.esnext.error.d.ts:23 + +Indicates whether the argument provided is a built-in Error instance or not. + +#### Parameters + +##### error + +`unknown` + +#### Returns + +`error is Error` + +#### Inherited from + +`Error.isError` + +*** + +### prepareStackTrace() + +> `static` **prepareStackTrace**(`err`, `stackTraces`): `any` + +Defined in: node\_modules/@types/node/globals.d.ts:56 + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +`Error.prepareStackTrace` diff --git a/docs/docs/06-api-reference/classes/SpeechToTextModule.md b/docs/docs/06-api-reference/classes/SpeechToTextModule.md new file mode 100644 index 000000000..b27452f13 --- /dev/null +++ b/docs/docs/06-api-reference/classes/SpeechToTextModule.md @@ -0,0 +1,207 @@ +# Class: SpeechToTextModule + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L12) + +Module for Speech to Text (STT) functionalities. + +## Constructors + +### Constructor + +> **new SpeechToTextModule**(): `SpeechToTextModule` + +#### Returns + +`SpeechToTextModule` + +## Methods + +### decode() + +> **decode**(`tokens`, `encoderOutput`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:96](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L96) + +Runs the decoder of the model. Passing number[] is deprecated. + +#### Parameters + +##### tokens + +The input tokens. + +`number`[] | `Int32Array`\<`ArrayBufferLike`\> + +##### encoderOutput + +The encoder output. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Decoded output. + +*** + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:66](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L66) + +Unloads the model from memory. + +#### Returns + +`void` + +*** + +### encode() + +> **encode**(`waveform`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:77](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L77) + +Runs the encoding part of the model on the provided waveform. +Returns the encoded waveform as a Float32Array. Passing `number[]` is deprecated. + +#### Parameters + +##### waveform + +The input audio waveform. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +The encoded output. + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:29](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L29) + +Loads the model specified by the config object. +`onDownloadProgressCallback` allows you to monitor the current progress of the model download. + +#### Parameters + +##### model + +[`SpeechToTextModelConfig`](../interfaces/SpeechToTextModelConfig.md) + +Configuration object containing model sources. + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +*** + +### stream() + +> **stream**(`options`): `AsyncGenerator`\<\{ `committed`: `string`; `nonCommitted`: `string`; \}\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:153](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L153) + +Starts a streaming transcription session. +Yields objects with `committed` and `nonCommitted` transcriptions. +Use with `streamInsert` and `streamStop` to control the stream. + +#### Parameters + +##### options + +[`DecodingOptions`](../interfaces/DecodingOptions.md) = `{}` + +Decoding options including language. + +#### Returns + +`AsyncGenerator`\<\{ `committed`: `string`; `nonCommitted`: `string`; \}\> + +An async generator yielding transcription updates. + +*** + +### streamInsert() + +> **streamInsert**(`waveform`): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:213](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L213) + +Inserts a new audio chunk into the streaming transcription session. Passing `number[]` is deprecated. + +#### Parameters + +##### waveform + +The audio chunk to insert. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +#### Returns + +`void` + +*** + +### streamStop() + +> **streamStop**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:226](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L226) + +Stops the current streaming transcription session. + +#### Returns + +`void` + +*** + +### transcribe() + +> **transcribe**(`waveform`, `options`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/SpeechToTextModule.ts:126](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts#L126) + +Starts a transcription process for a given input array (16kHz waveform). +For multilingual models, specify the language in `options`. +Returns the transcription as a string. Passing `number[]` is deprecated. + +#### Parameters + +##### waveform + +The Float32Array audio data. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +##### options + +[`DecodingOptions`](../interfaces/DecodingOptions.md) = `{}` + +Decoding options including language. + +#### Returns + +`Promise`\<`string`\> + +The transcription string. diff --git a/docs/docs/06-api-reference/classes/StyleTransferModule.md b/docs/docs/06-api-reference/classes/StyleTransferModule.md new file mode 100644 index 000000000..637311211 --- /dev/null +++ b/docs/docs/06-api-reference/classes/StyleTransferModule.md @@ -0,0 +1,177 @@ +# Class: StyleTransferModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/StyleTransferModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts#L12) + +Module for style transfer tasks. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new StyleTransferModule**(): `StyleTransferModule` + +#### Returns + +`StyleTransferModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`imageSource`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/StyleTransferModule.ts:43](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts#L43) + +Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + +#### Parameters + +##### imageSource + +`string` + +The image source to be processed. + +#### Returns + +`Promise`\<`string`\> + +The stylized image as a Base64-encoded string. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/StyleTransferModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts#L20) + +Loads the model, where `modelSource` is a string that specifies the location of the model binary. +To track the download progress, supply a callback function `onDownloadProgressCallback`. + +#### Parameters + +##### model + +Object containing `modelSource`. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/TextEmbeddingsModule.md b/docs/docs/06-api-reference/classes/TextEmbeddingsModule.md new file mode 100644 index 000000000..a598f7f5a --- /dev/null +++ b/docs/docs/06-api-reference/classes/TextEmbeddingsModule.md @@ -0,0 +1,184 @@ +# Class: TextEmbeddingsModule + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextEmbeddingsModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts#L12) + +Module for generating text embeddings from input text. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new TextEmbeddingsModule**(): `TextEmbeddingsModule` + +#### Returns + +`TextEmbeddingsModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`input`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextEmbeddingsModule.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts#L55) + +Executes the model's forward pass, where `input` is a text that will be embedded. + +#### Parameters + +##### input + +`string` + +The text string to embed. + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A Float32Array containing the vector embeddings. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextEmbeddingsModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts#L22) + +Loads the model and tokenizer specified by the config object. + +#### Parameters + +##### model + +Object containing model and tokenizer sources. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the text embeddings model binary. + +###### tokenizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the tokenizer JSON file. + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to track download progress (value between 0 and 1). + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/TextToImageModule.md b/docs/docs/06-api-reference/classes/TextToImageModule.md new file mode 100644 index 000000000..c17e47797 --- /dev/null +++ b/docs/docs/06-api-reference/classes/TextToImageModule.md @@ -0,0 +1,237 @@ +# Class: TextToImageModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/TextToImageModule.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L14) + +Module for text-to-image generation tasks. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new TextToImageModule**(`inferenceCallback?`): `TextToImageModule` + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/TextToImageModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L22) + +Creates a new instance of `TextToImageModule` with optional callback on inference step. + +#### Parameters + +##### inferenceCallback? + +(`stepIdx`) => `void` + +Optional callback function that receives the current step index during inference. + +#### Returns + +`TextToImageModule` + +#### Overrides + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`input`, `imageSize`, `numSteps`, `seed?`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/TextToImageModule.ts:100](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L100) + +Runs the model to generate an image described by `input`, and conditioned by `seed`, performing `numSteps` inference steps. +The resulting image, with dimensions `imageSize`×`imageSize` pixels, is returned as a base64-encoded string. + +#### Parameters + +##### input + +`string` + +The text prompt to generate the image from. + +##### imageSize + +`number` = `512` + +The desired width and height of the output image in pixels. + +##### numSteps + +`number` = `5` + +The number of inference steps to perform. + +##### seed? + +`number` + +An optional seed for random number generation to ensure reproducibility. + +#### Returns + +`Promise`\<`string`\> + +A Base64-encoded string representing the generated PNG image. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### interrupt() + +> **interrupt**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/TextToImageModule.ts:127](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L127) + +Interrupts model generation. The model is stopped in the nearest step. + +#### Returns + +`void` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/TextToImageModule.ts:35](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts#L35) + +Loads the model from specified resources. + +#### Parameters + +##### model + +Object containing sources for tokenizer, scheduler, encoder, unet, and decoder. + +###### decoderSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +###### encoderSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +###### schedulerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +###### tokenizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +###### unetSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/TextToSpeechModule.md b/docs/docs/06-api-reference/classes/TextToSpeechModule.md new file mode 100644 index 000000000..6ff5ad51f --- /dev/null +++ b/docs/docs/06-api-reference/classes/TextToSpeechModule.md @@ -0,0 +1,137 @@ +# Class: TextToSpeechModule + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:16](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L16) + +Module for Text to Speech (TTS) functionalities. + +## Constructors + +### Constructor + +> **new TextToSpeechModule**(): `TextToSpeechModule` + +#### Returns + +`TextToSpeechModule` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L20) + +Native module instance + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:166](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L166) + +Unloads the model from memory. + +#### Returns + +`void` + +*** + +### forward() + +> **forward**(`text`, `speed`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:99](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L99) + +Synthesizes the provided text into speech. +Returns a promise that resolves to the full audio waveform as a `Float32Array`. + +#### Parameters + +##### text + +`string` + +The input text to be synthesized. + +##### speed + +`number` = `1.0` + +Optional speed multiplier for the speech synthesis (default is 1.0). + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A promise resolving to the synthesized audio waveform. + +*** + +### load() + +> **load**(`config`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:29](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L29) + +Loads the model and voice assets specified by the config object. +`onDownloadProgressCallback` allows you to monitor the current progress. + +#### Parameters + +##### config + +[`TextToSpeechConfig`](../interfaces/TextToSpeechConfig.md) + +Configuration object containing `model` source, `voice` and optional `preventLoad`. + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +*** + +### stream() + +> **stream**(`input`): `AsyncGenerator`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:114](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L114) + +Starts a streaming synthesis session. Yields audio chunks as they are generated. + +#### Parameters + +##### input + +[`TextToSpeechStreamingInput`](../interfaces/TextToSpeechStreamingInput.md) + +Input object containing text and optional speed. + +#### Returns + +`AsyncGenerator`\<`Float32Array`\<`ArrayBufferLike`\>\> + +An async generator yielding Float32Array audio chunks. + +*** + +### streamStop() + +> **streamStop**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TextToSpeechModule.ts:159](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L159) + +Stops the streaming process if there is any ongoing. + +#### Returns + +`void` diff --git a/docs/docs/06-api-reference/classes/TokenizerModule.md b/docs/docs/06-api-reference/classes/TokenizerModule.md new file mode 100644 index 000000000..c7ed096dc --- /dev/null +++ b/docs/docs/06-api-reference/classes/TokenizerModule.md @@ -0,0 +1,174 @@ +# Class: TokenizerModule + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:11](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L11) + +Module for Tokenizer functionalities. + +## Constructors + +### Constructor + +> **new TokenizerModule**(): `TokenizerModule` + +#### Returns + +`TokenizerModule` + +## Properties + +### nativeModule + +> **nativeModule**: `any` + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L15) + +Native module instance + +## Methods + +### decode() + +> **decode**(`tokens`, `skipSpecialTokens`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:59](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L59) + +Converts an array of token IDs into a string. + +#### Parameters + +##### tokens + +`number`[] + +Array of token IDs to be decoded. + +##### skipSpecialTokens + +`boolean` = `true` + +Whether to skip special tokens during decoding (default: true). + +#### Returns + +`Promise`\<`string`\> + +The decoded string. + +*** + +### encode() + +> **encode**(`input`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L48) + +Converts a string into an array of token IDs. + +#### Parameters + +##### input + +`string` + +The input string to be tokenized. + +#### Returns + +`Promise`\<`number`[]\> + +An array of token IDs. + +*** + +### getVocabSize() + +> **getVocabSize**(): `Promise`\<`number`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:71](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L71) + +Returns the size of the tokenizer's vocabulary. + +#### Returns + +`Promise`\<`number`\> + +The vocabulary size. + +*** + +### idToToken() + +> **idToToken**(`tokenId`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:81](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L81) + +Returns the token associated to the ID. + +#### Parameters + +##### tokenId + +`number` + +ID of the token. + +#### Returns + +`Promise`\<`string`\> + +The token string associated to ID. + +*** + +### load() + +> **load**(`tokenizer`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:24](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L24) + +Loads the tokenizer from the specified source. +`tokenizerSource` is a string that points to the location of the tokenizer JSON file. + +#### Parameters + +##### tokenizer + +Object containing `tokenizerSource`. + +###### tokenizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +*** + +### tokenToId() + +> **tokenToId**(`token`): `Promise`\<`number`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/TokenizerModule.ts:91](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts#L91) + +Returns the ID associated to the token. + +#### Parameters + +##### token + +`string` + +The token string. + +#### Returns + +`Promise`\<`number`\> + +The ID associated to the token. diff --git a/docs/docs/06-api-reference/classes/VADModule.md b/docs/docs/06-api-reference/classes/VADModule.md new file mode 100644 index 000000000..8bf2ecd35 --- /dev/null +++ b/docs/docs/06-api-reference/classes/VADModule.md @@ -0,0 +1,177 @@ +# Class: VADModule + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/VADModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts#L13) + +Module for Voice Activity Detection (VAD) functionalities. + +## Extends + +- `BaseModule` + +## Constructors + +### Constructor + +> **new VADModule**(): `VADModule` + +#### Returns + +`VADModule` + +#### Inherited from + +`BaseModule.constructor` + +## Properties + +### nativeModule + +> **nativeModule**: `any` = `null` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L8) + +Native module instance + +#### Inherited from + +`BaseModule.nativeModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L41) + +Unloads the model from memory. + +#### Returns + +`void` + +#### Inherited from + +`BaseModule.delete` + +*** + +### forward() + +> **forward**(`waveform`): `Promise`\<[`Segment`](../interfaces/Segment.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/VADModule.ts:44](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts#L44) + +Executes the model's forward pass, where `waveform` is a Float32Array representing the audio signal. + +#### Parameters + +##### waveform + +`Float32Array` + +The input audio waveform as a Float32Array. + +#### Returns + +`Promise`\<[`Segment`](../interfaces/Segment.md)[]\> + +A promise resolving to an array of detected speech segments. + +*** + +### forwardET() + +> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L23) + +Runs the model's forward method with the given input tensors. +It returns the output tensors that mimic the structure of output from ExecuTorch. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](../interfaces/TensorPtr.md)[] + +Array of input tensors. + +#### Returns + +`Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\> + +Array of output tensors. + +#### Inherited from + +`BaseModule.forwardET` + +*** + +### getInputShape() + +> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/BaseModule.ts#L34) + +Gets the input shape for a given method and index. + +#### Parameters + +##### methodName + +`string` + +method name + +##### index + +`number` + +index of the argument which shape is requested + +#### Returns + +`Promise`\<`number`[]\> + +The input shape as an array of numbers. + +#### Inherited from + +`BaseModule.getInputShape` + +*** + +### load() + +> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/natural\_language\_processing/VADModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts#L21) + +Loads the model, where `modelSource` is a string that specifies the location of the model binary. +To track the download progress, supply a callback function `onDownloadProgressCallback`. + +#### Parameters + +##### model + +Object containing `modelSource`. + +###### modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`BaseModule.load` diff --git a/docs/docs/06-api-reference/classes/VerticalOCRModule.md b/docs/docs/06-api-reference/classes/VerticalOCRModule.md new file mode 100644 index 000000000..de1bacdcb --- /dev/null +++ b/docs/docs/06-api-reference/classes/VerticalOCRModule.md @@ -0,0 +1,102 @@ +# Class: VerticalOCRModule + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/VerticalOCRModule.ts:10](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts#L10) + +Module for Vertical Optical Character Recognition (Vertical OCR) tasks. + +## Constructors + +### Constructor + +> **new VerticalOCRModule**(): `VerticalOCRModule` + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/VerticalOCRModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts#L13) + +#### Returns + +`VerticalOCRModule` + +## Methods + +### delete() + +> **delete**(): `void` + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/VerticalOCRModule.ts:58](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts#L58) + +Release the memory held by the module. Calling `forward` afterwards is invalid. +Note that you cannot delete model while it's generating. + +#### Returns + +`void` + +*** + +### forward() + +> **forward**(`imageSource`): `Promise`\<`any`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/VerticalOCRModule.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts#L50) + +Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + +#### Parameters + +##### imageSource + +`string` + +The image source to be processed. + +#### Returns + +`Promise`\<`any`\> + +The OCR result as a string. + +*** + +### load() + +> **load**(`model`, `independentCharacters`, `onDownloadProgressCallback`): `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/modules/computer\_vision/VerticalOCRModule.ts:26](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts#L26) + +Loads the model, where `detectorSource` is a string that specifies the location of the detector binary, +`recognizerSource` is a string that specifies the location of the recognizer binary, +and `language` is a parameter that specifies the language of the text to be recognized by the OCR. + +#### Parameters + +##### model + +Object containing `detectorSource`, `recognizerSource`, and `language`. + +###### detectorSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +###### language + +`"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +###### recognizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +##### independentCharacters + +`boolean` + +Whether to treat characters independently during recognition. + +##### onDownloadProgressCallback + +(`progress`) => `void` + +Optional callback to monitor download progress. + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/docs/06-api-reference/enumerations/CocoLabel.md b/docs/docs/06-api-reference/enumerations/CocoLabel.md new file mode 100644 index 000000000..edf9ac52b --- /dev/null +++ b/docs/docs/06-api-reference/enumerations/CocoLabel.md @@ -0,0 +1,725 @@ +# Enumeration: CocoLabel + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:39](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L39) + +COCO dataset class labels used for object detection. + +## Enumeration Members + +### AIRPLANE + +> **AIRPLANE**: `5` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:44](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L44) + +*** + +### APPLE + +> **APPLE**: `53` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:91](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L91) + +*** + +### BACKPACK + +> **BACKPACK**: `27` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:66](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L66) + +*** + +### BANANA + +> **BANANA**: `52` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:90](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L90) + +*** + +### BASEBALL + +> **BASEBALL**: `39` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:78](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L78) + +*** + +### BEAR + +> **BEAR**: `23` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:62](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L62) + +*** + +### BED + +> **BED**: `65` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:103](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L103) + +*** + +### BENCH + +> **BENCH**: `15` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:54](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L54) + +*** + +### BICYCLE + +> **BICYCLE**: `2` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L41) + +*** + +### BIRD + +> **BIRD**: `16` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L55) + +*** + +### BLENDER + +> **BLENDER**: `83` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:121](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L121) + +*** + +### BOAT + +> **BOAT**: `9` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L48) + +*** + +### BOOK + +> **BOOK**: `84` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:122](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L122) + +*** + +### BOTTLE + +> **BOTTLE**: `44` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:82](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L82) + +*** + +### BOWL + +> **BOWL**: `51` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:89](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L89) + +*** + +### BROCCOLI + +> **BROCCOLI**: `56` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:94](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L94) + +*** + +### BUS + +> **BUS**: `6` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:45](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L45) + +*** + +### CAKE + +> **CAKE**: `61` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:99](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L99) + +*** + +### CAR + +> **CAR**: `3` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L42) + +*** + +### CARROT + +> **CARROT**: `57` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:95](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L95) + +*** + +### CAT + +> **CAT**: `17` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:56](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L56) + +*** + +### CELL\_PHONE + +> **CELL\_PHONE**: `77` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:115](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L115) + +*** + +### CHAIR + +> **CHAIR**: `62` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:100](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L100) + +*** + +### CLOCK + +> **CLOCK**: `85` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:123](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L123) + +*** + +### COUCH + +> **COUCH**: `63` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:101](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L101) + +*** + +### COW + +> **COW**: `21` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:60](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L60) + +*** + +### CUP + +> **CUP**: `47` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:85](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L85) + +*** + +### DESK + +> **DESK**: `69` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:107](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L107) + +*** + +### DINING\_TABLE + +> **DINING\_TABLE**: `67` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:105](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L105) + +*** + +### DOG + +> **DOG**: `18` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:57](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L57) + +*** + +### DONUT + +> **DONUT**: `60` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:98](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L98) + +*** + +### DOOR + +> **DOOR**: `71` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:109](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L109) + +*** + +### ELEPHANT + +> **ELEPHANT**: `22` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:61](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L61) + +*** + +### EYE + +> **EYE**: `30` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:69](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L69) + +*** + +### FIRE\_HYDRANT + +> **FIRE\_HYDRANT**: `11` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L50) + +*** + +### FORK + +> **FORK**: `48` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:86](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L86) + +*** + +### FRISBEE + +> **FRISBEE**: `34` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:73](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L73) + +*** + +### GIRAFFE + +> **GIRAFFE**: `25` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L64) + +*** + +### HAIR\_BRUSH + +> **HAIR\_BRUSH**: `91` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:129](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L129) + +*** + +### HAIR\_DRIER + +> **HAIR\_DRIER**: `89` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:127](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L127) + +*** + +### HANDBAG + +> **HANDBAG**: `31` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:70](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L70) + +*** + +### HAT + +> **HAT**: `26` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:65](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L65) + +*** + +### HORSE + +> **HORSE**: `19` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:58](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L58) + +*** + +### HOT\_DOG + +> **HOT\_DOG**: `58` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:96](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L96) + +*** + +### KEYBOARD + +> **KEYBOARD**: `76` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:114](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L114) + +*** + +### KITE + +> **KITE**: `38` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:77](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L77) + +*** + +### KNIFE + +> **KNIFE**: `49` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:87](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L87) + +*** + +### LAPTOP + +> **LAPTOP**: `73` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:111](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L111) + +*** + +### MICROWAVE + +> **MICROWAVE**: `78` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:116](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L116) + +*** + +### MIRROR + +> **MIRROR**: `66` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:104](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L104) + +*** + +### MOTORCYCLE + +> **MOTORCYCLE**: `4` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:43](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L43) + +*** + +### MOUSE + +> **MOUSE**: `74` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:112](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L112) + +*** + +### ORANGE + +> **ORANGE**: `55` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:93](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L93) + +*** + +### OVEN + +> **OVEN**: `79` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:117](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L117) + +*** + +### PARKING + +> **PARKING**: `14` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:53](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L53) + +*** + +### PERSON + +> **PERSON**: `1` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:40](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L40) + +*** + +### PIZZA + +> **PIZZA**: `59` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:97](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L97) + +*** + +### PLATE + +> **PLATE**: `45` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:83](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L83) + +*** + +### POTTED\_PLANT + +> **POTTED\_PLANT**: `64` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:102](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L102) + +*** + +### REFRIGERATOR + +> **REFRIGERATOR**: `82` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:120](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L120) + +*** + +### REMOTE + +> **REMOTE**: `75` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:113](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L113) + +*** + +### SANDWICH + +> **SANDWICH**: `54` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:92](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L92) + +*** + +### SCISSORS + +> **SCISSORS**: `87` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:125](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L125) + +*** + +### SHEEP + +> **SHEEP**: `20` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:59](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L59) + +*** + +### SHOE + +> **SHOE**: `29` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:68](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L68) + +*** + +### SINK + +> **SINK**: `81` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:119](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L119) + +*** + +### SKATEBOARD + +> **SKATEBOARD**: `41` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:79](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L79) + +*** + +### SKIS + +> **SKIS**: `35` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:74](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L74) + +*** + +### SNOWBOARD + +> **SNOWBOARD**: `36` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:75](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L75) + +*** + +### SPOON + +> **SPOON**: `50` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:88](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L88) + +*** + +### SPORTS + +> **SPORTS**: `37` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:76](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L76) + +*** + +### STOP\_SIGN + +> **STOP\_SIGN**: `13` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:52](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L52) + +*** + +### STREET\_SIGN + +> **STREET\_SIGN**: `12` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:51](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L51) + +*** + +### SUITCASE + +> **SUITCASE**: `33` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:72](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L72) + +*** + +### SURFBOARD + +> **SURFBOARD**: `42` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:80](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L80) + +*** + +### TEDDY\_BEAR + +> **TEDDY\_BEAR**: `88` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:126](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L126) + +*** + +### TENNIS\_RACKET + +> **TENNIS\_RACKET**: `43` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:81](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L81) + +*** + +### TIE + +> **TIE**: `32` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:71](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L71) + +*** + +### TOASTER + +> **TOASTER**: `80` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:118](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L118) + +*** + +### TOILET + +> **TOILET**: `70` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:108](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L108) + +*** + +### TOOTHBRUSH + +> **TOOTHBRUSH**: `90` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:128](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L128) + +*** + +### TRAFFIC\_LIGHT + +> **TRAFFIC\_LIGHT**: `10` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:49](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L49) + +*** + +### TRAIN + +> **TRAIN**: `7` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:46](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L46) + +*** + +### TRUCK + +> **TRUCK**: `8` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:47](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L47) + +*** + +### TV + +> **TV**: `72` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:110](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L110) + +*** + +### UMBRELLA + +> **UMBRELLA**: `28` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:67](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L67) + +*** + +### VASE + +> **VASE**: `86` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:124](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L124) + +*** + +### WINDOW + +> **WINDOW**: `68` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:106](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L106) + +*** + +### WINE\_GLASS + +> **WINE\_GLASS**: `46` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:84](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L84) + +*** + +### ZEBRA + +> **ZEBRA**: `24` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:63](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L63) diff --git a/docs/docs/06-api-reference/enumerations/DeeplabLabel.md b/docs/docs/06-api-reference/enumerations/DeeplabLabel.md new file mode 100644 index 000000000..63d4be37d --- /dev/null +++ b/docs/docs/06-api-reference/enumerations/DeeplabLabel.md @@ -0,0 +1,181 @@ +# Enumeration: DeeplabLabel + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:10](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L10) + +Labels used in the DeepLab image segmentation model. + +## Enumeration Members + +### AEROPLANE + +> **AEROPLANE**: `1` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L12) + +*** + +### ARGMAX + +> **ARGMAX**: `21` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L32) + +*** + +### BACKGROUND + +> **BACKGROUND**: `0` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:11](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L11) + +*** + +### BICYCLE + +> **BICYCLE**: `2` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L13) + +*** + +### BIRD + +> **BIRD**: `3` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L14) + +*** + +### BOAT + +> **BOAT**: `4` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L15) + +*** + +### BOTTLE + +> **BOTTLE**: `5` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:16](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L16) + +*** + +### BUS + +> **BUS**: `6` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L17) + +*** + +### CAR + +> **CAR**: `7` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:18](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L18) + +*** + +### CAT + +> **CAT**: `8` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:19](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L19) + +*** + +### CHAIR + +> **CHAIR**: `9` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:20](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L20) + +*** + +### COW + +> **COW**: `10` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:21](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L21) + +*** + +### DININGTABLE + +> **DININGTABLE**: `11` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L22) + +*** + +### DOG + +> **DOG**: `12` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L23) + +*** + +### HORSE + +> **HORSE**: `13` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:24](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L24) + +*** + +### MOTORBIKE + +> **MOTORBIKE**: `14` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:25](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L25) + +*** + +### PERSON + +> **PERSON**: `15` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:26](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L26) + +*** + +### POTTEDPLANT + +> **POTTEDPLANT**: `16` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L27) + +*** + +### SHEEP + +> **SHEEP**: `17` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L28) + +*** + +### SOFA + +> **SOFA**: `18` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:29](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L29) + +*** + +### TRAIN + +> **TRAIN**: `19` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:30](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L30) + +*** + +### TVMONITOR + +> **TVMONITOR**: `20` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:31](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L31) diff --git a/docs/docs/06-api-reference/enumerations/RnExecutorchErrorCode.md b/docs/docs/06-api-reference/enumerations/RnExecutorchErrorCode.md new file mode 100644 index 000000000..c02a3e587 --- /dev/null +++ b/docs/docs/06-api-reference/enumerations/RnExecutorchErrorCode.md @@ -0,0 +1,423 @@ +# Enumeration: RnExecutorchErrorCode + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:4](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L4) + +## Enumeration Members + +### AccessFailed + +> **AccessFailed**: `34` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:148](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L148) + +Could not access a resource. + +*** + +### DelegateInvalidCompatibility + +> **DelegateInvalidCompatibility**: `48` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:164](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L164) + +Init stage: Backend receives an incompatible delegate version. + +*** + +### DelegateInvalidHandle + +> **DelegateInvalidHandle**: `50` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:172](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L172) + +Execute stage: The handle is invalid. + +*** + +### DelegateMemoryAllocationFailed + +> **DelegateMemoryAllocationFailed**: `49` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:168](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L168) + +Init stage: Backend fails to allocate memory. + +*** + +### DownloadInterrupted + +> **DownloadInterrupted**: `118` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:60](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L60) + +Thrown when the number of downloaded files is unexpected, due to download interruptions. + +*** + +### EndOfMethod + +> **EndOfMethod**: `3` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:116](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L116) + +Status indicating there are no more steps of execution to run + +*** + +### FileReadFailed + +> **FileReadFailed**: `114` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:44](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L44) + +Thrown when a file read operation failed. This could be invalid image url passed to image models, or unsupported format. + +*** + +### FileWriteFailed + +> **FileWriteFailed**: `103` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:16](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L16) + +An error ocurred when saving a file. This could be, for instance a result image from an image model. + +*** + +### Internal + +> **Internal**: `1` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:108](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L108) + +An internal error occurred. + +*** + +### InvalidArgument + +> **InvalidArgument**: `18` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:128](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L128) + +User provided an invalid argument. + +*** + +### InvalidConfig + +> **InvalidConfig**: `112` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L28) + +Thrown when config parameters passed to a model are invalid. For example, when LLM's topp is outside of range [0, 1]. + +*** + +### InvalidExternalData + +> **InvalidExternalData**: `36` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:156](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L156) + +Error caused by the contents of external data. + +*** + +### InvalidModelOutput + +> **InvalidModelOutput**: `115` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L48) + +Thrown when the size of model output is unexpected. + +*** + +### InvalidModelSource + +> **InvalidModelSource**: `255` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L32) + +Thrown when the type of model source passed by the user is invalid. + +*** + +### InvalidProgram + +> **InvalidProgram**: `35` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:152](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L152) + +Error caused by the contents of a program. + +*** + +### InvalidState + +> **InvalidState**: `2` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:112](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L112) + +Status indicating the executor is in an invalid state for a targeted operation. + +*** + +### InvalidType + +> **InvalidType**: `19` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:132](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L132) + +Object is an invalid type for the operation. + +*** + +### InvalidUserInput + +> **InvalidUserInput**: `117` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:56](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L56) + +Thrown when the input passed to our APIs is invalid, for example when passing an empty message aray to LLM's generate(). + +*** + +### LanguageNotSupported + +> **LanguageNotSupported**: `105` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:24](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L24) + +Thrown when a language is passed to a multi-language model that is not supported. For example OCR or Speech To Text. + +*** + +### MemoryAllocationFailed + +> **MemoryAllocationFailed**: `33` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:144](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L144) + +Could not allocate the requested memory. + +*** + +### MissingDataChunk + +> **MissingDataChunk**: `161` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:68](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L68) + +Thrown when streaming transcription is attempted but audio data chunk is missing. + +*** + +### ModelGenerating + +> **ModelGenerating**: `104` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:20](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L20) + +Thrown when a user tries to run a model that is currently processing. It is only allowed to run a single model prediction at a time. + +*** + +### ModuleNotLoaded + +> **ModuleNotLoaded**: `102` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L12) + +Thrown when a user tries to run a model that is not yet downloaded or loaded into memory. + +*** + +### MultilingualConfiguration + +> **MultilingualConfiguration**: `160` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L64) + +Thrown when there's a configuration mismatch between multilingual and language settings in Speech-to-Text models. + +*** + +### NotFound + +> **NotFound**: `32` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:140](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L140) + +Requested resource could not be found. + +*** + +### NotImplemented + +> **NotImplemented**: `17` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:124](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L124) + +Operation is not yet implemented. + +*** + +### NotSupported + +> **NotSupported**: `16` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:120](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L120) + +Operation is not supported in the current context. + +*** + +### Ok + +> **Ok**: `0` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:104](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L104) + +Status indicating a successful operation. + +*** + +### OperatorMissing + +> **OperatorMissing**: `20` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:136](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L136) + +Operator(s) missing in the operator registry. + +*** + +### OutOfResources + +> **OutOfResources**: `37` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:160](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L160) + +Does not have enough resources to perform the requested operation. + +*** + +### ResourceFetcherAlreadyOngoing + +> **ResourceFetcherAlreadyOngoing**: `183` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:92](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L92) + +Thrown when trying to resume a download that is already ongoing. + +*** + +### ResourceFetcherAlreadyPaused + +> **ResourceFetcherAlreadyPaused**: `182` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:88](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L88) + +Thrown when trying to pause a download that is already paused. + +*** + +### ResourceFetcherDownloadFailed + +> **ResourceFetcherDownloadFailed**: `180` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:80](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L80) + +Thrown when a resource fails to download. This could be due to invalid URL, or for example a network problem. + +*** + +### ResourceFetcherDownloadInProgress + +> **ResourceFetcherDownloadInProgress**: `181` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:84](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L84) + +Thrown when a user tries to trigger a download that's already in progress. + +*** + +### ResourceFetcherMissingUri + +> **ResourceFetcherMissingUri**: `185` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:100](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L100) + +Thrown when required URI information is missing for a download operation. + +*** + +### ResourceFetcherNotActive + +> **ResourceFetcherNotActive**: `184` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:96](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L96) + +Thrown when trying to pause, resume, or cancel a download that is not active. + +*** + +### StreamingInProgress + +> **StreamingInProgress**: `163` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:76](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L76) + +Thrown when trying to start a new streaming session while another is already in progress. + +*** + +### StreamingNotStarted + +> **StreamingNotStarted**: `162` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:72](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L72) + +Thrown when trying to stop or insert data into a stream that hasn't been started. + +*** + +### ThreadPoolError + +> **ThreadPoolError**: `113` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:40](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L40) + +Thrown when React Native ExecuTorch threadpool problem occurs. + +*** + +### UnexpectedNumInputs + +> **UnexpectedNumInputs**: `97` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:36](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L36) + +Thrown when the number of passed inputs to the model is different than the model metadata specifies. + +*** + +### UnknownError + +> **UnknownError**: `101` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L8) + +An umbrella-error that is thrown usually when something unexpected happens, for example a 3rd-party library error. + +*** + +### WrongDimensions + +> **WrongDimensions**: `116` + +Defined in: [packages/react-native-executorch/src/errors/ErrorCodes.ts:52](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/errors/ErrorCodes.ts#L52) + +Thrown when the dimensions of input tensors don't match the model's expected dimensions. diff --git a/docs/docs/06-api-reference/enumerations/ScalarType.md b/docs/docs/06-api-reference/enumerations/ScalarType.md new file mode 100644 index 000000000..23efe3125 --- /dev/null +++ b/docs/docs/06-api-reference/enumerations/ScalarType.md @@ -0,0 +1,225 @@ +# Enumeration: ScalarType + +Defined in: [packages/react-native-executorch/src/types/common.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L17) + +Enum representing the scalar types of tensors. + +## Enumeration Members + +### BITS16 + +> **BITS16**: `22` + +Defined in: [packages/react-native-executorch/src/types/common.ts:77](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L77) + +Raw Bits type. + +*** + +### BOOL + +> **BOOL**: `11` + +Defined in: [packages/react-native-executorch/src/types/common.ts:53](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L53) + +Boolean type. + +*** + +### BYTE + +> **BYTE**: `0` + +Defined in: [packages/react-native-executorch/src/types/common.ts:21](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L21) + +Byte type (8-bit unsigned integer). + +*** + +### CHAR + +> **CHAR**: `1` + +Defined in: [packages/react-native-executorch/src/types/common.ts:25](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L25) + +Character type (8-bit signed integer). + +*** + +### DOUBLE + +> **DOUBLE**: `7` + +Defined in: [packages/react-native-executorch/src/types/common.ts:49](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L49) + +Double-precision floating point type (64-bit). + +*** + +### FLOAT + +> **FLOAT**: `6` + +Defined in: [packages/react-native-executorch/src/types/common.ts:45](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L45) + +Single-precision floating point type (32-bit). + +*** + +### FLOAT8E4M3FN + +> **FLOAT8E4M3FN**: `24` + +Defined in: [packages/react-native-executorch/src/types/common.ts:85](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L85) + +Quantized 8-bit floating point type: Sign bit, 4 Exponent bits, 3 Mantissa bits. + +*** + +### FLOAT8E4M3FNUZ + +> **FLOAT8E4M3FNUZ**: `26` + +Defined in: [packages/react-native-executorch/src/types/common.ts:93](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L93) + +Quantized 8-bit floating point type with No Unsigned Zero (NUZ): Sign bit, 4 Exponent bits, 3 Mantissa bits. + +*** + +### FLOAT8E5M2 + +> **FLOAT8E5M2**: `23` + +Defined in: [packages/react-native-executorch/src/types/common.ts:81](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L81) + +Quantized 8-bit floating point type: Sign bit, 5 Exponent bits, 2 Mantissa bits. + +*** + +### FLOAT8E5M2FNUZ + +> **FLOAT8E5M2FNUZ**: `25` + +Defined in: [packages/react-native-executorch/src/types/common.ts:89](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L89) + +Quantized 8-bit floating point type with No Unsigned Zero (NUZ): Sign bit, 5 Exponent bits, 2 Mantissa bits. + +*** + +### HALF + +> **HALF**: `5` + +Defined in: [packages/react-native-executorch/src/types/common.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L41) + +Half-precision floating point type (16-bit). + +*** + +### INT + +> **INT**: `3` + +Defined in: [packages/react-native-executorch/src/types/common.ts:33](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L33) + +Integer type (32-bit signed integer). + +*** + +### LONG + +> **LONG**: `4` + +Defined in: [packages/react-native-executorch/src/types/common.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L37) + +Long integer type (64-bit signed integer). + +*** + +### QINT32 + +> **QINT32**: `14` + +Defined in: [packages/react-native-executorch/src/types/common.ts:65](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L65) + +Quantized 32-bit signed integer type. + +*** + +### QINT8 + +> **QINT8**: `12` + +Defined in: [packages/react-native-executorch/src/types/common.ts:57](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L57) + +Quantized 8-bit signed integer type. + +*** + +### QUINT2X4 + +> **QUINT2X4**: `17` + +Defined in: [packages/react-native-executorch/src/types/common.ts:73](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L73) + +Packed Quantized Unsigned 2-bit Integer type (4 numbers in 1 byte). + +*** + +### QUINT4X2 + +> **QUINT4X2**: `16` + +Defined in: [packages/react-native-executorch/src/types/common.ts:69](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L69) + +Packed Quantized Unsigned 4-bit Integers type (2 number in 1 byte). + +*** + +### QUINT8 + +> **QUINT8**: `13` + +Defined in: [packages/react-native-executorch/src/types/common.ts:61](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L61) + +Quantized 8-bit unsigned integer type. + +*** + +### SHORT + +> **SHORT**: `2` + +Defined in: [packages/react-native-executorch/src/types/common.ts:29](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L29) + +Short integer type (16-bit signed integer). + +*** + +### UINT16 + +> **UINT16**: `27` + +Defined in: [packages/react-native-executorch/src/types/common.ts:97](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L97) + +Unsigned 16-bit integer type. + +*** + +### UINT32 + +> **UINT32**: `28` + +Defined in: [packages/react-native-executorch/src/types/common.ts:101](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L101) + +Unsigned 32-bit integer type. + +*** + +### UINT64 + +> **UINT64**: `29` + +Defined in: [packages/react-native-executorch/src/types/common.ts:105](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L105) + +Unsigned 64-bit integer type. diff --git a/docs/docs/06-api-reference/functions/DEFAULT_STRUCTURED_OUTPUT_PROMPT.md b/docs/docs/06-api-reference/functions/DEFAULT_STRUCTURED_OUTPUT_PROMPT.md new file mode 100644 index 000000000..bc2018c54 --- /dev/null +++ b/docs/docs/06-api-reference/functions/DEFAULT_STRUCTURED_OUTPUT_PROMPT.md @@ -0,0 +1,21 @@ +# Function: DEFAULT\_STRUCTURED\_OUTPUT\_PROMPT() + +> **DEFAULT\_STRUCTURED\_OUTPUT\_PROMPT**(`structuredOutputSchema`): `string` + +Defined in: [packages/react-native-executorch/src/constants/llmDefaults.ts:18](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/llmDefaults.ts#L18) + +Generates a default structured output prompt based on the provided JSON schema. + +## Parameters + +### structuredOutputSchema + +`string` + +A string representing the JSON schema for the desired output format. + +## Returns + +`string` + +A prompt string instructing the model to format its output according to the given schema. diff --git a/docs/docs/06-api-reference/functions/fixAndValidateStructuredOutput.md b/docs/docs/06-api-reference/functions/fixAndValidateStructuredOutput.md new file mode 100644 index 000000000..c3469fdf3 --- /dev/null +++ b/docs/docs/06-api-reference/functions/fixAndValidateStructuredOutput.md @@ -0,0 +1,33 @@ +# Function: fixAndValidateStructuredOutput() + +> **fixAndValidateStructuredOutput**\<`T`\>(`output`, `responseSchema`): `output`\<`T`\> + +Defined in: [packages/react-native-executorch/src/utils/llm.ts:102](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/llm.ts#L102) + +Fixes and validates structured output from LLMs against a provided schema. + +## Type Parameters + +### T + +`T` *extends* `$ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\> + +## Parameters + +### output + +`string` + +The raw output string from the LLM. + +### responseSchema + +The schema (Zod or JSON Schema) to validate the output against. + +`Schema` | `T` + +## Returns + +`output`\<`T`\> + +The validated and parsed output. diff --git a/docs/docs/06-api-reference/functions/getStructuredOutputPrompt.md b/docs/docs/06-api-reference/functions/getStructuredOutputPrompt.md new file mode 100644 index 000000000..03a61c963 --- /dev/null +++ b/docs/docs/06-api-reference/functions/getStructuredOutputPrompt.md @@ -0,0 +1,27 @@ +# Function: getStructuredOutputPrompt() + +> **getStructuredOutputPrompt**\<`T`\>(`responseSchema`): `string` + +Defined in: [packages/react-native-executorch/src/utils/llm.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/llm.ts#L64) + +Generates a structured output prompt based on the provided schema. + +## Type Parameters + +### T + +`T` *extends* `$ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\> + +## Parameters + +### responseSchema + +The schema (Zod or JSON Schema) defining the desired output format. + +`T` | `Schema` + +## Returns + +`string` + +A prompt string instructing the model to format its output according to the given schema. diff --git a/docs/docs/06-api-reference/functions/useClassification.md b/docs/docs/06-api-reference/functions/useClassification.md new file mode 100644 index 000000000..c460e3e10 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useClassification.md @@ -0,0 +1,21 @@ +# Function: useClassification() + +> **useClassification**(`ClassificationConfiguration`): [`ClassificationType`](../interfaces/ClassificationType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useClassification.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useClassification.ts#L12) + +React hook for managing a Classification model instance. + +## Parameters + +### ClassificationConfiguration + +[`ClassificationProps`](../interfaces/ClassificationProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +[`ClassificationType`](../interfaces/ClassificationType.md) + +Ready to use Classification model. diff --git a/docs/docs/06-api-reference/functions/useExecutorchModule.md b/docs/docs/06-api-reference/functions/useExecutorchModule.md new file mode 100644 index 000000000..dfff840d0 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useExecutorchModule.md @@ -0,0 +1,21 @@ +# Function: useExecutorchModule() + +> **useExecutorchModule**(`executorchModuleConfiguration`): [`ExecutorchModuleType`](../interfaces/ExecutorchModuleType.md) + +Defined in: [packages/react-native-executorch/src/hooks/general/useExecutorchModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/general/useExecutorchModule.ts#L12) + +React hook for managing an arbitrary Executorch module instance. + +## Parameters + +### executorchModuleConfiguration + +[`ExecutorchModuleProps`](../interfaces/ExecutorchModuleProps.md) + +Configuration object containing `modelSource` and optional `preventLoad` flag. + +## Returns + +[`ExecutorchModuleType`](../interfaces/ExecutorchModuleType.md) + +Ready to use Executorch module. diff --git a/docs/docs/06-api-reference/functions/useImageEmbeddings.md b/docs/docs/06-api-reference/functions/useImageEmbeddings.md new file mode 100644 index 000000000..883499670 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useImageEmbeddings.md @@ -0,0 +1,57 @@ +# Function: useImageEmbeddings() + +> **useImageEmbeddings**(`ImageEmbeddingsConfiguration`): `object` + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useImageEmbeddings.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useImageEmbeddings.ts#L12) + +React hook for managing an Image Embeddings model instance. + +## Parameters + +### ImageEmbeddingsConfiguration + +[`ImageEmbeddingsProps`](../interfaces/ImageEmbeddingsProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +Ready to use Image Embeddings model. + +### downloadProgress + +> **downloadProgress**: `number` + +Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Contains the error message if the model failed to load. + +### forward() + +> **forward**: (...`input`) => `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +#### Parameters + +##### input + +...\[`string`\] + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +### isGenerating + +> **isGenerating**: `boolean` + +Indicates whether the model is currently generating a response. + +### isReady + +> **isReady**: `boolean` + +Indicates whether the model is ready. diff --git a/docs/docs/06-api-reference/functions/useImageSegmentation.md b/docs/docs/06-api-reference/functions/useImageSegmentation.md new file mode 100644 index 000000000..5122189dd --- /dev/null +++ b/docs/docs/06-api-reference/functions/useImageSegmentation.md @@ -0,0 +1,21 @@ +# Function: useImageSegmentation() + +> **useImageSegmentation**(`ImageSegmentationConfiguration`): [`ImageSegmentationType`](../interfaces/ImageSegmentationType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useImageSegmentation.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useImageSegmentation.ts#L12) + +React hook for managing an Image Segmentation model instance. + +## Parameters + +### ImageSegmentationConfiguration + +[`ImageSegmentationProps`](../interfaces/ImageSegmentationProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +[`ImageSegmentationType`](../interfaces/ImageSegmentationType.md) + +Ready to use Image Segmentation model. diff --git a/docs/docs/06-api-reference/functions/useLLM.md b/docs/docs/06-api-reference/functions/useLLM.md new file mode 100644 index 000000000..dd3e41cc6 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useLLM.md @@ -0,0 +1,47 @@ +# Function: useLLM() + +> **useLLM**(`model`): [`LLMType`](../interfaces/LLMType.md) + +Defined in: [packages/react-native-executorch/src/hooks/natural\_language\_processing/useLLM.ts:19](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/natural_language_processing/useLLM.ts#L19) + +React hook for managing a Large Language Model (LLM) instance. + +## Parameters + +### model + +Object containing model, tokenizer, and tokenizer config sources. + +#### model + +\{ `modelSource`: [`ResourceSource`](../type-aliases/ResourceSource.md); `tokenizerConfigSource`: [`ResourceSource`](../type-aliases/ResourceSource.md); `tokenizerSource`: [`ResourceSource`](../type-aliases/ResourceSource.md); \} + +#### model.modelSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the model binary. + +#### model.tokenizerConfigSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` pointing to the JSON file which contains the tokenizer config. + +#### model.tokenizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource pointing` to the JSON file which contains the tokenizer. + +#### preventLoad? + +`boolean` = `false` + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + +## Returns + +[`LLMType`](../interfaces/LLMType.md) + +An object implementing the `LLMType` interface for interacting with the LLM. diff --git a/docs/docs/06-api-reference/functions/useOCR.md b/docs/docs/06-api-reference/functions/useOCR.md new file mode 100644 index 000000000..de6b04346 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useOCR.md @@ -0,0 +1,21 @@ +# Function: useOCR() + +> **useOCR**(`OCRConfiguration`): [`OCRType`](../interfaces/OCRType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useOCR.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useOCR.ts#L13) + +React hook for managing an OCR instance. + +## Parameters + +### OCRConfiguration + +[`OCRProps`](../interfaces/OCRProps.md) + +Configuration object containing `model` sources and optional `preventLoad` flag. + +## Returns + +[`OCRType`](../interfaces/OCRType.md) + +Ready to use OCR model. diff --git a/docs/docs/06-api-reference/functions/useObjectDetection.md b/docs/docs/06-api-reference/functions/useObjectDetection.md new file mode 100644 index 000000000..565ff7db1 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useObjectDetection.md @@ -0,0 +1,21 @@ +# Function: useObjectDetection() + +> **useObjectDetection**(`ObjectDetectionConfiguration`): [`ObjectDetectionType`](../interfaces/ObjectDetectionType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useObjectDetection.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useObjectDetection.ts#L12) + +React hook for managing an Object Detection model instance. + +## Parameters + +### ObjectDetectionConfiguration + +[`ObjectDetectionProps`](../interfaces/ObjectDetectionProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +[`ObjectDetectionType`](../interfaces/ObjectDetectionType.md) + +Ready to use Object Detection model. diff --git a/docs/docs/06-api-reference/functions/useSpeechToText.md b/docs/docs/06-api-reference/functions/useSpeechToText.md new file mode 100644 index 000000000..9d0d4f010 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useSpeechToText.md @@ -0,0 +1,39 @@ +# Function: useSpeechToText() + +> **useSpeechToText**(`speechToTextConfiguration`): [`SpeechToTextType`](../interfaces/SpeechToTextType.md) + +Defined in: [packages/react-native-executorch/src/hooks/natural\_language\_processing/useSpeechToText.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/natural_language_processing/useSpeechToText.ts#L14) + +React hook for managing a Speech to Text (STT) instance. + +## Parameters + +### speechToTextConfiguration + +Configuration object containing `model` source and optional `preventLoad` flag. + +#### model + +[`SpeechToTextModelConfig`](../interfaces/SpeechToTextModelConfig.md) + +Object containing: + +`isMultilingual` - A boolean flag indicating whether the model supports multiple languages. + +`encoderSource` - A string that specifies the location of a `.pte` file for the encoder. + +`decoderSource` - A string that specifies the location of a `.pte` file for the decoder. + +`tokenizerSource` - A string that specifies the location to the tokenizer for the model. + +#### preventLoad? + +`boolean` = `false` + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + +## Returns + +[`SpeechToTextType`](../interfaces/SpeechToTextType.md) + +Ready to use Speech to Text model. diff --git a/docs/docs/06-api-reference/functions/useStyleTransfer.md b/docs/docs/06-api-reference/functions/useStyleTransfer.md new file mode 100644 index 000000000..daa53005a --- /dev/null +++ b/docs/docs/06-api-reference/functions/useStyleTransfer.md @@ -0,0 +1,21 @@ +# Function: useStyleTransfer() + +> **useStyleTransfer**(`StyleTransferConfiguration`): [`StyleTransferType`](../interfaces/StyleTransferType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useStyleTransfer.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useStyleTransfer.ts#L12) + +React hook for managing a Style Transfer model instance. + +## Parameters + +### StyleTransferConfiguration + +[`StyleTransferProps`](../interfaces/StyleTransferProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +[`StyleTransferType`](../interfaces/StyleTransferType.md) + +Ready to use Style Transfer model. diff --git a/docs/docs/06-api-reference/functions/useTextEmbeddings.md b/docs/docs/06-api-reference/functions/useTextEmbeddings.md new file mode 100644 index 000000000..24eb13f17 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useTextEmbeddings.md @@ -0,0 +1,21 @@ +# Function: useTextEmbeddings() + +> **useTextEmbeddings**(`TextEmbeddingsConfiguration`): [`TextEmbeddingsType`](../interfaces/TextEmbeddingsType.md) + +Defined in: [packages/react-native-executorch/src/hooks/natural\_language\_processing/useTextEmbeddings.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/natural_language_processing/useTextEmbeddings.ts#L12) + +React hook for managing a Text Embeddings model instance. + +## Parameters + +### TextEmbeddingsConfiguration + +[`TextEmbeddingsProps`](../interfaces/TextEmbeddingsProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +[`TextEmbeddingsType`](../interfaces/TextEmbeddingsType.md) + +Ready to use Text Embeddings model. diff --git a/docs/docs/06-api-reference/functions/useTextToImage.md b/docs/docs/06-api-reference/functions/useTextToImage.md new file mode 100644 index 000000000..67799d386 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useTextToImage.md @@ -0,0 +1,21 @@ +# Function: useTextToImage() + +> **useTextToImage**(`TextToImageConfiguration`): [`TextToImageType`](../interfaces/TextToImageType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useTextToImage.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useTextToImage.ts#L14) + +React hook for managing a Text to Image instance. + +## Parameters + +### TextToImageConfiguration + +[`TextToImageParams`](../interfaces/TextToImageParams.md) + +Configuration object containing `model` source, `inferenceCallback`, and optional `preventLoad` flag. + +## Returns + +[`TextToImageType`](../interfaces/TextToImageType.md) + +Ready to use Text to Image model. diff --git a/docs/docs/06-api-reference/functions/useTextToSpeech.md b/docs/docs/06-api-reference/functions/useTextToSpeech.md new file mode 100644 index 000000000..fafad955e --- /dev/null +++ b/docs/docs/06-api-reference/functions/useTextToSpeech.md @@ -0,0 +1,21 @@ +# Function: useTextToSpeech() + +> **useTextToSpeech**(`TextToSpeechConfiguration`): [`TextToSpeechType`](../interfaces/TextToSpeechType.md) + +Defined in: [packages/react-native-executorch/src/hooks/natural\_language\_processing/useTextToSpeech.ts:19](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts#L19) + +React hook for managing Text to Speech instance. + +## Parameters + +### TextToSpeechConfiguration + +[`TextToSpeechProps`](../interfaces/TextToSpeechProps.md) + +Configuration object containing `model` source, `voice` and optional `preventLoad`. + +## Returns + +[`TextToSpeechType`](../interfaces/TextToSpeechType.md) + +Ready to use Text to Speech model. diff --git a/docs/docs/06-api-reference/functions/useTokenizer.md b/docs/docs/06-api-reference/functions/useTokenizer.md new file mode 100644 index 000000000..3a0ef7dcd --- /dev/null +++ b/docs/docs/06-api-reference/functions/useTokenizer.md @@ -0,0 +1,37 @@ +# Function: useTokenizer() + +> **useTokenizer**(`tokenizerConfiguration`): [`TokenizerType`](../interfaces/TokenizerType.md) + +Defined in: [packages/react-native-executorch/src/hooks/natural\_language\_processing/useTokenizer.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/natural_language_processing/useTokenizer.ts#L15) + +React hook for managing a Tokenizer instance. + +## Parameters + +### tokenizerConfiguration + +Configuration object containing `tokenizer` source and optional `preventLoad` flag. + +#### preventLoad? + +`boolean` = `false` + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + +#### tokenizer + +\{ `tokenizerSource`: [`ResourceSource`](../type-aliases/ResourceSource.md); \} + +Object containing: + +`tokenizerSource` - A `ResourceSource` that specifies the location of the tokenizer. + +#### tokenizer.tokenizerSource + +[`ResourceSource`](../type-aliases/ResourceSource.md) + +## Returns + +[`TokenizerType`](../interfaces/TokenizerType.md) + +Ready to use Tokenizer model. diff --git a/docs/docs/06-api-reference/functions/useVAD.md b/docs/docs/06-api-reference/functions/useVAD.md new file mode 100644 index 000000000..65492f124 --- /dev/null +++ b/docs/docs/06-api-reference/functions/useVAD.md @@ -0,0 +1,21 @@ +# Function: useVAD() + +> **useVAD**(`VADConfiguration`): [`VADType`](../interfaces/VADType.md) + +Defined in: [packages/react-native-executorch/src/hooks/natural\_language\_processing/useVAD.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/natural_language_processing/useVAD.ts#L12) + +React hook for managing a VAD model instance. + +## Parameters + +### VADConfiguration + +[`VADProps`](../interfaces/VADProps.md) + +Configuration object containing `model` source and optional `preventLoad` flag. + +## Returns + +[`VADType`](../interfaces/VADType.md) + +Ready to use VAD model. diff --git a/docs/docs/06-api-reference/functions/useVerticalOCR.md b/docs/docs/06-api-reference/functions/useVerticalOCR.md new file mode 100644 index 000000000..8c00dffdf --- /dev/null +++ b/docs/docs/06-api-reference/functions/useVerticalOCR.md @@ -0,0 +1,21 @@ +# Function: useVerticalOCR() + +> **useVerticalOCR**(`VerticalOCRConfiguration`): [`OCRType`](../interfaces/OCRType.md) + +Defined in: [packages/react-native-executorch/src/hooks/computer\_vision/useVerticalOCR.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/hooks/computer_vision/useVerticalOCR.ts#L13) + +React hook for managing a Vertical OCR instance. + +## Parameters + +### VerticalOCRConfiguration + +[`VerticalOCRProps`](../interfaces/VerticalOCRProps.md) + +Configuration object containing `model` sources, optional `independentCharacters` and `preventLoad` flag. + +## Returns + +[`OCRType`](../interfaces/OCRType.md) + +Ready to use Vertical OCR model. diff --git a/docs/docs/06-api-reference/index.md b/docs/docs/06-api-reference/index.md new file mode 100644 index 000000000..ff5ec3cf9 --- /dev/null +++ b/docs/docs/06-api-reference/index.md @@ -0,0 +1,284 @@ +# react-native-executorch + +## Hooks + +- [useClassification](functions/useClassification.md) +- [useExecutorchModule](functions/useExecutorchModule.md) +- [useImageEmbeddings](functions/useImageEmbeddings.md) +- [useImageSegmentation](functions/useImageSegmentation.md) +- [useLLM](functions/useLLM.md) +- [useObjectDetection](functions/useObjectDetection.md) +- [useOCR](functions/useOCR.md) +- [useSpeechToText](functions/useSpeechToText.md) +- [useStyleTransfer](functions/useStyleTransfer.md) +- [useTextEmbeddings](functions/useTextEmbeddings.md) +- [useTextToImage](functions/useTextToImage.md) +- [useTextToSpeech](functions/useTextToSpeech.md) +- [useTokenizer](functions/useTokenizer.md) +- [useVAD](functions/useVAD.md) +- [useVerticalOCR](functions/useVerticalOCR.md) + +## Models - Classification + +- [EFFICIENTNET\_V2\_S](variables/EFFICIENTNET_V2_S.md) + +## Models - Image Embeddings + +- [CLIP\_VIT\_BASE\_PATCH32\_IMAGE](variables/CLIP_VIT_BASE_PATCH32_IMAGE.md) + +## Models - Image Generation + +- [BK\_SDM\_TINY\_VPRED\_256](variables/BK_SDM_TINY_VPRED_256.md) +- [BK\_SDM\_TINY\_VPRED\_512](variables/BK_SDM_TINY_VPRED_512.md) + +## Models - Image Segmentation + +- [DEEPLAB\_V3\_RESNET50](variables/DEEPLAB_V3_RESNET50.md) + +## Models - LMM + +- [HAMMER2\_1\_0\_5B](variables/HAMMER2_1_0_5B.md) +- [HAMMER2\_1\_0\_5B\_QUANTIZED](variables/HAMMER2_1_0_5B_QUANTIZED.md) +- [HAMMER2\_1\_1\_5B](variables/HAMMER2_1_1_5B.md) +- [HAMMER2\_1\_1\_5B\_QUANTIZED](variables/HAMMER2_1_1_5B_QUANTIZED.md) +- [HAMMER2\_1\_3B](variables/HAMMER2_1_3B.md) +- [HAMMER2\_1\_3B\_QUANTIZED](variables/HAMMER2_1_3B_QUANTIZED.md) +- [LLAMA3\_2\_1B](variables/LLAMA3_2_1B.md) +- [LLAMA3\_2\_1B\_QLORA](variables/LLAMA3_2_1B_QLORA.md) +- [LLAMA3\_2\_1B\_SPINQUANT](variables/LLAMA3_2_1B_SPINQUANT.md) +- [LLAMA3\_2\_3B](variables/LLAMA3_2_3B.md) +- [LLAMA3\_2\_3B\_QLORA](variables/LLAMA3_2_3B_QLORA.md) +- [LLAMA3\_2\_3B\_SPINQUANT](variables/LLAMA3_2_3B_SPINQUANT.md) +- [PHI\_4\_MINI\_4B](variables/PHI_4_MINI_4B.md) +- [PHI\_4\_MINI\_4B\_QUANTIZED](variables/PHI_4_MINI_4B_QUANTIZED.md) +- [QWEN2\_5\_0\_5B](variables/QWEN2_5_0_5B.md) +- [QWEN2\_5\_0\_5B\_QUANTIZED](variables/QWEN2_5_0_5B_QUANTIZED.md) +- [QWEN2\_5\_1\_5B](variables/QWEN2_5_1_5B.md) +- [QWEN2\_5\_1\_5B\_QUANTIZED](variables/QWEN2_5_1_5B_QUANTIZED.md) +- [QWEN2\_5\_3B](variables/QWEN2_5_3B.md) +- [QWEN2\_5\_3B\_QUANTIZED](variables/QWEN2_5_3B_QUANTIZED.md) +- [QWEN3\_0\_6B](variables/QWEN3_0_6B.md) +- [QWEN3\_0\_6B\_QUANTIZED](variables/QWEN3_0_6B_QUANTIZED.md) +- [QWEN3\_1\_7B](variables/QWEN3_1_7B.md) +- [QWEN3\_1\_7B\_QUANTIZED](variables/QWEN3_1_7B_QUANTIZED.md) +- [QWEN3\_4B](variables/QWEN3_4B.md) +- [QWEN3\_4B\_QUANTIZED](variables/QWEN3_4B_QUANTIZED.md) +- [SMOLLM2\_1\_1\_7B](variables/SMOLLM2_1_1_7B.md) +- [SMOLLM2\_1\_1\_7B\_QUANTIZED](variables/SMOLLM2_1_1_7B_QUANTIZED.md) +- [SMOLLM2\_1\_135M](variables/SMOLLM2_1_135M.md) +- [SMOLLM2\_1\_135M\_QUANTIZED](variables/SMOLLM2_1_135M_QUANTIZED.md) +- [SMOLLM2\_1\_360M](variables/SMOLLM2_1_360M.md) +- [SMOLLM2\_1\_360M\_QUANTIZED](variables/SMOLLM2_1_360M_QUANTIZED.md) + +## Models - Object Detection + +- [SSDLITE\_320\_MOBILENET\_V3\_LARGE](variables/SSDLITE_320_MOBILENET_V3_LARGE.md) + +## Models - Speech To Text + +- [WHISPER\_BASE](variables/WHISPER_BASE.md) +- [WHISPER\_BASE\_EN](variables/WHISPER_BASE_EN.md) +- [WHISPER\_SMALL](variables/WHISPER_SMALL.md) +- [WHISPER\_SMALL\_EN](variables/WHISPER_SMALL_EN.md) +- [WHISPER\_TINY](variables/WHISPER_TINY.md) +- [WHISPER\_TINY\_EN](variables/WHISPER_TINY_EN.md) +- [WHISPER\_TINY\_EN\_QUANTIZED](variables/WHISPER_TINY_EN_QUANTIZED.md) + +## Models - Style Transfer + +- [STYLE\_TRANSFER\_CANDY](variables/STYLE_TRANSFER_CANDY.md) +- [STYLE\_TRANSFER\_MOSAIC](variables/STYLE_TRANSFER_MOSAIC.md) +- [STYLE\_TRANSFER\_RAIN\_PRINCESS](variables/STYLE_TRANSFER_RAIN_PRINCESS.md) +- [STYLE\_TRANSFER\_UDNIE](variables/STYLE_TRANSFER_UDNIE.md) + +## Models - Text Embeddings + +- [ALL\_MINILM\_L6\_V2](variables/ALL_MINILM_L6_V2.md) +- [ALL\_MPNET\_BASE\_V2](variables/ALL_MPNET_BASE_V2.md) +- [CLIP\_VIT\_BASE\_PATCH32\_TEXT](variables/CLIP_VIT_BASE_PATCH32_TEXT.md) +- [MULTI\_QA\_MINILM\_L6\_COS\_V1](variables/MULTI_QA_MINILM_L6_COS_V1.md) +- [MULTI\_QA\_MPNET\_BASE\_DOT\_V1](variables/MULTI_QA_MPNET_BASE_DOT_V1.md) + +## Models - Text to Speech + +- [KOKORO\_MEDIUM](variables/KOKORO_MEDIUM.md) +- [KOKORO\_SMALL](variables/KOKORO_SMALL.md) + +## Models - Voice Activity Detection + +- [FSMN\_VAD](variables/FSMN_VAD.md) + +## OCR Supported Alphabets + +- [OCR\_ABAZA](variables/OCR_ABAZA.md) +- [OCR\_ADYGHE](variables/OCR_ADYGHE.md) +- [OCR\_AFRIKAANS](variables/OCR_AFRIKAANS.md) +- [OCR\_ALBANIAN](variables/OCR_ALBANIAN.md) +- [OCR\_AVAR](variables/OCR_AVAR.md) +- [OCR\_AZERBAIJANI](variables/OCR_AZERBAIJANI.md) +- [OCR\_BELARUSIAN](variables/OCR_BELARUSIAN.md) +- [OCR\_BOSNIAN](variables/OCR_BOSNIAN.md) +- [OCR\_BULGARIAN](variables/OCR_BULGARIAN.md) +- [OCR\_CHECHEN](variables/OCR_CHECHEN.md) +- [OCR\_CROATIAN](variables/OCR_CROATIAN.md) +- [OCR\_CZECH](variables/OCR_CZECH.md) +- [OCR\_DANISH](variables/OCR_DANISH.md) +- [OCR\_DARGWA](variables/OCR_DARGWA.md) +- [OCR\_DUTCH](variables/OCR_DUTCH.md) +- [OCR\_ENGLISH](variables/OCR_ENGLISH.md) +- [OCR\_ESTONIAN](variables/OCR_ESTONIAN.md) +- [OCR\_FRENCH](variables/OCR_FRENCH.md) +- [OCR\_GERMAN](variables/OCR_GERMAN.md) +- [OCR\_HUNGARIAN](variables/OCR_HUNGARIAN.md) +- [OCR\_ICELANDIC](variables/OCR_ICELANDIC.md) +- [OCR\_INDONESIAN](variables/OCR_INDONESIAN.md) +- [OCR\_INGUSH](variables/OCR_INGUSH.md) +- [OCR\_IRISH](variables/OCR_IRISH.md) +- [OCR\_ITALIAN](variables/OCR_ITALIAN.md) +- [OCR\_JAPANESE](variables/OCR_JAPANESE.md) +- [OCR\_KANNADA](variables/OCR_KANNADA.md) +- [OCR\_KARBADIAN](variables/OCR_KARBADIAN.md) +- [OCR\_KOREAN](variables/OCR_KOREAN.md) +- [OCR\_KURDISH](variables/OCR_KURDISH.md) +- [OCR\_LAK](variables/OCR_LAK.md) +- [OCR\_LATIN](variables/OCR_LATIN.md) +- [OCR\_LATVIAN](variables/OCR_LATVIAN.md) +- [OCR\_LEZGHIAN](variables/OCR_LEZGHIAN.md) +- [OCR\_LITHUANIAN](variables/OCR_LITHUANIAN.md) +- [OCR\_MALAY](variables/OCR_MALAY.md) +- [OCR\_MALTESE](variables/OCR_MALTESE.md) +- [OCR\_MAORI](variables/OCR_MAORI.md) +- [OCR\_MONGOLIAN](variables/OCR_MONGOLIAN.md) +- [OCR\_NORWEGIAN](variables/OCR_NORWEGIAN.md) +- [OCR\_OCCITAN](variables/OCR_OCCITAN.md) +- [OCR\_PALI](variables/OCR_PALI.md) +- [OCR\_POLISH](variables/OCR_POLISH.md) +- [OCR\_PORTUGUESE](variables/OCR_PORTUGUESE.md) +- [OCR\_ROMANIAN](variables/OCR_ROMANIAN.md) +- [OCR\_RUSSIAN](variables/OCR_RUSSIAN.md) +- [OCR\_SERBIAN\_CYRILLIC](variables/OCR_SERBIAN_CYRILLIC.md) +- [OCR\_SERBIAN\_LATIN](variables/OCR_SERBIAN_LATIN.md) +- [OCR\_SIMPLIFIED\_CHINESE](variables/OCR_SIMPLIFIED_CHINESE.md) +- [OCR\_SLOVAK](variables/OCR_SLOVAK.md) +- [OCR\_SLOVENIAN](variables/OCR_SLOVENIAN.md) +- [OCR\_SPANISH](variables/OCR_SPANISH.md) +- [OCR\_SWAHILI](variables/OCR_SWAHILI.md) +- [OCR\_SWEDISH](variables/OCR_SWEDISH.md) +- [OCR\_TABASSARAN](variables/OCR_TABASSARAN.md) +- [OCR\_TAGALOG](variables/OCR_TAGALOG.md) +- [OCR\_TAJIK](variables/OCR_TAJIK.md) +- [OCR\_TELUGU](variables/OCR_TELUGU.md) +- [OCR\_TURKISH](variables/OCR_TURKISH.md) +- [OCR\_UKRAINIAN](variables/OCR_UKRAINIAN.md) +- [OCR\_UZBEK](variables/OCR_UZBEK.md) +- [OCR\_VIETNAMESE](variables/OCR_VIETNAMESE.md) +- [OCR\_WELSH](variables/OCR_WELSH.md) + +## Other + +- [RnExecutorchErrorCode](enumerations/RnExecutorchErrorCode.md) +- [RnExecutorchError](classes/RnExecutorchError.md) + +## TTS Supported Voices + +- [KOKORO\_VOICE\_AF\_HEART](variables/KOKORO_VOICE_AF_HEART.md) +- [KOKORO\_VOICE\_AF\_RIVER](variables/KOKORO_VOICE_AF_RIVER.md) +- [KOKORO\_VOICE\_AF\_SARAH](variables/KOKORO_VOICE_AF_SARAH.md) +- [KOKORO\_VOICE\_AM\_ADAM](variables/KOKORO_VOICE_AM_ADAM.md) +- [KOKORO\_VOICE\_AM\_MICHAEL](variables/KOKORO_VOICE_AM_MICHAEL.md) +- [KOKORO\_VOICE\_AM\_SANTA](variables/KOKORO_VOICE_AM_SANTA.md) +- [KOKORO\_VOICE\_BF\_EMMA](variables/KOKORO_VOICE_BF_EMMA.md) +- [KOKORO\_VOICE\_BM\_DANIEL](variables/KOKORO_VOICE_BM_DANIEL.md) + +## Types + +- [CocoLabel](enumerations/CocoLabel.md) +- [DeeplabLabel](enumerations/DeeplabLabel.md) +- [ScalarType](enumerations/ScalarType.md) +- [Bbox](interfaces/Bbox.md) +- [ChatConfig](interfaces/ChatConfig.md) +- [ClassificationProps](interfaces/ClassificationProps.md) +- [ClassificationType](interfaces/ClassificationType.md) +- [DecodingOptions](interfaces/DecodingOptions.md) +- [Detection](interfaces/Detection.md) +- [ExecutorchModuleProps](interfaces/ExecutorchModuleProps.md) +- [ExecutorchModuleType](interfaces/ExecutorchModuleType.md) +- [GenerationConfig](interfaces/GenerationConfig.md) +- [ImageEmbeddingsProps](interfaces/ImageEmbeddingsProps.md) +- [ImageEmbeddingsType](interfaces/ImageEmbeddingsType.md) +- [ImageSegmentationProps](interfaces/ImageSegmentationProps.md) +- [ImageSegmentationType](interfaces/ImageSegmentationType.md) +- [KokoroConfig](interfaces/KokoroConfig.md) +- [KokoroVoiceExtras](interfaces/KokoroVoiceExtras.md) +- [LLMConfig](interfaces/LLMConfig.md) +- [LLMType](interfaces/LLMType.md) +- [Message](interfaces/Message.md) +- [ObjectDetectionProps](interfaces/ObjectDetectionProps.md) +- [ObjectDetectionType](interfaces/ObjectDetectionType.md) +- [OCRDetection](interfaces/OCRDetection.md) +- [OCRProps](interfaces/OCRProps.md) +- [OCRType](interfaces/OCRType.md) +- [Point](interfaces/Point.md) +- [Segment](interfaces/Segment.md) +- [SpeechToTextModelConfig](interfaces/SpeechToTextModelConfig.md) +- [SpeechToTextType](interfaces/SpeechToTextType.md) +- [StyleTransferProps](interfaces/StyleTransferProps.md) +- [StyleTransferType](interfaces/StyleTransferType.md) +- [TensorPtr](interfaces/TensorPtr.md) +- [TextEmbeddingsProps](interfaces/TextEmbeddingsProps.md) +- [TextEmbeddingsType](interfaces/TextEmbeddingsType.md) +- [TextToImageParams](interfaces/TextToImageParams.md) +- [TextToImageType](interfaces/TextToImageType.md) +- [TextToSpeechConfig](interfaces/TextToSpeechConfig.md) +- [TextToSpeechInput](interfaces/TextToSpeechInput.md) +- [TextToSpeechProps](interfaces/TextToSpeechProps.md) +- [TextToSpeechStreamingInput](interfaces/TextToSpeechStreamingInput.md) +- [TextToSpeechType](interfaces/TextToSpeechType.md) +- [TokenizerType](interfaces/TokenizerType.md) +- [ToolCall](interfaces/ToolCall.md) +- [ToolsConfig](interfaces/ToolsConfig.md) +- [VADProps](interfaces/VADProps.md) +- [VADType](interfaces/VADType.md) +- [VerticalOCRProps](interfaces/VerticalOCRProps.md) +- [VoiceConfig](interfaces/VoiceConfig.md) +- [LLMTool](type-aliases/LLMTool.md) +- [MessageRole](type-aliases/MessageRole.md) +- [OCRLanguage](type-aliases/OCRLanguage.md) +- [ResourceSource](type-aliases/ResourceSource.md) +- [SpeechToTextLanguage](type-aliases/SpeechToTextLanguage.md) +- [TensorBuffer](type-aliases/TensorBuffer.md) +- [TextToSpeechLanguage](type-aliases/TextToSpeechLanguage.md) +- [SPECIAL\_TOKENS](variables/SPECIAL_TOKENS.md) + +## Typescript API + +- [ClassificationModule](classes/ClassificationModule.md) +- [ExecutorchModule](classes/ExecutorchModule.md) +- [ImageEmbeddingsModule](classes/ImageEmbeddingsModule.md) +- [ImageSegmentationModule](classes/ImageSegmentationModule.md) +- [LLMModule](classes/LLMModule.md) +- [ObjectDetectionModule](classes/ObjectDetectionModule.md) +- [OCRModule](classes/OCRModule.md) +- [SpeechToTextModule](classes/SpeechToTextModule.md) +- [StyleTransferModule](classes/StyleTransferModule.md) +- [TextEmbeddingsModule](classes/TextEmbeddingsModule.md) +- [TextToImageModule](classes/TextToImageModule.md) +- [TextToSpeechModule](classes/TextToSpeechModule.md) +- [TokenizerModule](classes/TokenizerModule.md) +- [VADModule](classes/VADModule.md) +- [VerticalOCRModule](classes/VerticalOCRModule.md) + +## Utilities - General + +- [ResourceFetcher](classes/ResourceFetcher.md) + +## Utilities - LLM + +- [DEFAULT\_CHAT\_CONFIG](variables/DEFAULT_CHAT_CONFIG.md) +- [DEFAULT\_CONTEXT\_WINDOW\_LENGTH](variables/DEFAULT_CONTEXT_WINDOW_LENGTH.md) +- [DEFAULT\_MESSAGE\_HISTORY](variables/DEFAULT_MESSAGE_HISTORY.md) +- [DEFAULT\_SYSTEM\_PROMPT](variables/DEFAULT_SYSTEM_PROMPT.md) +- [parseToolCall](variables/parseToolCall.md) +- [DEFAULT\_STRUCTURED\_OUTPUT\_PROMPT](functions/DEFAULT_STRUCTURED_OUTPUT_PROMPT.md) +- [fixAndValidateStructuredOutput](functions/fixAndValidateStructuredOutput.md) +- [getStructuredOutputPrompt](functions/getStructuredOutputPrompt.md) diff --git a/docs/docs/06-api-reference/interfaces/Bbox.md b/docs/docs/06-api-reference/interfaces/Bbox.md new file mode 100644 index 000000000..e5773df85 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/Bbox.md @@ -0,0 +1,45 @@ +# Interface: Bbox + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L13) + +Represents a bounding box for a detected object in an image. + +## Properties + +### x1 + +> **x1**: `number` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L14) + +The x-coordinate of the bottom-left corner of the bounding box. + +*** + +### x2 + +> **x2**: `number` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L15) + +The x-coordinate of the top-right corner of the bounding box. + +*** + +### y1 + +> **y1**: `number` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:16](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L16) + +The y-coordinate of the bottom-left corner of the bounding box. + +*** + +### y2 + +> **y2**: `number` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L17) + +The y-coordinate of the top-right corner of the bounding box. diff --git a/docs/docs/06-api-reference/interfaces/ChatConfig.md b/docs/docs/06-api-reference/interfaces/ChatConfig.md new file mode 100644 index 000000000..6fb0ee352 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ChatConfig.md @@ -0,0 +1,35 @@ +# Interface: ChatConfig + +Defined in: [packages/react-native-executorch/src/types/llm.ts:182](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L182) + +Object configuring chat management. + +## Properties + +### contextWindowLength + +> **contextWindowLength**: `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:184](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L184) + +The number of messages from the current conversation that the model will use to generate a response. The higher the number, the more context the model will have. Keep in mind that using larger context windows will result in longer inference time and higher memory usage. + +*** + +### initialMessageHistory + +> **initialMessageHistory**: [`Message`](Message.md)[] + +Defined in: [packages/react-native-executorch/src/types/llm.ts:183](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L183) + +An array of `Message` objects that represent the conversation history. This can be used to provide initial context to the model. + +*** + +### systemPrompt + +> **systemPrompt**: `string` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:185](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L185) + +Often used to tell the model what is its purpose, for example - "Be a helpful translator". diff --git a/docs/docs/06-api-reference/interfaces/ClassificationProps.md b/docs/docs/06-api-reference/interfaces/ClassificationProps.md new file mode 100644 index 000000000..16cc76720 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ClassificationProps.md @@ -0,0 +1,29 @@ +# Interface: ClassificationProps + +Defined in: [packages/react-native-executorch/src/types/classification.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L12) + +Props for the `useClassification` hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/classification.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L13) + +An object containing the model source. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/classification.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L14) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/ClassificationType.md b/docs/docs/06-api-reference/interfaces/ClassificationType.md new file mode 100644 index 000000000..e29392754 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ClassificationType.md @@ -0,0 +1,74 @@ +# Interface: ClassificationType + +Defined in: [packages/react-native-executorch/src/types/classification.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L23) + +Return type for the `useClassification` hook. +Manages the state and operations for Computer Vision image classification. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/classification.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L42) + +Represents the download progress of the model binary as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/classification.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L27) + +Contains the error object if the model failed to load, download, or encountered a runtime error during classification. + +*** + +### forward() + +> **forward**: (`imageSource`) => `Promise`\<\{\[`category`: `string`\]: `number`; \}\> + +Defined in: [packages/react-native-executorch/src/types/classification.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L50) + +Executes the model's forward pass to classify the provided image. + +#### Parameters + +##### imageSource + +`string` + +A string representing the image source (e.g., a file path, URI, or base64 string) to be classified. + +#### Returns + +`Promise`\<\{\[`category`: `string`\]: `number`; \}\> + +A Promise that resolves to the classification result (typically containing labels and confidence scores). + +#### Throws + +If the model is not loaded or is currently processing another image. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/classification.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L37) + +Indicates whether the model is currently processing an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/classification.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/classification.ts#L32) + +Indicates whether the classification model is loaded and ready to process images. diff --git a/docs/docs/06-api-reference/interfaces/DecodingOptions.md b/docs/docs/06-api-reference/interfaces/DecodingOptions.md new file mode 100644 index 000000000..4a14ac75d --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/DecodingOptions.md @@ -0,0 +1,15 @@ +# Interface: DecodingOptions + +Defined in: [packages/react-native-executorch/src/types/stt.ts:176](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L176) + +Options for decoding speech to text. + +## Properties + +### language? + +> `optional` **language**: [`SpeechToTextLanguage`](../type-aliases/SpeechToTextLanguage.md) + +Defined in: [packages/react-native-executorch/src/types/stt.ts:177](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L177) + +Optional language code to guide the transcription. diff --git a/docs/docs/06-api-reference/interfaces/Detection.md b/docs/docs/06-api-reference/interfaces/Detection.md new file mode 100644 index 000000000..5ba98bb8b --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/Detection.md @@ -0,0 +1,35 @@ +# Interface: Detection + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L28) + +Represents a detected object within an image, including its bounding box, label, and confidence score. + +## Properties + +### bbox + +> **bbox**: [`Bbox`](Bbox.md) + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:29](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L29) + +The bounding box of the detected object, defined by its top-left (x1, y1) and bottom-right (x2, y2) coordinates. + +*** + +### label + +> **label**: `"PERSON"` \| `"BICYCLE"` \| `"CAR"` \| `"MOTORCYCLE"` \| `"AIRPLANE"` \| `"BUS"` \| `"TRAIN"` \| `"TRUCK"` \| `"BOAT"` \| `"TRAFFIC_LIGHT"` \| `"FIRE_HYDRANT"` \| `"STREET_SIGN"` \| `"STOP_SIGN"` \| `"PARKING"` \| `"BENCH"` \| `"BIRD"` \| `"CAT"` \| `"DOG"` \| `"HORSE"` \| `"SHEEP"` \| `"COW"` \| `"ELEPHANT"` \| `"BEAR"` \| `"ZEBRA"` \| `"GIRAFFE"` \| `"HAT"` \| `"BACKPACK"` \| `"UMBRELLA"` \| `"SHOE"` \| `"EYE"` \| `"HANDBAG"` \| `"TIE"` \| `"SUITCASE"` \| `"FRISBEE"` \| `"SKIS"` \| `"SNOWBOARD"` \| `"SPORTS"` \| `"KITE"` \| `"BASEBALL"` \| `"SKATEBOARD"` \| `"SURFBOARD"` \| `"TENNIS_RACKET"` \| `"BOTTLE"` \| `"PLATE"` \| `"WINE_GLASS"` \| `"CUP"` \| `"FORK"` \| `"KNIFE"` \| `"SPOON"` \| `"BOWL"` \| `"BANANA"` \| `"APPLE"` \| `"SANDWICH"` \| `"ORANGE"` \| `"BROCCOLI"` \| `"CARROT"` \| `"HOT_DOG"` \| `"PIZZA"` \| `"DONUT"` \| `"CAKE"` \| `"CHAIR"` \| `"COUCH"` \| `"POTTED_PLANT"` \| `"BED"` \| `"MIRROR"` \| `"DINING_TABLE"` \| `"WINDOW"` \| `"DESK"` \| `"TOILET"` \| `"DOOR"` \| `"TV"` \| `"LAPTOP"` \| `"MOUSE"` \| `"REMOTE"` \| `"KEYBOARD"` \| `"CELL_PHONE"` \| `"MICROWAVE"` \| `"OVEN"` \| `"TOASTER"` \| `"SINK"` \| `"REFRIGERATOR"` \| `"BLENDER"` \| `"BOOK"` \| `"CLOCK"` \| `"VASE"` \| `"SCISSORS"` \| `"TEDDY_BEAR"` \| `"HAIR_DRIER"` \| `"TOOTHBRUSH"` \| `"HAIR_BRUSH"` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:30](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L30) + +The class label of the detected object, represented as a key from the `CocoLabel` enum. + +*** + +### score + +> **score**: `number` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:31](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L31) + +The confidence score of the detection, typically ranging from 0 to 1. diff --git a/docs/docs/06-api-reference/interfaces/ExecutorchModuleProps.md b/docs/docs/06-api-reference/interfaces/ExecutorchModuleProps.md new file mode 100644 index 000000000..bd6f400a2 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ExecutorchModuleProps.md @@ -0,0 +1,25 @@ +# Interface: ExecutorchModuleProps + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:11](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L11) + +Props for the `useExecutorchModule` hook. + +## Properties + +### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L12) + +The source of the ExecuTorch model binary. + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L13) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/ExecutorchModuleType.md b/docs/docs/06-api-reference/interfaces/ExecutorchModuleType.md new file mode 100644 index 000000000..cde30ba6a --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ExecutorchModuleType.md @@ -0,0 +1,74 @@ +# Interface: ExecutorchModuleType + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L22) + +Return type for the `useExecutorchModule` hook. +Manages the state and core execution methods for a general ExecuTorch model. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L41) + +Represents the download progress of the model binary as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:26](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L26) + +Contains the error object if the model failed to load, download, or encountered a runtime error. + +*** + +### forward() + +> **forward**: (`inputTensor`) => `Promise`\<[`TensorPtr`](TensorPtr.md)[]\> + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:49](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L49) + +Executes the model's forward pass with the provided input tensors. + +#### Parameters + +##### inputTensor + +[`TensorPtr`](TensorPtr.md)[] + +An array of `TensorPtr` objects representing the input tensors required by the model. + +#### Returns + +`Promise`\<[`TensorPtr`](TensorPtr.md)[]\> + +A Promise that resolves to an array of output `TensorPtr` objects resulting from the model's inference. + +#### Throws + +If the model is not loaded or is currently processing another request. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:36](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L36) + +Indicates whether the model is currently processing a forward pass. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/executorchModule.ts:31](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/executorchModule.ts#L31) + +Indicates whether the ExecuTorch model binary has successfully loaded into memory and is ready for inference. diff --git a/docs/docs/06-api-reference/interfaces/GenerationConfig.md b/docs/docs/06-api-reference/interfaces/GenerationConfig.md new file mode 100644 index 000000000..e9c4a45d7 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/GenerationConfig.md @@ -0,0 +1,45 @@ +# Interface: GenerationConfig + +Defined in: [packages/react-native-executorch/src/types/llm.ts:211](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L211) + +Object configuring generation settings. + +## Properties + +### batchTimeInterval? + +> `optional` **batchTimeInterval**: `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:215](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L215) + +Upper limit on the time interval between consecutive token batches. + +*** + +### outputTokenBatchSize? + +> `optional` **outputTokenBatchSize**: `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:214](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L214) + +Soft upper limit on the number of tokens in each token batch (in certain cases there can be more tokens in given batch, i.e. when the batch would end with special emoji join character). + +*** + +### temperature? + +> `optional` **temperature**: `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:212](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L212) + +Scales output logits by the inverse of temperature. Controls the randomness / creativity of text generation. + +*** + +### topp? + +> `optional` **topp**: `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:213](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L213) + +Only samples from the smallest set of tokens whose cumulative probability exceeds topp. diff --git a/docs/docs/06-api-reference/interfaces/ImageEmbeddingsProps.md b/docs/docs/06-api-reference/interfaces/ImageEmbeddingsProps.md new file mode 100644 index 000000000..093618901 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ImageEmbeddingsProps.md @@ -0,0 +1,29 @@ +# Interface: ImageEmbeddingsProps + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L12) + +Props for the `useImageEmbeddings` hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L13) + +An object containing the model source. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L14) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/ImageEmbeddingsType.md b/docs/docs/06-api-reference/interfaces/ImageEmbeddingsType.md new file mode 100644 index 000000000..35fb7a247 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ImageEmbeddingsType.md @@ -0,0 +1,74 @@ +# Interface: ImageEmbeddingsType + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L23) + +Return type for the `useImageEmbeddings` hook. +Manages the state and operations for generating image embeddings (feature vectors) used in Computer Vision tasks. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L42) + +Represents the download progress of the model binary as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L27) + +Contains the error object if the model failed to load, download, or encountered a runtime error during embedding generation. + +*** + +### forward() + +> **forward**: (`imageSource`) => `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L50) + +Executes the model's forward pass to generate embeddings (a feature vector) for the provided image. + +#### Parameters + +##### imageSource + +`string` + +A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A Promise that resolves to a `Float32Array` containing the generated embedding vector. + +#### Throws + +If the model is not loaded or is currently processing another image. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L37) + +Indicates whether the model is currently generating embeddings for an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/imageEmbeddings.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageEmbeddings.ts#L32) + +Indicates whether the image embeddings model is loaded and ready to process images. diff --git a/docs/docs/06-api-reference/interfaces/ImageSegmentationProps.md b/docs/docs/06-api-reference/interfaces/ImageSegmentationProps.md new file mode 100644 index 000000000..aa2a0bbc6 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ImageSegmentationProps.md @@ -0,0 +1,29 @@ +# Interface: ImageSegmentationProps + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:44](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L44) + +Props for the `useImageSegmentation` hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:45](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L45) + +An object containing the model source. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:46](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L46) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/ImageSegmentationType.md b/docs/docs/06-api-reference/interfaces/ImageSegmentationType.md new file mode 100644 index 000000000..1a4564d1e --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ImageSegmentationType.md @@ -0,0 +1,86 @@ +# Interface: ImageSegmentationType + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L55) + +Return type for the `useImageSegmentation` hook. +Manages the state and operations for Computer Vision image segmentation (e.g., DeepLab). + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:74](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L74) + +Represents the download progress of the model binary as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:59](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L59) + +Contains the error object if the model failed to load, download, or encountered a runtime error during segmentation. + +*** + +### forward() + +> **forward**: (`imageSource`, `classesOfInterest?`, `resize?`) => `Promise`\<`Partial`\<`Record`\<[`DeeplabLabel`](../enumerations/DeeplabLabel.md), `number`[]\>\>\> + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:84](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L84) + +Executes the model's forward pass to perform semantic segmentation on the provided image. + +#### Parameters + +##### imageSource + +`string` + +A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + +##### classesOfInterest? + +[`DeeplabLabel`](../enumerations/DeeplabLabel.md)[] + +An optional array of `DeeplabLabel` enums. If provided, the model will only return segmentation masks for these specific classes. + +##### resize? + +`boolean` + +An optional boolean indicating whether the output segmentation masks should be resized to match the original image dimensions. Defaults to standard model behavior if undefined. + +#### Returns + +`Promise`\<`Partial`\<`Record`\<[`DeeplabLabel`](../enumerations/DeeplabLabel.md), `number`[]\>\>\> + +A Promise that resolves to an object mapping each detected `DeeplabLabel` to its corresponding segmentation mask (represented as a flattened array of numbers). + +#### Throws + +If the model is not loaded or is currently processing another image. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:69](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L69) + +Indicates whether the model is currently processing an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/imageSegmentation.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/imageSegmentation.ts#L64) + +Indicates whether the segmentation model is loaded and ready to process images. diff --git a/docs/docs/06-api-reference/interfaces/KokoroConfig.md b/docs/docs/06-api-reference/interfaces/KokoroConfig.md new file mode 100644 index 000000000..14ec2db64 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/KokoroConfig.md @@ -0,0 +1,36 @@ +# Interface: KokoroConfig + +Defined in: [packages/react-native-executorch/src/types/tts.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L50) + +Kokoro model configuration. +Only the core Kokoro model sources, as phonemizer sources are included in voice configuration. + +## Properties + +### durationPredictorSource + +> **durationPredictorSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:52](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L52) + +source to Kokoro's duration predictor model binary + +*** + +### synthesizerSource + +> **synthesizerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:53](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L53) + +source to Kokoro's synthesizer model binary + +*** + +### type + +> **type**: `"kokoro"` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:51](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L51) + +model type identifier diff --git a/docs/docs/06-api-reference/interfaces/KokoroVoiceExtras.md b/docs/docs/06-api-reference/interfaces/KokoroVoiceExtras.md new file mode 100644 index 000000000..4fda2615e --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/KokoroVoiceExtras.md @@ -0,0 +1,25 @@ +# Interface: KokoroVoiceExtras + +Defined in: [packages/react-native-executorch/src/types/tts.ts:36](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L36) + +Kokoro-specific voice extra props + +## Properties + +### lexiconSource + +> **lexiconSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:38](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L38) + +source to Kokoro's lexicon binary + +*** + +### taggerSource + +> **taggerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L37) + +source to Kokoro's tagger model binary diff --git a/docs/docs/06-api-reference/interfaces/LLMConfig.md b/docs/docs/06-api-reference/interfaces/LLMConfig.md new file mode 100644 index 000000000..04ed26e4e --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/LLMConfig.md @@ -0,0 +1,55 @@ +# Interface: LLMConfig + +Defined in: [packages/react-native-executorch/src/types/llm.ts:97](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L97) + +Configuration object for initializing and customizing a Large Language Model (LLM) instance. + +## Properties + +### chatConfig? + +> `optional` **chatConfig**: `Partial`\<[`ChatConfig`](ChatConfig.md)\> + +Defined in: [packages/react-native-executorch/src/types/llm.ts:107](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L107) + +Object configuring chat management, contains following properties: + +`systemPrompt` - Often used to tell the model what is its purpose, for example - "Be a helpful translator". + +`initialMessageHistory` - An array of `Message` objects that represent the conversation history. This can be used to provide initial context to the model. + +`contextWindowLength` - The number of messages from the current conversation that the model will use to generate a response. The higher the number, the more context the model will have. Keep in mind that using larger context windows will result in longer inference time and higher memory usage. + +*** + +### generationConfig? + +> `optional` **generationConfig**: [`GenerationConfig`](GenerationConfig.md) + +Defined in: [packages/react-native-executorch/src/types/llm.ts:131](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L131) + +Object configuring generation settings. + +`outputTokenBatchSize` - Soft upper limit on the number of tokens in each token batch (in certain cases there can be more tokens in given batch, i.e. when the batch would end with special emoji join character). + +`batchTimeInterval` - Upper limit on the time interval between consecutive token batches. + +`temperature` - Scales output logits by the inverse of temperature. Controls the randomness / creativity of text generation. + +`topp` - Only samples from the smallest set of tokens whose cumulative probability exceeds topp. + +*** + +### toolsConfig? + +> `optional` **toolsConfig**: [`ToolsConfig`](ToolsConfig.md) + +Defined in: [packages/react-native-executorch/src/types/llm.ts:118](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L118) + +Object configuring options for enabling and managing tool use. **It will only have effect if your model's chat template support it**. Contains following properties: + +`tools` - List of objects defining tools. + +`executeToolCallback` - Function that accepts `ToolCall`, executes tool and returns the string to model. + +`displayToolCalls` - If set to true, JSON tool calls will be displayed in chat. If false, only answers will be displayed. diff --git a/docs/docs/06-api-reference/interfaces/LLMType.md b/docs/docs/06-api-reference/interfaces/LLMType.md new file mode 100644 index 000000000..6139b1b45 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/LLMType.md @@ -0,0 +1,201 @@ +# Interface: LLMType + +Defined in: [packages/react-native-executorch/src/types/llm.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L8) + +React hook for managing a Large Language Model (LLM) instance. + +## Properties + +### configure() + +> **configure**: (`configuration`) => `void` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L50) + +Configures chat and tool calling. +See [Configuring the model](../../03-hooks/01-natural-language-processing/useLLM.md#configuring-the-model) for details. + +#### Parameters + +##### configuration + +[`LLMConfig`](LLMConfig.md) + +Configuration object containing `chatConfig`, `toolsConfig`, and `generationConfig`. + +#### Returns + +`void` + +*** + +### deleteMessage() + +> **deleteMessage**: (`index`) => `void` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:84](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L84) + +Deletes all messages starting with message on `index` position. After deletion `messageHistory` will be updated. + +#### Parameters + +##### index + +`number` + +The index of the message to delete from history. + +#### Returns + +`void` + +*** + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L37) + +Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L42) + +Contains the error message if the model failed to load. + +*** + +### generate() + +> **generate**: (`messages`, `tools?`) => `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/types/llm.ts:69](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L69) + +Runs model to complete chat passed in `messages` argument. It doesn't manage conversation context. + +#### Parameters + +##### messages + +[`Message`](Message.md)[] + +Array of messages representing the chat history. + +##### tools? + +`Object`[] + +Optional array of tools that can be used during generation. + +#### Returns + +`Promise`\<`void`\> + +*** + +### getGeneratedTokenCount() + +> **getGeneratedTokenCount**: () => `number` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:61](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L61) + +Returns the number of tokens generated so far in the current generation. + +#### Returns + +`number` + +The count of generated tokens. + +*** + +### interrupt() + +> **interrupt**: () => `void` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:89](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L89) + +Function to interrupt the current inference. + +#### Returns + +`void` + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L32) + +Indicates whether the model is currently generating a response. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L27) + +Indicates whether the model is ready. + +*** + +### messageHistory + +> **messageHistory**: [`Message`](Message.md)[] + +Defined in: [packages/react-native-executorch/src/types/llm.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L12) + +History containing all messages in conversation. This field is updated after model responds to sendMessage. + +*** + +### response + +> **response**: `string` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L17) + +State of the generated response. This field is updated with each token generated by the model. + +*** + +### sendMessage() + +> **sendMessage**: (`message`) => `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/types/llm.ts:77](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L77) + +Function to add user message to conversation. +After model responds, `messageHistory` will be updated with both user message and model response. + +#### Parameters + +##### message + +`string` + +The message string to send. + +#### Returns + +`Promise`\<`void`\> + +*** + +### token + +> **token**: `string` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L22) + +The most recently generated token. diff --git a/docs/docs/06-api-reference/interfaces/Message.md b/docs/docs/06-api-reference/interfaces/Message.md new file mode 100644 index 000000000..9d899bdf4 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/Message.md @@ -0,0 +1,25 @@ +# Interface: Message + +Defined in: [packages/react-native-executorch/src/types/llm.ts:148](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L148) + +Represents a message in the conversation. + +## Properties + +### content + +> **content**: `string` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:150](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L150) + +Content of the message. + +*** + +### role + +> **role**: [`MessageRole`](../type-aliases/MessageRole.md) + +Defined in: [packages/react-native-executorch/src/types/llm.ts:149](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L149) + +Role of the message sender of type `MessageRole`. diff --git a/docs/docs/06-api-reference/interfaces/OCRDetection.md b/docs/docs/06-api-reference/interfaces/OCRDetection.md new file mode 100644 index 000000000..2a00abdc8 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/OCRDetection.md @@ -0,0 +1,36 @@ +# Interface: OCRDetection + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L14) + +OCRDetection represents a single detected text instance in an image, +including its bounding box, recognized text, and confidence score. + +## Properties + +### bbox + +> **bbox**: [`Point`](Point.md)[] + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L15) + +An array of points defining the bounding box around the detected text. + +*** + +### score + +> **score**: `number` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L17) + +The confidence score of the OCR detection, ranging from 0 to 1. + +*** + +### text + +> **text**: `string` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:16](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L16) + +The recognized text within the bounding box. diff --git a/docs/docs/06-api-reference/interfaces/OCRProps.md b/docs/docs/06-api-reference/interfaces/OCRProps.md new file mode 100644 index 000000000..4f26145f8 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/OCRProps.md @@ -0,0 +1,48 @@ +# Interface: OCRProps + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L37) + +Configuration properties for the `useOCR` hook. + +## Extended by + +- [`VerticalOCRProps`](VerticalOCRProps.md) + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L41) + +Object containing the necessary model sources and configuration for the OCR pipeline. + +#### detectorSource + +> **detectorSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the text detector model binary. + +#### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +The language configuration enum for the OCR model (e.g., English, Polish, etc.). + +#### recognizerSource + +> **recognizerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the text recognizer model binary. + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:62](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L62) + +Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. +Defaults to `false`. diff --git a/docs/docs/06-api-reference/interfaces/OCRType.md b/docs/docs/06-api-reference/interfaces/OCRType.md new file mode 100644 index 000000000..f33cc93a5 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/OCRType.md @@ -0,0 +1,74 @@ +# Interface: OCRType + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:84](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L84) + +Return type for the `useOCR` hook. +Manages the state and operations for Optical Character Recognition (OCR). + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:103](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L103) + +Represents the total download progress of the model binaries as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:88](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L88) + +Contains the error object if the models failed to load, download, or encountered a runtime error during recognition. + +*** + +### forward() + +> **forward**: (`imageSource`) => `Promise`\<[`OCRDetection`](OCRDetection.md)[]\> + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:111](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L111) + +Executes the OCR pipeline (detection and recognition) on the provided image. + +#### Parameters + +##### imageSource + +`string` + +A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + +#### Returns + +`Promise`\<[`OCRDetection`](OCRDetection.md)[]\> + +A Promise that resolves to the OCR results (typically containing the recognized text strings and their bounding boxes). + +#### Throws + +If the models are not loaded or are currently processing another image. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:98](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L98) + +Indicates whether the model is currently processing an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:93](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L93) + +Indicates whether both detector and recognizer models are loaded and ready to process images. diff --git a/docs/docs/06-api-reference/interfaces/ObjectDetectionProps.md b/docs/docs/06-api-reference/interfaces/ObjectDetectionProps.md new file mode 100644 index 000000000..60868eff2 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ObjectDetectionProps.md @@ -0,0 +1,29 @@ +# Interface: ObjectDetectionProps + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:140](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L140) + +Props for the `useObjectDetection` hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:141](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L141) + +An object containing the model source. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:142](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L142) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/ObjectDetectionType.md b/docs/docs/06-api-reference/interfaces/ObjectDetectionType.md new file mode 100644 index 000000000..c9ba4db56 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ObjectDetectionType.md @@ -0,0 +1,80 @@ +# Interface: ObjectDetectionType + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:151](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L151) + +Return type for the `useObjectDetection` hook. +Manages the state and operations for Computer Vision object detection tasks. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:170](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L170) + +Represents the download progress of the model binary as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:155](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L155) + +Contains the error object if the model failed to load, download, or encountered a runtime error during detection. + +*** + +### forward() + +> **forward**: (`imageSource`, `detectionThreshold?`) => `Promise`\<[`Detection`](Detection.md)[]\> + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:179](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L179) + +Executes the model's forward pass to detect objects within the provided image. + +#### Parameters + +##### imageSource + +`string` + +A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + +##### detectionThreshold? + +`number` + +An optional number between 0 and 1 representing the minimum confidence score required for an object to be included in the results. Dafault is 0.7. + +#### Returns + +`Promise`\<[`Detection`](Detection.md)[]\> + +A Promise that resolves to an array of `Detection` objects, where each object typically contains bounding box coordinates, a class label, and a confidence score. + +#### Throws + +If the model is not loaded or is currently processing another image. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:165](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L165) + +Indicates whether the model is currently processing an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/objectDetection.ts:160](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/objectDetection.ts#L160) + +Indicates whether the object detection model is loaded and ready to process images. diff --git a/docs/docs/06-api-reference/interfaces/Point.md b/docs/docs/06-api-reference/interfaces/Point.md new file mode 100644 index 000000000..3b4eb598d --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/Point.md @@ -0,0 +1,25 @@ +# Interface: Point + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L27) + +Point represents a coordinate in 2D space. + +## Properties + +### x + +> **x**: `number` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L28) + +The x-coordinate of the point. + +*** + +### y + +> **y**: `number` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:29](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L29) + +The y-coordinate of the point. diff --git a/docs/docs/06-api-reference/interfaces/Segment.md b/docs/docs/06-api-reference/interfaces/Segment.md new file mode 100644 index 000000000..0f057bd5d --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/Segment.md @@ -0,0 +1,25 @@ +# Interface: Segment + +Defined in: [packages/react-native-executorch/src/types/vad.ts:24](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L24) + +Represents a detected audio segment with start and end timestamps. + +## Properties + +### end + +> **end**: `number` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:26](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L26) + +End time of the segment in seconds. + +*** + +### start + +> **start**: `number` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:25](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L25) + +Start time of the segment in seconds. diff --git a/docs/docs/06-api-reference/interfaces/SpeechToTextModelConfig.md b/docs/docs/06-api-reference/interfaces/SpeechToTextModelConfig.md new file mode 100644 index 000000000..0204727fe --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/SpeechToTextModelConfig.md @@ -0,0 +1,45 @@ +# Interface: SpeechToTextModelConfig + +Defined in: [packages/react-native-executorch/src/types/stt.ts:185](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L185) + +Configuration for Speech to Text model. + +## Properties + +### decoderSource + +> **decoderSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/stt.ts:199](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L199) + +A string that specifies the location of a `.pte` file for the decoder. + +*** + +### encoderSource + +> **encoderSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/stt.ts:194](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L194) + +A string that specifies the location of a `.pte` file for the encoder. + +*** + +### isMultilingual + +> **isMultilingual**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:189](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L189) + +A boolean flag indicating whether the model supports multiple languages. + +*** + +### tokenizerSource + +> **tokenizerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/stt.ts:204](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L204) + +A string that specifies the location to the tokenizer for the model. diff --git a/docs/docs/06-api-reference/interfaces/SpeechToTextType.md b/docs/docs/06-api-reference/interfaces/SpeechToTextType.md new file mode 100644 index 000000000..565aa1ca8 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/SpeechToTextType.md @@ -0,0 +1,215 @@ +# Interface: SpeechToTextType + +Defined in: [packages/react-native-executorch/src/types/stt.ts:9](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L9) + +React hook for managing Speech to Text (STT) instance. + +## Properties + +### committedTranscription + +> **committedTranscription**: `string` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L34) + +Contains the part of the transcription that is finalized and will not change. +Useful for displaying stable results during streaming. + +*** + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L28) + +Tracks the progress of the model download process. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L13) + +Contains the error message if the model failed to load. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L23) + +Indicates whether the model is currently processing an inference. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:18](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L18) + +Indicates whether the model has successfully loaded and is ready for inference. + +*** + +### nonCommittedTranscription + +> **nonCommittedTranscription**: `string` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:40](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L40) + +Contains the part of the transcription that is still being processed and may change. +Useful for displaying live, partial results during streaming. + +## Methods + +### decode() + +> **decode**(`tokens`, `encoderOutput`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/types/stt.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L55) + +Runs the decoder of the model. Passing `number[]` is deprecated. + +#### Parameters + +##### tokens + +The encoded audio data. + +`number`[] | `Int32Array`\<`ArrayBufferLike`\> + +##### encoderOutput + +The output from the encoder. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A promise resolving to the decoded text. + +*** + +### encode() + +> **encode**(`waveform`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/types/stt.ts:47](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L47) + +Runs the encoding part of the model on the provided waveform. Passing `number[]` is deprecated. + +#### Parameters + +##### waveform + +The input audio waveform array. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A promise resolving to the encoded data. + +*** + +### stream() + +> **stream**(`options?`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/types/stt.ts:73](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L73) + +Starts a streaming transcription process. +Use in combination with streamInsert to feed audio chunks and streamStop to end the stream. +Updates `committedTranscription` and `nonCommittedTranscription` as transcription progresses. + +#### Parameters + +##### options? + +[`DecodingOptions`](DecodingOptions.md) + +Decoding options including language. + +#### Returns + +`Promise`\<`string`\> + +The final transcription string. + +*** + +### streamInsert() + +> **streamInsert**(`waveform`): `void` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:80](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L80) + +Inserts a chunk of audio data (sampled at 16kHz) into the ongoing streaming transcription. +Passing `number[]` is deprecated. + +#### Parameters + +##### waveform + +The audio chunk to insert. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +#### Returns + +`void` + +*** + +### streamStop() + +> **streamStop**(): `void` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:85](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L85) + +Stops the ongoing streaming transcription process. + +#### Returns + +`void` + +*** + +### transcribe() + +> **transcribe**(`waveform`, `options?`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/types/stt.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L64) + +Starts a transcription process for a given input array, which should be a waveform at 16kHz. +Passing `number[]` is deprecated. + +#### Parameters + +##### waveform + +The input audio waveform. + +`number`[] | `Float32Array`\<`ArrayBufferLike`\> + +##### options? + +[`DecodingOptions`](DecodingOptions.md) + +Decoding options, e.g. `{ language: 'es' }` for multilingual models. + +#### Returns + +`Promise`\<`string`\> + +Resolves a promise with the output transcription when the model is finished. diff --git a/docs/docs/06-api-reference/interfaces/StyleTransferProps.md b/docs/docs/06-api-reference/interfaces/StyleTransferProps.md new file mode 100644 index 000000000..ddb1a23c2 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/StyleTransferProps.md @@ -0,0 +1,29 @@ +# Interface: StyleTransferProps + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L12) + +Configuration properties for the `useStyleTransfer` hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L13) + +Object containing the `modelSource` for the style transfer model. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L14) + +Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/StyleTransferType.md b/docs/docs/06-api-reference/interfaces/StyleTransferType.md new file mode 100644 index 000000000..b70ddb808 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/StyleTransferType.md @@ -0,0 +1,74 @@ +# Interface: StyleTransferType + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L23) + +Return type for the `useStyleTransfer` hook. +Manages the state and operations for applying artistic style transfer to images. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L42) + +Represents the download progress of the model binary as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L27) + +Contains the error object if the model failed to load, download, or encountered a runtime error during style transfer. + +*** + +### forward() + +> **forward**: (`imageSource`) => `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L50) + +Executes the model's forward pass to apply the specific artistic style to the provided image. + +#### Parameters + +##### imageSource + +`string` + +A string representing the input image source (e.g., a file path, URI, or base64 string) to be stylized. + +#### Returns + +`Promise`\<`string`\> + +A Promise that resolves to a string containing the stylized image (typically as a base64 string or a file URI). + +#### Throws + +If the model is not loaded or is currently processing another image. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L37) + +Indicates whether the model is currently processing an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/styleTransfer.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/styleTransfer.ts#L32) + +Indicates whether the style transfer model is loaded and ready to process images. diff --git a/docs/docs/06-api-reference/interfaces/TensorPtr.md b/docs/docs/06-api-reference/interfaces/TensorPtr.md new file mode 100644 index 000000000..e8df36b3a --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TensorPtr.md @@ -0,0 +1,35 @@ +# Interface: TensorPtr + +Defined in: [packages/react-native-executorch/src/types/common.ts:134](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L134) + +Represents a pointer to a tensor, including its data buffer, size dimensions, and scalar type. + +## Properties + +### dataPtr + +> **dataPtr**: [`TensorBuffer`](../type-aliases/TensorBuffer.md) + +Defined in: [packages/react-native-executorch/src/types/common.ts:135](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L135) + +The data buffer of the tensor. + +*** + +### scalarType + +> **scalarType**: [`ScalarType`](../enumerations/ScalarType.md) + +Defined in: [packages/react-native-executorch/src/types/common.ts:137](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L137) + +The scalar type of the tensor, as defined in the `ScalarType` enum. + +*** + +### sizes + +> **sizes**: `number`[] + +Defined in: [packages/react-native-executorch/src/types/common.ts:136](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L136) + +An array representing the size of each dimension of the tensor. diff --git a/docs/docs/06-api-reference/interfaces/TextEmbeddingsProps.md b/docs/docs/06-api-reference/interfaces/TextEmbeddingsProps.md new file mode 100644 index 000000000..aa2ffd297 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextEmbeddingsProps.md @@ -0,0 +1,33 @@ +# Interface: TextEmbeddingsProps + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L48) + +Props for the useTextEmbeddings hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:49](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L49) + +An object containing the model and tokenizer sources. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +#### tokenizerSource + +> **tokenizerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:53](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L53) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/TextEmbeddingsType.md b/docs/docs/06-api-reference/interfaces/TextEmbeddingsType.md new file mode 100644 index 000000000..f43a03f07 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextEmbeddingsType.md @@ -0,0 +1,73 @@ +# Interface: TextEmbeddingsType + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:9](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L9) + +React hook state and methods for managing a Text Embeddings model instance. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L28) + +Tracks the progress of the model download process (value between 0 and 1). + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L13) + +Contains the error message if the model failed to load or during inference. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L23) + +Indicates whether the model is currently generating embeddings. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:18](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L18) + +Indicates whether the embeddings model has successfully loaded and is ready for inference. + +## Methods + +### forward() + +> **forward**(`input`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/types/textEmbeddings.ts:36](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/textEmbeddings.ts#L36) + +Runs the text embeddings model on the provided input string. + +#### Parameters + +##### input + +`string` + +The text string to embed. + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A promise resolving to a Float32Array containing the vector embeddings. + +#### Throws + +If the model is not loaded or is currently processing another request. diff --git a/docs/docs/06-api-reference/interfaces/TextToImageParams.md b/docs/docs/06-api-reference/interfaces/TextToImageParams.md new file mode 100644 index 000000000..c81c0857b --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToImageParams.md @@ -0,0 +1,79 @@ +# Interface: TextToImageParams + +Defined in: [packages/react-native-executorch/src/types/tti.ts:9](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L9) + +Configuration properties for the `useTextToImage` hook. + +## Properties + +### inferenceCallback()? + +> `optional` **inferenceCallback**: (`stepIdx`) => `void` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:31](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L31) + +Optional callback function that is triggered after each diffusion inference step. +Useful for updating a progress bar during image generation. + +#### Parameters + +##### stepIdx + +`number` + +The index of the current inference step. + +#### Returns + +`void` + +*** + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L13) + +Object containing the required model sources for the diffusion pipeline. + +#### decoderSource + +> **decoderSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Source for the VAE decoder model binary, used to decode the final image. + +#### encoderSource + +> **encoderSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Source for the text encoder model binary. + +#### schedulerSource + +> **schedulerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Source for the diffusion scheduler binary/config. + +#### tokenizerSource + +> **tokenizerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Source for the text tokenizer binary/config. + +#### unetSource + +> **unetSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Source for the UNet (noise predictor) model binary. + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L37) + +Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. +Defaults to `false`. diff --git a/docs/docs/06-api-reference/interfaces/TextToImageType.md b/docs/docs/06-api-reference/interfaces/TextToImageType.md new file mode 100644 index 000000000..e304b8a4e --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToImageType.md @@ -0,0 +1,106 @@ +# Interface: TextToImageType + +Defined in: [packages/react-native-executorch/src/types/tti.ts:46](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L46) + +Return type for the `useTextToImage` hook. +Manages the state and operations for generating images from text prompts using a diffusion model pipeline. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:65](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L65) + +Represents the total download progress of all the model binaries combined, as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:50](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L50) + +Contains the error object if any of the pipeline models failed to load, download, or encountered a runtime error. + +*** + +### generate() + +> **generate**: (`input`, `imageSize?`, `numSteps?`, `seed?`) => `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/types/tti.ts:76](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L76) + +Runs the diffusion pipeline to generate an image from the provided text prompt. + +#### Parameters + +##### input + +`string` + +The text prompt describing the desired image. + +##### imageSize? + +`number` + +Optional. The target width and height of the generated image (e.g., 512 for 512x512). Defaults to the model's standard size if omitted. + +##### numSteps? + +`number` + +Optional. The number of denoising steps for the diffusion process. More steps generally yield higher quality at the cost of generation time. + +##### seed? + +`number` + +Optional. A random seed for reproducible generation. + +#### Returns + +`Promise`\<`string`\> + +A Promise that resolves to a string representing the generated image (e.g., base64 string or file URI). + +#### Throws + +If the model is not loaded or is currently generating another image. + +*** + +### interrupt() + +> **interrupt**: () => `void` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:86](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L86) + +Interrupts the currently active image generation process at the next available inference step. + +#### Returns + +`void` + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:60](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L60) + +Indicates whether the model is currently generating an image. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tti.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tti.ts#L55) + +Indicates whether the entire diffusion pipeline is loaded into memory and ready for generation. diff --git a/docs/docs/06-api-reference/interfaces/TextToSpeechConfig.md b/docs/docs/06-api-reference/interfaces/TextToSpeechConfig.md new file mode 100644 index 000000000..6cfbdf9da --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToSpeechConfig.md @@ -0,0 +1,29 @@ +# Interface: TextToSpeechConfig + +Defined in: [packages/react-native-executorch/src/types/tts.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L64) + +General Text to Speech module configuration + +## Extended by + +- [`TextToSpeechProps`](TextToSpeechProps.md) + +## Properties + +### model + +> **model**: [`KokoroConfig`](KokoroConfig.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:65](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L65) + +a selected T2S model + +*** + +### voice + +> **voice**: [`VoiceConfig`](VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:66](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L66) + +a selected speaker's voice diff --git a/docs/docs/06-api-reference/interfaces/TextToSpeechInput.md b/docs/docs/06-api-reference/interfaces/TextToSpeechInput.md new file mode 100644 index 000000000..46377e8ea --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToSpeechInput.md @@ -0,0 +1,29 @@ +# Interface: TextToSpeechInput + +Defined in: [packages/react-native-executorch/src/types/tts.ts:88](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L88) + +Text to Speech module input definition + +## Extended by + +- [`TextToSpeechStreamingInput`](TextToSpeechStreamingInput.md) + +## Properties + +### speed? + +> `optional` **speed**: `number` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:90](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L90) + +optional speed argument - the higher it is, the faster the speech becomes + +*** + +### text + +> **text**: `string` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:89](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L89) + +a text to be spoken diff --git a/docs/docs/06-api-reference/interfaces/TextToSpeechProps.md b/docs/docs/06-api-reference/interfaces/TextToSpeechProps.md new file mode 100644 index 000000000..769751e24 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToSpeechProps.md @@ -0,0 +1,47 @@ +# Interface: TextToSpeechProps + +Defined in: [packages/react-native-executorch/src/types/tts.ts:77](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L77) + +Props for the useTextToSpeech hook. + +## Extends + +- [`TextToSpeechConfig`](TextToSpeechConfig.md) + +## Properties + +### model + +> **model**: [`KokoroConfig`](KokoroConfig.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:65](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L65) + +a selected T2S model + +#### Inherited from + +[`TextToSpeechConfig`](TextToSpeechConfig.md).[`model`](TextToSpeechConfig.md#model) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:78](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L78) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + +*** + +### voice + +> **voice**: [`VoiceConfig`](VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:66](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L66) + +a selected speaker's voice + +#### Inherited from + +[`TextToSpeechConfig`](TextToSpeechConfig.md).[`voice`](TextToSpeechConfig.md#voice) diff --git a/docs/docs/06-api-reference/interfaces/TextToSpeechStreamingInput.md b/docs/docs/06-api-reference/interfaces/TextToSpeechStreamingInput.md new file mode 100644 index 000000000..d68eea683 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToSpeechStreamingInput.md @@ -0,0 +1,90 @@ +# Interface: TextToSpeechStreamingInput + +Defined in: [packages/react-native-executorch/src/types/tts.ts:156](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L156) + +Text to Speech streaming input definition + +Streaming mode in T2S is synchronized by passing specific callbacks +executed at given moments of the streaming. +Actions such as playing the audio should happen within the onNext callback. +Callbacks can be both synchronous or asynchronous. + +## Extends + +- [`TextToSpeechInput`](TextToSpeechInput.md) + +## Properties + +### onBegin()? + +> `optional` **onBegin**: () => `void` \| `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/types/tts.ts:157](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L157) + +Called when streaming begins + +#### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### onEnd()? + +> `optional` **onEnd**: () => `void` \| `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/types/tts.ts:159](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L159) + +Called when streaming ends + +#### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### onNext()? + +> `optional` **onNext**: (`audio`) => `void` \| `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/types/tts.ts:158](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L158) + +Called after each audio chunk gets calculated. + +#### Parameters + +##### audio + +`Float32Array` + +#### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### speed? + +> `optional` **speed**: `number` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:90](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L90) + +optional speed argument - the higher it is, the faster the speech becomes + +#### Inherited from + +[`TextToSpeechInput`](TextToSpeechInput.md).[`speed`](TextToSpeechInput.md#speed) + +*** + +### text + +> **text**: `string` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:89](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L89) + +a text to be spoken + +#### Inherited from + +[`TextToSpeechInput`](TextToSpeechInput.md).[`text`](TextToSpeechInput.md#text) diff --git a/docs/docs/06-api-reference/interfaces/TextToSpeechType.md b/docs/docs/06-api-reference/interfaces/TextToSpeechType.md new file mode 100644 index 000000000..8f594baf6 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TextToSpeechType.md @@ -0,0 +1,119 @@ +# Interface: TextToSpeechType + +Defined in: [packages/react-native-executorch/src/types/tts.ts:99](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L99) + +Return type for the `useTextToSpeech` hook. +Manages the state and operations for Text-to-Speech generation. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:118](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L118) + +Represents the download progress of the model and voice assets as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:103](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L103) + +Contains the error object if the model failed to load or encountered an error during inference. + +*** + +### forward() + +> **forward**: (`input`) => `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +Defined in: [packages/react-native-executorch/src/types/tts.ts:126](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L126) + +Runs the model to convert the provided text into speech audio in a single pass. +* + +#### Parameters + +##### input + +[`TextToSpeechInput`](TextToSpeechInput.md) + +The `TextToSpeechInput` object containing the `text` to synthesize and optional `speed`. + +#### Returns + +`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\> + +A Promise that resolves with the generated audio data (typically a `Float32Array`). + +#### Throws + +If the model is not loaded or is currently generating. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:113](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L113) + +Indicates whether the model is currently generating audio. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:108](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L108) + +Indicates whether the Text-to-Speech model is loaded and ready to accept inputs. + +*** + +### stream() + +> **stream**: (`input`) => `Promise`\<`void`\> + +Defined in: [packages/react-native-executorch/src/types/tts.ts:135](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L135) + +Streams the generated audio data incrementally. +This is optimal for real-time playback, allowing audio to start playing before the full text is synthesized. +* + +#### Parameters + +##### input + +[`TextToSpeechStreamingInput`](TextToSpeechStreamingInput.md) + +The `TextToSpeechStreamingInput` object containing `text`, optional `speed`, and lifecycle callbacks (`onBegin`, `onNext`, `onEnd`). + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the streaming process is complete. + +#### Throws + +If the model is not loaded or is currently generating. + +*** + +### streamStop() + +> **streamStop**: () => `void` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:140](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L140) + +Interrupts and stops the currently active audio generation stream. + +#### Returns + +`void` diff --git a/docs/docs/06-api-reference/interfaces/TokenizerType.md b/docs/docs/06-api-reference/interfaces/TokenizerType.md new file mode 100644 index 000000000..a3b53eac7 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/TokenizerType.md @@ -0,0 +1,163 @@ +# Interface: TokenizerType + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L8) + +React hook state and methods for managing a Tokenizer instance. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:27](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L27) + +Tracks the progress of the tokenizer download process (value between 0 and 1). + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L12) + +Contains the error message if the tokenizer failed to load or during processing. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:22](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L22) + +Indicates whether the tokenizer is currently processing data. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:17](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L17) + +Indicates whether the tokenizer has successfully loaded and is ready for use. + +## Methods + +### decode() + +> **decode**(`tokens`, `skipSpecialTokens`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:35](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L35) + +Converts an array of token IDs into a string. + +#### Parameters + +##### tokens + +`number`[] + +An array or `number[]` of token IDs to decode. + +##### skipSpecialTokens + +Optional boolean to indicate whether special tokens should be skipped during decoding. + +`boolean` | `undefined` + +#### Returns + +`Promise`\<`string`\> + +A promise resolving to the decoded text string. + +*** + +### encode() + +> **encode**(`text`): `Promise`\<`number`[]\> + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:42](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L42) + +Converts a string into an array of token IDs. + +#### Parameters + +##### text + +`string` + +The input text string to tokenize. + +#### Returns + +`Promise`\<`number`[]\> + +A promise resolving to an array `number[]` containing the encoded token IDs. + +*** + +### getVocabSize() + +> **getVocabSize**(): `Promise`\<`number`\> + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L48) + +Returns the size of the tokenizer's vocabulary. + +#### Returns + +`Promise`\<`number`\> + +A promise resolving to the vocabulary size. + +*** + +### idToToken() + +> **idToToken**(`id`): `Promise`\<`string`\> + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L55) + +Returns the token associated to the ID. + +#### Parameters + +##### id + +`number` + +The numeric token ID. + +#### Returns + +`Promise`\<`string`\> + +A promise resolving to the token string representation. + +*** + +### tokenToId() + +> **tokenToId**(`token`): `Promise`\<`number`\> + +Defined in: [packages/react-native-executorch/src/types/tokenizer.ts:62](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tokenizer.ts#L62) + +Returns the ID associated to the token. + +#### Parameters + +##### token + +`string` + +The token string. + +#### Returns + +`Promise`\<`number`\> + +A promise resolving to the token ID. diff --git a/docs/docs/06-api-reference/interfaces/ToolCall.md b/docs/docs/06-api-reference/interfaces/ToolCall.md new file mode 100644 index 000000000..72a5d2dc8 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ToolCall.md @@ -0,0 +1,25 @@ +# Interface: ToolCall + +Defined in: [packages/react-native-executorch/src/types/llm.ts:160](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L160) + +Represents a tool call made by the model. + +## Properties + +### arguments + +> **arguments**: `Object` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:162](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L162) + +The arguments passed to the tool. + +*** + +### toolName + +> **toolName**: `string` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:161](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L161) + +The name of the tool being called. diff --git a/docs/docs/06-api-reference/interfaces/ToolsConfig.md b/docs/docs/06-api-reference/interfaces/ToolsConfig.md new file mode 100644 index 000000000..ccf0b5a5f --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/ToolsConfig.md @@ -0,0 +1,45 @@ +# Interface: ToolsConfig + +Defined in: [packages/react-native-executorch/src/types/llm.ts:196](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L196) + +Object configuring options for enabling and managing tool use. **It will only have effect if your model's chat template support it**. + +## Properties + +### displayToolCalls? + +> `optional` **displayToolCalls**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:199](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L199) + +If set to true, JSON tool calls will be displayed in chat. If false, only answers will be displayed. + +*** + +### executeToolCallback() + +> **executeToolCallback**: (`call`) => `Promise`\<`string` \| `null`\> + +Defined in: [packages/react-native-executorch/src/types/llm.ts:198](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L198) + +Function that accepts `ToolCall`, executes tool and returns the string to model. + +#### Parameters + +##### call + +[`ToolCall`](ToolCall.md) + +#### Returns + +`Promise`\<`string` \| `null`\> + +*** + +### tools + +> **tools**: `Object`[] + +Defined in: [packages/react-native-executorch/src/types/llm.ts:197](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L197) + +List of objects defining tools. diff --git a/docs/docs/06-api-reference/interfaces/VADProps.md b/docs/docs/06-api-reference/interfaces/VADProps.md new file mode 100644 index 000000000..4339cf37f --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/VADProps.md @@ -0,0 +1,29 @@ +# Interface: VADProps + +Defined in: [packages/react-native-executorch/src/types/vad.ts:12](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L12) + +Props for the useVAD hook. + +## Properties + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:13](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L13) + +An object containing the model source. + +#### modelSource + +> **modelSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:14](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L14) + +Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. diff --git a/docs/docs/06-api-reference/interfaces/VADType.md b/docs/docs/06-api-reference/interfaces/VADType.md new file mode 100644 index 000000000..64a94a2d1 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/VADType.md @@ -0,0 +1,73 @@ +# Interface: VADType + +Defined in: [packages/react-native-executorch/src/types/vad.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L34) + +React hook state and methods for managing a Voice Activity Detection (VAD) model instance. + +## Properties + +### downloadProgress + +> **downloadProgress**: `number` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:53](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L53) + +Represents the download progress as a value between 0 and 1. + +*** + +### error + +> **error**: [`RnExecutorchError`](../classes/RnExecutorchError.md) \| `null` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:38](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L38) + +Contains the error message if the VAD model failed to load or during processing. + +*** + +### isGenerating + +> **isGenerating**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L48) + +Indicates whether the model is currently processing an inference. + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/vad.ts:43](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L43) + +Indicates whether the VAD model has successfully loaded and is ready for inference. + +## Methods + +### forward() + +> **forward**(`waveform`): `Promise`\<[`Segment`](Segment.md)[]\> + +Defined in: [packages/react-native-executorch/src/types/vad.ts:61](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/vad.ts#L61) + +Runs the Voice Activity Detection model on the provided audio waveform. + +#### Parameters + +##### waveform + +`Float32Array` + +The input audio waveform array. + +#### Returns + +`Promise`\<[`Segment`](Segment.md)[]\> + +A promise resolving to an array of detected audio segments (e.g., timestamps for speech). + +#### Throws + +If the model is not loaded or is currently processing another request. diff --git a/docs/docs/06-api-reference/interfaces/VerticalOCRProps.md b/docs/docs/06-api-reference/interfaces/VerticalOCRProps.md new file mode 100644 index 000000000..d284ef736 --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/VerticalOCRProps.md @@ -0,0 +1,67 @@ +# Interface: VerticalOCRProps + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:70](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L70) + +Configuration properties for the `useVerticalOCR` hook. + +## Extends + +- [`OCRProps`](OCRProps.md) + +## Properties + +### independentCharacters? + +> `optional` **independentCharacters**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:75](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L75) + +Boolean indicating whether to treat each character independently during recognition. +Defaults to `false`. + +*** + +### model + +> **model**: `object` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L41) + +Object containing the necessary model sources and configuration for the OCR pipeline. + +#### detectorSource + +> **detectorSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the text detector model binary. + +#### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +The language configuration enum for the OCR model (e.g., English, Polish, etc.). + +#### recognizerSource + +> **recognizerSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +`ResourceSource` that specifies the location of the text recognizer model binary. + +#### Inherited from + +[`OCRProps`](OCRProps.md).[`model`](OCRProps.md#model) + +*** + +### preventLoad? + +> `optional` **preventLoad**: `boolean` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:62](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L62) + +Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. +Defaults to `false`. + +#### Inherited from + +[`OCRProps`](OCRProps.md).[`preventLoad`](OCRProps.md#preventload) diff --git a/docs/docs/06-api-reference/interfaces/VoiceConfig.md b/docs/docs/06-api-reference/interfaces/VoiceConfig.md new file mode 100644 index 000000000..3460a134a --- /dev/null +++ b/docs/docs/06-api-reference/interfaces/VoiceConfig.md @@ -0,0 +1,37 @@ +# Interface: VoiceConfig + +Defined in: [packages/react-native-executorch/src/types/tts.ts:23](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L23) + +Voice configuration + +So far in Kokoro, each voice is directly associated with a language. + +## Properties + +### extra? + +> `optional` **extra**: [`KokoroVoiceExtras`](KokoroVoiceExtras.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:26](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L26) + +an optional extra sources or properties related to specific voice + +*** + +### lang + +> **lang**: [`TextToSpeechLanguage`](../type-aliases/TextToSpeechLanguage.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:24](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L24) + +speaker's language + +*** + +### voiceSource + +> **voiceSource**: [`ResourceSource`](../type-aliases/ResourceSource.md) + +Defined in: [packages/react-native-executorch/src/types/tts.ts:25](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L25) + +a source to a binary file with voice embedding diff --git a/docs/docs/06-api-reference/type-aliases/LLMTool.md b/docs/docs/06-api-reference/type-aliases/LLMTool.md new file mode 100644 index 000000000..083d4eee6 --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/LLMTool.md @@ -0,0 +1,9 @@ +# Type Alias: LLMTool + +> **LLMTool** = `Object` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:172](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L172) + +Represents a tool that can be used by the model. +Usually tool is represented with dictionary (Object), but fields depend on the model. +Unfortunately there's no one standard so it's hard to type it better. diff --git a/docs/docs/06-api-reference/type-aliases/MessageRole.md b/docs/docs/06-api-reference/type-aliases/MessageRole.md new file mode 100644 index 000000000..26135f372 --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/MessageRole.md @@ -0,0 +1,7 @@ +# Type Alias: MessageRole + +> **MessageRole** = `"user"` \| `"assistant"` \| `"system"` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:139](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L139) + +Roles that a message sender can have. diff --git a/docs/docs/06-api-reference/type-aliases/OCRLanguage.md b/docs/docs/06-api-reference/type-aliases/OCRLanguage.md new file mode 100644 index 000000000..227cf2a84 --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/OCRLanguage.md @@ -0,0 +1,7 @@ +# Type Alias: OCRLanguage + +> **OCRLanguage** = keyof *typeof* `symbols` + +Defined in: [packages/react-native-executorch/src/types/ocr.ts:119](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/ocr.ts#L119) + +Enumeration of supported OCR languages based on available symbol sets. diff --git a/docs/docs/06-api-reference/type-aliases/ResourceSource.md b/docs/docs/06-api-reference/type-aliases/ResourceSource.md new file mode 100644 index 000000000..005b6b889 --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/ResourceSource.md @@ -0,0 +1,7 @@ +# Type Alias: ResourceSource + +> **ResourceSource** = `string` \| `number` \| `object` + +Defined in: [packages/react-native-executorch/src/types/common.ts:10](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L10) + +Represents a source of a resource, which can be a string (e.g., URL or file path), a number (e.g., resource ID), or an object (e.g., binary data). diff --git a/docs/docs/06-api-reference/type-aliases/SpeechToTextLanguage.md b/docs/docs/06-api-reference/type-aliases/SpeechToTextLanguage.md new file mode 100644 index 000000000..3b982463f --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/SpeechToTextLanguage.md @@ -0,0 +1,7 @@ +# Type Alias: SpeechToTextLanguage + +> **SpeechToTextLanguage** = `"af"` \| `"sq"` \| `"ar"` \| `"hy"` \| `"az"` \| `"eu"` \| `"be"` \| `"bn"` \| `"bs"` \| `"bg"` \| `"my"` \| `"ca"` \| `"zh"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"et"` \| `"en"` \| `"fi"` \| `"fr"` \| `"gl"` \| `"ka"` \| `"de"` \| `"el"` \| `"gu"` \| `"ht"` \| `"he"` \| `"hi"` \| `"hu"` \| `"is"` \| `"id"` \| `"it"` \| `"ja"` \| `"kn"` \| `"kk"` \| `"km"` \| `"ko"` \| `"lo"` \| `"lv"` \| `"lt"` \| `"mk"` \| `"mg"` \| `"ms"` \| `"ml"` \| `"mt"` \| `"mr"` \| `"ne"` \| `"no"` \| `"fa"` \| `"pl"` \| `"pt"` \| `"pa"` \| `"ro"` \| `"ru"` \| `"sr"` \| `"si"` \| `"sk"` \| `"sl"` \| `"es"` \| `"su"` \| `"sw"` \| `"sv"` \| `"tl"` \| `"tg"` \| `"ta"` \| `"te"` \| `"th"` \| `"tr"` \| `"uk"` \| `"ur"` \| `"uz"` \| `"vi"` \| `"cy"` \| `"yi"` + +Defined in: [packages/react-native-executorch/src/types/stt.ts:93](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/stt.ts#L93) + +Languages supported by whisper (not whisper.en) diff --git a/docs/docs/06-api-reference/type-aliases/TensorBuffer.md b/docs/docs/06-api-reference/type-aliases/TensorBuffer.md new file mode 100644 index 000000000..5f8d7ea25 --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/TensorBuffer.md @@ -0,0 +1,7 @@ +# Type Alias: TensorBuffer + +> **TensorBuffer** = `ArrayBuffer` \| `Float32Array` \| `Float64Array` \| `Int8Array` \| `Int16Array` \| `Int32Array` \| `Uint8Array` \| `Uint16Array` \| `Uint32Array` \| `BigInt64Array` \| `BigUint64Array` + +Defined in: [packages/react-native-executorch/src/types/common.ts:113](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/common.ts#L113) + +Represents the data buffer of a tensor, which can be one of several typed array formats. diff --git a/docs/docs/06-api-reference/type-aliases/TextToSpeechLanguage.md b/docs/docs/06-api-reference/type-aliases/TextToSpeechLanguage.md new file mode 100644 index 000000000..723b7dbbc --- /dev/null +++ b/docs/docs/06-api-reference/type-aliases/TextToSpeechLanguage.md @@ -0,0 +1,7 @@ +# Type Alias: TextToSpeechLanguage + +> **TextToSpeechLanguage** = `"en-us"` \| `"en-gb"` + +Defined in: [packages/react-native-executorch/src/types/tts.ts:9](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/tts.ts#L9) + +List all the languages available in TTS models (as lang shorthands) diff --git a/docs/docs/06-api-reference/typedoc-sidebar.cjs b/docs/docs/06-api-reference/typedoc-sidebar.cjs new file mode 100644 index 000000000..720ee5300 --- /dev/null +++ b/docs/docs/06-api-reference/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */ +const typedocSidebar = {items:[{type:"category",label:"Hooks",items:[{type:"doc",id:"06-api-reference/functions/useClassification",label:"useClassification"},{type:"doc",id:"06-api-reference/functions/useExecutorchModule",label:"useExecutorchModule"},{type:"doc",id:"06-api-reference/functions/useImageEmbeddings",label:"useImageEmbeddings"},{type:"doc",id:"06-api-reference/functions/useImageSegmentation",label:"useImageSegmentation"},{type:"doc",id:"06-api-reference/functions/useLLM",label:"useLLM"},{type:"doc",id:"06-api-reference/functions/useObjectDetection",label:"useObjectDetection"},{type:"doc",id:"06-api-reference/functions/useOCR",label:"useOCR"},{type:"doc",id:"06-api-reference/functions/useSpeechToText",label:"useSpeechToText"},{type:"doc",id:"06-api-reference/functions/useStyleTransfer",label:"useStyleTransfer"},{type:"doc",id:"06-api-reference/functions/useTextEmbeddings",label:"useTextEmbeddings"},{type:"doc",id:"06-api-reference/functions/useTextToImage",label:"useTextToImage"},{type:"doc",id:"06-api-reference/functions/useTextToSpeech",label:"useTextToSpeech"},{type:"doc",id:"06-api-reference/functions/useTokenizer",label:"useTokenizer"},{type:"doc",id:"06-api-reference/functions/useVAD",label:"useVAD"},{type:"doc",id:"06-api-reference/functions/useVerticalOCR",label:"useVerticalOCR"}]},{type:"category",label:"Models - Classification",items:[{type:"doc",id:"06-api-reference/variables/EFFICIENTNET_V2_S",label:"EFFICIENTNET_V2_S"}]},{type:"category",label:"Models - Image Embeddings",items:[{type:"doc",id:"06-api-reference/variables/CLIP_VIT_BASE_PATCH32_IMAGE",label:"CLIP_VIT_BASE_PATCH32_IMAGE"}]},{type:"category",label:"Models - Image Generation",items:[{type:"doc",id:"06-api-reference/variables/BK_SDM_TINY_VPRED_256",label:"BK_SDM_TINY_VPRED_256"},{type:"doc",id:"06-api-reference/variables/BK_SDM_TINY_VPRED_512",label:"BK_SDM_TINY_VPRED_512"}]},{type:"category",label:"Models - Image Segmentation",items:[{type:"doc",id:"06-api-reference/variables/DEEPLAB_V3_RESNET50",label:"DEEPLAB_V3_RESNET50"}]},{type:"category",label:"Models - LMM",items:[{type:"doc",id:"06-api-reference/variables/HAMMER2_1_0_5B",label:"HAMMER2_1_0_5B"},{type:"doc",id:"06-api-reference/variables/HAMMER2_1_0_5B_QUANTIZED",label:"HAMMER2_1_0_5B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/HAMMER2_1_1_5B",label:"HAMMER2_1_1_5B"},{type:"doc",id:"06-api-reference/variables/HAMMER2_1_1_5B_QUANTIZED",label:"HAMMER2_1_1_5B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/HAMMER2_1_3B",label:"HAMMER2_1_3B"},{type:"doc",id:"06-api-reference/variables/HAMMER2_1_3B_QUANTIZED",label:"HAMMER2_1_3B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/LLAMA3_2_1B",label:"LLAMA3_2_1B"},{type:"doc",id:"06-api-reference/variables/LLAMA3_2_1B_QLORA",label:"LLAMA3_2_1B_QLORA"},{type:"doc",id:"06-api-reference/variables/LLAMA3_2_1B_SPINQUANT",label:"LLAMA3_2_1B_SPINQUANT"},{type:"doc",id:"06-api-reference/variables/LLAMA3_2_3B",label:"LLAMA3_2_3B"},{type:"doc",id:"06-api-reference/variables/LLAMA3_2_3B_QLORA",label:"LLAMA3_2_3B_QLORA"},{type:"doc",id:"06-api-reference/variables/LLAMA3_2_3B_SPINQUANT",label:"LLAMA3_2_3B_SPINQUANT"},{type:"doc",id:"06-api-reference/variables/PHI_4_MINI_4B",label:"PHI_4_MINI_4B"},{type:"doc",id:"06-api-reference/variables/PHI_4_MINI_4B_QUANTIZED",label:"PHI_4_MINI_4B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/QWEN2_5_0_5B",label:"QWEN2_5_0_5B"},{type:"doc",id:"06-api-reference/variables/QWEN2_5_0_5B_QUANTIZED",label:"QWEN2_5_0_5B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/QWEN2_5_1_5B",label:"QWEN2_5_1_5B"},{type:"doc",id:"06-api-reference/variables/QWEN2_5_1_5B_QUANTIZED",label:"QWEN2_5_1_5B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/QWEN2_5_3B",label:"QWEN2_5_3B"},{type:"doc",id:"06-api-reference/variables/QWEN2_5_3B_QUANTIZED",label:"QWEN2_5_3B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/QWEN3_0_6B",label:"QWEN3_0_6B"},{type:"doc",id:"06-api-reference/variables/QWEN3_0_6B_QUANTIZED",label:"QWEN3_0_6B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/QWEN3_1_7B",label:"QWEN3_1_7B"},{type:"doc",id:"06-api-reference/variables/QWEN3_1_7B_QUANTIZED",label:"QWEN3_1_7B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/QWEN3_4B",label:"QWEN3_4B"},{type:"doc",id:"06-api-reference/variables/QWEN3_4B_QUANTIZED",label:"QWEN3_4B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/SMOLLM2_1_1_7B",label:"SMOLLM2_1_1_7B"},{type:"doc",id:"06-api-reference/variables/SMOLLM2_1_1_7B_QUANTIZED",label:"SMOLLM2_1_1_7B_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/SMOLLM2_1_135M",label:"SMOLLM2_1_135M"},{type:"doc",id:"06-api-reference/variables/SMOLLM2_1_135M_QUANTIZED",label:"SMOLLM2_1_135M_QUANTIZED"},{type:"doc",id:"06-api-reference/variables/SMOLLM2_1_360M",label:"SMOLLM2_1_360M"},{type:"doc",id:"06-api-reference/variables/SMOLLM2_1_360M_QUANTIZED",label:"SMOLLM2_1_360M_QUANTIZED"}]},{type:"category",label:"Models - Object Detection",items:[{type:"doc",id:"06-api-reference/variables/SSDLITE_320_MOBILENET_V3_LARGE",label:"SSDLITE_320_MOBILENET_V3_LARGE"}]},{type:"category",label:"Models - Speech To Text",items:[{type:"doc",id:"06-api-reference/variables/WHISPER_BASE",label:"WHISPER_BASE"},{type:"doc",id:"06-api-reference/variables/WHISPER_BASE_EN",label:"WHISPER_BASE_EN"},{type:"doc",id:"06-api-reference/variables/WHISPER_SMALL",label:"WHISPER_SMALL"},{type:"doc",id:"06-api-reference/variables/WHISPER_SMALL_EN",label:"WHISPER_SMALL_EN"},{type:"doc",id:"06-api-reference/variables/WHISPER_TINY",label:"WHISPER_TINY"},{type:"doc",id:"06-api-reference/variables/WHISPER_TINY_EN",label:"WHISPER_TINY_EN"},{type:"doc",id:"06-api-reference/variables/WHISPER_TINY_EN_QUANTIZED",label:"WHISPER_TINY_EN_QUANTIZED"}]},{type:"category",label:"Models - Style Transfer",items:[{type:"doc",id:"06-api-reference/variables/STYLE_TRANSFER_CANDY",label:"STYLE_TRANSFER_CANDY"},{type:"doc",id:"06-api-reference/variables/STYLE_TRANSFER_MOSAIC",label:"STYLE_TRANSFER_MOSAIC"},{type:"doc",id:"06-api-reference/variables/STYLE_TRANSFER_RAIN_PRINCESS",label:"STYLE_TRANSFER_RAIN_PRINCESS"},{type:"doc",id:"06-api-reference/variables/STYLE_TRANSFER_UDNIE",label:"STYLE_TRANSFER_UDNIE"}]},{type:"category",label:"Models - Text Embeddings",items:[{type:"doc",id:"06-api-reference/variables/ALL_MINILM_L6_V2",label:"ALL_MINILM_L6_V2"},{type:"doc",id:"06-api-reference/variables/ALL_MPNET_BASE_V2",label:"ALL_MPNET_BASE_V2"},{type:"doc",id:"06-api-reference/variables/CLIP_VIT_BASE_PATCH32_TEXT",label:"CLIP_VIT_BASE_PATCH32_TEXT"},{type:"doc",id:"06-api-reference/variables/MULTI_QA_MINILM_L6_COS_V1",label:"MULTI_QA_MINILM_L6_COS_V1"},{type:"doc",id:"06-api-reference/variables/MULTI_QA_MPNET_BASE_DOT_V1",label:"MULTI_QA_MPNET_BASE_DOT_V1"}]},{type:"category",label:"Models - Text to Speech",items:[{type:"doc",id:"06-api-reference/variables/KOKORO_MEDIUM",label:"KOKORO_MEDIUM"},{type:"doc",id:"06-api-reference/variables/KOKORO_SMALL",label:"KOKORO_SMALL"}]},{type:"category",label:"Models - Voice Activity Detection",items:[{type:"doc",id:"06-api-reference/variables/FSMN_VAD",label:"FSMN_VAD"}]},{type:"category",label:"OCR Supported Alphabets",items:[{type:"doc",id:"06-api-reference/variables/OCR_ABAZA",label:"OCR_ABAZA"},{type:"doc",id:"06-api-reference/variables/OCR_ADYGHE",label:"OCR_ADYGHE"},{type:"doc",id:"06-api-reference/variables/OCR_AFRIKAANS",label:"OCR_AFRIKAANS"},{type:"doc",id:"06-api-reference/variables/OCR_ALBANIAN",label:"OCR_ALBANIAN"},{type:"doc",id:"06-api-reference/variables/OCR_AVAR",label:"OCR_AVAR"},{type:"doc",id:"06-api-reference/variables/OCR_AZERBAIJANI",label:"OCR_AZERBAIJANI"},{type:"doc",id:"06-api-reference/variables/OCR_BELARUSIAN",label:"OCR_BELARUSIAN"},{type:"doc",id:"06-api-reference/variables/OCR_BOSNIAN",label:"OCR_BOSNIAN"},{type:"doc",id:"06-api-reference/variables/OCR_BULGARIAN",label:"OCR_BULGARIAN"},{type:"doc",id:"06-api-reference/variables/OCR_CHECHEN",label:"OCR_CHECHEN"},{type:"doc",id:"06-api-reference/variables/OCR_CROATIAN",label:"OCR_CROATIAN"},{type:"doc",id:"06-api-reference/variables/OCR_CZECH",label:"OCR_CZECH"},{type:"doc",id:"06-api-reference/variables/OCR_DANISH",label:"OCR_DANISH"},{type:"doc",id:"06-api-reference/variables/OCR_DARGWA",label:"OCR_DARGWA"},{type:"doc",id:"06-api-reference/variables/OCR_DUTCH",label:"OCR_DUTCH"},{type:"doc",id:"06-api-reference/variables/OCR_ENGLISH",label:"OCR_ENGLISH"},{type:"doc",id:"06-api-reference/variables/OCR_ESTONIAN",label:"OCR_ESTONIAN"},{type:"doc",id:"06-api-reference/variables/OCR_FRENCH",label:"OCR_FRENCH"},{type:"doc",id:"06-api-reference/variables/OCR_GERMAN",label:"OCR_GERMAN"},{type:"doc",id:"06-api-reference/variables/OCR_HUNGARIAN",label:"OCR_HUNGARIAN"},{type:"doc",id:"06-api-reference/variables/OCR_ICELANDIC",label:"OCR_ICELANDIC"},{type:"doc",id:"06-api-reference/variables/OCR_INDONESIAN",label:"OCR_INDONESIAN"},{type:"doc",id:"06-api-reference/variables/OCR_INGUSH",label:"OCR_INGUSH"},{type:"doc",id:"06-api-reference/variables/OCR_IRISH",label:"OCR_IRISH"},{type:"doc",id:"06-api-reference/variables/OCR_ITALIAN",label:"OCR_ITALIAN"},{type:"doc",id:"06-api-reference/variables/OCR_JAPANESE",label:"OCR_JAPANESE"},{type:"doc",id:"06-api-reference/variables/OCR_KANNADA",label:"OCR_KANNADA"},{type:"doc",id:"06-api-reference/variables/OCR_KARBADIAN",label:"OCR_KARBADIAN"},{type:"doc",id:"06-api-reference/variables/OCR_KOREAN",label:"OCR_KOREAN"},{type:"doc",id:"06-api-reference/variables/OCR_KURDISH",label:"OCR_KURDISH"},{type:"doc",id:"06-api-reference/variables/OCR_LAK",label:"OCR_LAK"},{type:"doc",id:"06-api-reference/variables/OCR_LATIN",label:"OCR_LATIN"},{type:"doc",id:"06-api-reference/variables/OCR_LATVIAN",label:"OCR_LATVIAN"},{type:"doc",id:"06-api-reference/variables/OCR_LEZGHIAN",label:"OCR_LEZGHIAN"},{type:"doc",id:"06-api-reference/variables/OCR_LITHUANIAN",label:"OCR_LITHUANIAN"},{type:"doc",id:"06-api-reference/variables/OCR_MALAY",label:"OCR_MALAY"},{type:"doc",id:"06-api-reference/variables/OCR_MALTESE",label:"OCR_MALTESE"},{type:"doc",id:"06-api-reference/variables/OCR_MAORI",label:"OCR_MAORI"},{type:"doc",id:"06-api-reference/variables/OCR_MONGOLIAN",label:"OCR_MONGOLIAN"},{type:"doc",id:"06-api-reference/variables/OCR_NORWEGIAN",label:"OCR_NORWEGIAN"},{type:"doc",id:"06-api-reference/variables/OCR_OCCITAN",label:"OCR_OCCITAN"},{type:"doc",id:"06-api-reference/variables/OCR_PALI",label:"OCR_PALI"},{type:"doc",id:"06-api-reference/variables/OCR_POLISH",label:"OCR_POLISH"},{type:"doc",id:"06-api-reference/variables/OCR_PORTUGUESE",label:"OCR_PORTUGUESE"},{type:"doc",id:"06-api-reference/variables/OCR_ROMANIAN",label:"OCR_ROMANIAN"},{type:"doc",id:"06-api-reference/variables/OCR_RUSSIAN",label:"OCR_RUSSIAN"},{type:"doc",id:"06-api-reference/variables/OCR_SERBIAN_CYRILLIC",label:"OCR_SERBIAN_CYRILLIC"},{type:"doc",id:"06-api-reference/variables/OCR_SERBIAN_LATIN",label:"OCR_SERBIAN_LATIN"},{type:"doc",id:"06-api-reference/variables/OCR_SIMPLIFIED_CHINESE",label:"OCR_SIMPLIFIED_CHINESE"},{type:"doc",id:"06-api-reference/variables/OCR_SLOVAK",label:"OCR_SLOVAK"},{type:"doc",id:"06-api-reference/variables/OCR_SLOVENIAN",label:"OCR_SLOVENIAN"},{type:"doc",id:"06-api-reference/variables/OCR_SPANISH",label:"OCR_SPANISH"},{type:"doc",id:"06-api-reference/variables/OCR_SWAHILI",label:"OCR_SWAHILI"},{type:"doc",id:"06-api-reference/variables/OCR_SWEDISH",label:"OCR_SWEDISH"},{type:"doc",id:"06-api-reference/variables/OCR_TABASSARAN",label:"OCR_TABASSARAN"},{type:"doc",id:"06-api-reference/variables/OCR_TAGALOG",label:"OCR_TAGALOG"},{type:"doc",id:"06-api-reference/variables/OCR_TAJIK",label:"OCR_TAJIK"},{type:"doc",id:"06-api-reference/variables/OCR_TELUGU",label:"OCR_TELUGU"},{type:"doc",id:"06-api-reference/variables/OCR_TURKISH",label:"OCR_TURKISH"},{type:"doc",id:"06-api-reference/variables/OCR_UKRAINIAN",label:"OCR_UKRAINIAN"},{type:"doc",id:"06-api-reference/variables/OCR_UZBEK",label:"OCR_UZBEK"},{type:"doc",id:"06-api-reference/variables/OCR_VIETNAMESE",label:"OCR_VIETNAMESE"},{type:"doc",id:"06-api-reference/variables/OCR_WELSH",label:"OCR_WELSH"}]},{type:"category",label:"Other",items:[{type:"doc",id:"06-api-reference/enumerations/RnExecutorchErrorCode",label:"RnExecutorchErrorCode"},{type:"doc",id:"06-api-reference/classes/RnExecutorchError",label:"RnExecutorchError"}]},{type:"category",label:"TTS Supported Voices",items:[{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_AF_HEART",label:"KOKORO_VOICE_AF_HEART"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_AF_RIVER",label:"KOKORO_VOICE_AF_RIVER"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_AF_SARAH",label:"KOKORO_VOICE_AF_SARAH"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_AM_ADAM",label:"KOKORO_VOICE_AM_ADAM"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_AM_MICHAEL",label:"KOKORO_VOICE_AM_MICHAEL"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_AM_SANTA",label:"KOKORO_VOICE_AM_SANTA"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_BF_EMMA",label:"KOKORO_VOICE_BF_EMMA"},{type:"doc",id:"06-api-reference/variables/KOKORO_VOICE_BM_DANIEL",label:"KOKORO_VOICE_BM_DANIEL"}]},{type:"category",label:"Types",items:[{type:"doc",id:"06-api-reference/enumerations/CocoLabel",label:"CocoLabel"},{type:"doc",id:"06-api-reference/enumerations/DeeplabLabel",label:"DeeplabLabel"},{type:"doc",id:"06-api-reference/enumerations/ScalarType",label:"ScalarType"},{type:"doc",id:"06-api-reference/interfaces/Bbox",label:"Bbox"},{type:"doc",id:"06-api-reference/interfaces/ChatConfig",label:"ChatConfig"},{type:"doc",id:"06-api-reference/interfaces/ClassificationProps",label:"ClassificationProps"},{type:"doc",id:"06-api-reference/interfaces/ClassificationType",label:"ClassificationType"},{type:"doc",id:"06-api-reference/interfaces/DecodingOptions",label:"DecodingOptions"},{type:"doc",id:"06-api-reference/interfaces/Detection",label:"Detection"},{type:"doc",id:"06-api-reference/interfaces/ExecutorchModuleProps",label:"ExecutorchModuleProps"},{type:"doc",id:"06-api-reference/interfaces/ExecutorchModuleType",label:"ExecutorchModuleType"},{type:"doc",id:"06-api-reference/interfaces/GenerationConfig",label:"GenerationConfig"},{type:"doc",id:"06-api-reference/interfaces/ImageEmbeddingsProps",label:"ImageEmbeddingsProps"},{type:"doc",id:"06-api-reference/interfaces/ImageEmbeddingsType",label:"ImageEmbeddingsType"},{type:"doc",id:"06-api-reference/interfaces/ImageSegmentationProps",label:"ImageSegmentationProps"},{type:"doc",id:"06-api-reference/interfaces/ImageSegmentationType",label:"ImageSegmentationType"},{type:"doc",id:"06-api-reference/interfaces/KokoroConfig",label:"KokoroConfig"},{type:"doc",id:"06-api-reference/interfaces/KokoroVoiceExtras",label:"KokoroVoiceExtras"},{type:"doc",id:"06-api-reference/interfaces/LLMConfig",label:"LLMConfig"},{type:"doc",id:"06-api-reference/interfaces/LLMType",label:"LLMType"},{type:"doc",id:"06-api-reference/interfaces/Message",label:"Message"},{type:"doc",id:"06-api-reference/interfaces/ObjectDetectionProps",label:"ObjectDetectionProps"},{type:"doc",id:"06-api-reference/interfaces/ObjectDetectionType",label:"ObjectDetectionType"},{type:"doc",id:"06-api-reference/interfaces/OCRDetection",label:"OCRDetection"},{type:"doc",id:"06-api-reference/interfaces/OCRProps",label:"OCRProps"},{type:"doc",id:"06-api-reference/interfaces/OCRType",label:"OCRType"},{type:"doc",id:"06-api-reference/interfaces/Point",label:"Point"},{type:"doc",id:"06-api-reference/interfaces/Segment",label:"Segment"},{type:"doc",id:"06-api-reference/interfaces/SpeechToTextModelConfig",label:"SpeechToTextModelConfig"},{type:"doc",id:"06-api-reference/interfaces/SpeechToTextType",label:"SpeechToTextType"},{type:"doc",id:"06-api-reference/interfaces/StyleTransferProps",label:"StyleTransferProps"},{type:"doc",id:"06-api-reference/interfaces/StyleTransferType",label:"StyleTransferType"},{type:"doc",id:"06-api-reference/interfaces/TensorPtr",label:"TensorPtr"},{type:"doc",id:"06-api-reference/interfaces/TextEmbeddingsProps",label:"TextEmbeddingsProps"},{type:"doc",id:"06-api-reference/interfaces/TextEmbeddingsType",label:"TextEmbeddingsType"},{type:"doc",id:"06-api-reference/interfaces/TextToImageParams",label:"TextToImageParams"},{type:"doc",id:"06-api-reference/interfaces/TextToImageType",label:"TextToImageType"},{type:"doc",id:"06-api-reference/interfaces/TextToSpeechConfig",label:"TextToSpeechConfig"},{type:"doc",id:"06-api-reference/interfaces/TextToSpeechInput",label:"TextToSpeechInput"},{type:"doc",id:"06-api-reference/interfaces/TextToSpeechProps",label:"TextToSpeechProps"},{type:"doc",id:"06-api-reference/interfaces/TextToSpeechStreamingInput",label:"TextToSpeechStreamingInput"},{type:"doc",id:"06-api-reference/interfaces/TextToSpeechType",label:"TextToSpeechType"},{type:"doc",id:"06-api-reference/interfaces/TokenizerType",label:"TokenizerType"},{type:"doc",id:"06-api-reference/interfaces/ToolCall",label:"ToolCall"},{type:"doc",id:"06-api-reference/interfaces/ToolsConfig",label:"ToolsConfig"},{type:"doc",id:"06-api-reference/interfaces/VADProps",label:"VADProps"},{type:"doc",id:"06-api-reference/interfaces/VADType",label:"VADType"},{type:"doc",id:"06-api-reference/interfaces/VerticalOCRProps",label:"VerticalOCRProps"},{type:"doc",id:"06-api-reference/interfaces/VoiceConfig",label:"VoiceConfig"},{type:"doc",id:"06-api-reference/type-aliases/LLMTool",label:"LLMTool"},{type:"doc",id:"06-api-reference/type-aliases/MessageRole",label:"MessageRole"},{type:"doc",id:"06-api-reference/type-aliases/OCRLanguage",label:"OCRLanguage"},{type:"doc",id:"06-api-reference/type-aliases/ResourceSource",label:"ResourceSource"},{type:"doc",id:"06-api-reference/type-aliases/SpeechToTextLanguage",label:"SpeechToTextLanguage"},{type:"doc",id:"06-api-reference/type-aliases/TensorBuffer",label:"TensorBuffer"},{type:"doc",id:"06-api-reference/type-aliases/TextToSpeechLanguage",label:"TextToSpeechLanguage"},{type:"doc",id:"06-api-reference/variables/SPECIAL_TOKENS",label:"SPECIAL_TOKENS"}]},{type:"category",label:"Typescript API",items:[{type:"doc",id:"06-api-reference/classes/ClassificationModule",label:"ClassificationModule"},{type:"doc",id:"06-api-reference/classes/ExecutorchModule",label:"ExecutorchModule"},{type:"doc",id:"06-api-reference/classes/ImageEmbeddingsModule",label:"ImageEmbeddingsModule"},{type:"doc",id:"06-api-reference/classes/ImageSegmentationModule",label:"ImageSegmentationModule"},{type:"doc",id:"06-api-reference/classes/LLMModule",label:"LLMModule"},{type:"doc",id:"06-api-reference/classes/ObjectDetectionModule",label:"ObjectDetectionModule"},{type:"doc",id:"06-api-reference/classes/OCRModule",label:"OCRModule"},{type:"doc",id:"06-api-reference/classes/SpeechToTextModule",label:"SpeechToTextModule"},{type:"doc",id:"06-api-reference/classes/StyleTransferModule",label:"StyleTransferModule"},{type:"doc",id:"06-api-reference/classes/TextEmbeddingsModule",label:"TextEmbeddingsModule"},{type:"doc",id:"06-api-reference/classes/TextToImageModule",label:"TextToImageModule"},{type:"doc",id:"06-api-reference/classes/TextToSpeechModule",label:"TextToSpeechModule"},{type:"doc",id:"06-api-reference/classes/TokenizerModule",label:"TokenizerModule"},{type:"doc",id:"06-api-reference/classes/VADModule",label:"VADModule"},{type:"doc",id:"06-api-reference/classes/VerticalOCRModule",label:"VerticalOCRModule"}]},{type:"category",label:"Utilities - General",items:[{type:"doc",id:"06-api-reference/classes/ResourceFetcher",label:"ResourceFetcher"}]},{type:"category",label:"Utilities - LLM",items:[{type:"doc",id:"06-api-reference/variables/DEFAULT_CHAT_CONFIG",label:"DEFAULT_CHAT_CONFIG"},{type:"doc",id:"06-api-reference/variables/DEFAULT_CONTEXT_WINDOW_LENGTH",label:"DEFAULT_CONTEXT_WINDOW_LENGTH"},{type:"doc",id:"06-api-reference/variables/DEFAULT_MESSAGE_HISTORY",label:"DEFAULT_MESSAGE_HISTORY"},{type:"doc",id:"06-api-reference/variables/DEFAULT_SYSTEM_PROMPT",label:"DEFAULT_SYSTEM_PROMPT"},{type:"doc",id:"06-api-reference/variables/parseToolCall",label:"parseToolCall"},{type:"doc",id:"06-api-reference/functions/DEFAULT_STRUCTURED_OUTPUT_PROMPT",label:"DEFAULT_STRUCTURED_OUTPUT_PROMPT"},{type:"doc",id:"06-api-reference/functions/fixAndValidateStructuredOutput",label:"fixAndValidateStructuredOutput"},{type:"doc",id:"06-api-reference/functions/getStructuredOutputPrompt",label:"getStructuredOutputPrompt"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/docs/docs/06-api-reference/variables/ALL_MINILM_L6_V2.md b/docs/docs/06-api-reference/variables/ALL_MINILM_L6_V2.md new file mode 100644 index 000000000..85ce14edf --- /dev/null +++ b/docs/docs/06-api-reference/variables/ALL_MINILM_L6_V2.md @@ -0,0 +1,15 @@ +# Variable: ALL\_MINILM\_L6\_V2 + +> `const` **ALL\_MINILM\_L6\_V2**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:552](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L552) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `ALL_MINILM_L6_V2_MODEL` + +### tokenizerSource + +> **tokenizerSource**: `string` = `ALL_MINILM_L6_V2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/ALL_MPNET_BASE_V2.md b/docs/docs/06-api-reference/variables/ALL_MPNET_BASE_V2.md new file mode 100644 index 000000000..21bc79c07 --- /dev/null +++ b/docs/docs/06-api-reference/variables/ALL_MPNET_BASE_V2.md @@ -0,0 +1,15 @@ +# Variable: ALL\_MPNET\_BASE\_V2 + +> `const` **ALL\_MPNET\_BASE\_V2**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:560](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L560) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `ALL_MPNET_BASE_V2_MODEL` + +### tokenizerSource + +> **tokenizerSource**: `string` = `ALL_MPNET_BASE_V2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/BK_SDM_TINY_VPRED_256.md b/docs/docs/06-api-reference/variables/BK_SDM_TINY_VPRED_256.md new file mode 100644 index 000000000..4cf6d3afd --- /dev/null +++ b/docs/docs/06-api-reference/variables/BK_SDM_TINY_VPRED_256.md @@ -0,0 +1,27 @@ +# Variable: BK\_SDM\_TINY\_VPRED\_256 + +> `const` **BK\_SDM\_TINY\_VPRED\_256**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:605](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L605) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` + +### encoderSource + +> **encoderSource**: `string` + +### schedulerSource + +> **schedulerSource**: `string` + +### tokenizerSource + +> **tokenizerSource**: `string` + +### unetSource + +> **unetSource**: `string` diff --git a/docs/docs/06-api-reference/variables/BK_SDM_TINY_VPRED_512.md b/docs/docs/06-api-reference/variables/BK_SDM_TINY_VPRED_512.md new file mode 100644 index 000000000..5ee071adf --- /dev/null +++ b/docs/docs/06-api-reference/variables/BK_SDM_TINY_VPRED_512.md @@ -0,0 +1,27 @@ +# Variable: BK\_SDM\_TINY\_VPRED\_512 + +> `const` **BK\_SDM\_TINY\_VPRED\_512**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:594](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L594) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` + +### encoderSource + +> **encoderSource**: `string` + +### schedulerSource + +> **schedulerSource**: `string` + +### tokenizerSource + +> **tokenizerSource**: `string` + +### unetSource + +> **unetSource**: `string` diff --git a/docs/docs/06-api-reference/variables/CLIP_VIT_BASE_PATCH32_IMAGE.md b/docs/docs/06-api-reference/variables/CLIP_VIT_BASE_PATCH32_IMAGE.md new file mode 100644 index 000000000..f627f132c --- /dev/null +++ b/docs/docs/06-api-reference/variables/CLIP_VIT_BASE_PATCH32_IMAGE.md @@ -0,0 +1,11 @@ +# Variable: CLIP\_VIT\_BASE\_PATCH32\_IMAGE + +> `const` **CLIP\_VIT\_BASE\_PATCH32\_IMAGE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:533](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L533) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `CLIP_VIT_BASE_PATCH32_IMAGE_MODEL` diff --git a/docs/docs/06-api-reference/variables/CLIP_VIT_BASE_PATCH32_TEXT.md b/docs/docs/06-api-reference/variables/CLIP_VIT_BASE_PATCH32_TEXT.md new file mode 100644 index 000000000..3b46fb93d --- /dev/null +++ b/docs/docs/06-api-reference/variables/CLIP_VIT_BASE_PATCH32_TEXT.md @@ -0,0 +1,15 @@ +# Variable: CLIP\_VIT\_BASE\_PATCH32\_TEXT + +> `const` **CLIP\_VIT\_BASE\_PATCH32\_TEXT**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:584](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L584) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `CLIP_VIT_BASE_PATCH32_TEXT_MODEL` + +### tokenizerSource + +> **tokenizerSource**: `string` = `CLIP_VIT_BASE_PATCH32_TEXT_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/DEEPLAB_V3_RESNET50.md b/docs/docs/06-api-reference/variables/DEEPLAB_V3_RESNET50.md new file mode 100644 index 000000000..f01fb5330 --- /dev/null +++ b/docs/docs/06-api-reference/variables/DEEPLAB_V3_RESNET50.md @@ -0,0 +1,11 @@ +# Variable: DEEPLAB\_V3\_RESNET50 + +> `const` **DEEPLAB\_V3\_RESNET50**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:523](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L523) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `DEEPLAB_V3_RESNET50_MODEL` diff --git a/docs/docs/06-api-reference/variables/DEFAULT_CHAT_CONFIG.md b/docs/docs/06-api-reference/variables/DEFAULT_CHAT_CONFIG.md new file mode 100644 index 000000000..e71049eda --- /dev/null +++ b/docs/docs/06-api-reference/variables/DEFAULT_CHAT_CONFIG.md @@ -0,0 +1,7 @@ +# Variable: DEFAULT\_CHAT\_CONFIG + +> `const` **DEFAULT\_CHAT\_CONFIG**: [`ChatConfig`](../interfaces/ChatConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/llmDefaults.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/llmDefaults.ts#L48) + +Default chat configuration for Large Language Models (LLMs). diff --git a/docs/docs/06-api-reference/variables/DEFAULT_CONTEXT_WINDOW_LENGTH.md b/docs/docs/06-api-reference/variables/DEFAULT_CONTEXT_WINDOW_LENGTH.md new file mode 100644 index 000000000..3080a3038 --- /dev/null +++ b/docs/docs/06-api-reference/variables/DEFAULT_CONTEXT_WINDOW_LENGTH.md @@ -0,0 +1,7 @@ +# Variable: DEFAULT\_CONTEXT\_WINDOW\_LENGTH + +> `const` **DEFAULT\_CONTEXT\_WINDOW\_LENGTH**: `5` = `5` + +Defined in: [packages/react-native-executorch/src/constants/llmDefaults.ts:41](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/llmDefaults.ts#L41) + +Default context window length for Large Language Models (LLMs). diff --git a/docs/docs/06-api-reference/variables/DEFAULT_MESSAGE_HISTORY.md b/docs/docs/06-api-reference/variables/DEFAULT_MESSAGE_HISTORY.md new file mode 100644 index 000000000..7ae8b707b --- /dev/null +++ b/docs/docs/06-api-reference/variables/DEFAULT_MESSAGE_HISTORY.md @@ -0,0 +1,7 @@ +# Variable: DEFAULT\_MESSAGE\_HISTORY + +> `const` **DEFAULT\_MESSAGE\_HISTORY**: [`Message`](../interfaces/Message.md)[] = `[]` + +Defined in: [packages/react-native-executorch/src/constants/llmDefaults.ts:34](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/llmDefaults.ts#L34) + +Default message history for Large Language Models (LLMs). diff --git a/docs/docs/06-api-reference/variables/DEFAULT_SYSTEM_PROMPT.md b/docs/docs/06-api-reference/variables/DEFAULT_SYSTEM_PROMPT.md new file mode 100644 index 000000000..edbae658c --- /dev/null +++ b/docs/docs/06-api-reference/variables/DEFAULT_SYSTEM_PROMPT.md @@ -0,0 +1,7 @@ +# Variable: DEFAULT\_SYSTEM\_PROMPT + +> `const` **DEFAULT\_SYSTEM\_PROMPT**: `"You are a knowledgeable, efficient, and direct AI assistant. Provide concise answers, focusing on the key information needed. Offer suggestions tactfully when appropriate to improve outcomes. Engage in productive collaboration with the user. Don't return too much text."` = `"You are a knowledgeable, efficient, and direct AI assistant. Provide concise answers, focusing on the key information needed. Offer suggestions tactfully when appropriate to improve outcomes. Engage in productive collaboration with the user. Don't return too much text."` + +Defined in: [packages/react-native-executorch/src/constants/llmDefaults.ts:8](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/llmDefaults.ts#L8) + +Default system prompt used to guide the behavior of Large Language Models (LLMs). diff --git a/docs/docs/06-api-reference/variables/EFFICIENTNET_V2_S.md b/docs/docs/06-api-reference/variables/EFFICIENTNET_V2_S.md new file mode 100644 index 000000000..6e8d51010 --- /dev/null +++ b/docs/docs/06-api-reference/variables/EFFICIENTNET_V2_S.md @@ -0,0 +1,11 @@ +# Variable: EFFICIENTNET\_V2\_S + +> `const` **EFFICIENTNET\_V2\_S**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:359](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L359) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `EFFICIENTNET_V2_S_MODEL` diff --git a/docs/docs/06-api-reference/variables/FSMN_VAD.md b/docs/docs/06-api-reference/variables/FSMN_VAD.md new file mode 100644 index 000000000..507fedb81 --- /dev/null +++ b/docs/docs/06-api-reference/variables/FSMN_VAD.md @@ -0,0 +1,11 @@ +# Variable: FSMN\_VAD + +> `const` **FSMN\_VAD**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:619](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L619) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `FSMN_VAD_MODEL` diff --git a/docs/docs/06-api-reference/variables/HAMMER2_1_0_5B.md b/docs/docs/06-api-reference/variables/HAMMER2_1_0_5B.md new file mode 100644 index 000000000..c28604f04 --- /dev/null +++ b/docs/docs/06-api-reference/variables/HAMMER2_1_0_5B.md @@ -0,0 +1,19 @@ +# Variable: HAMMER2\_1\_0\_5B + +> `const` **HAMMER2\_1\_0\_5B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:147](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L147) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `HAMMER2_1_0_5B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `HAMMER2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `HAMMER2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/HAMMER2_1_0_5B_QUANTIZED.md b/docs/docs/06-api-reference/variables/HAMMER2_1_0_5B_QUANTIZED.md new file mode 100644 index 000000000..03bf664d0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/HAMMER2_1_0_5B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: HAMMER2\_1\_0\_5B\_QUANTIZED + +> `const` **HAMMER2\_1\_0\_5B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:156](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L156) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `HAMMER2_1_0_5B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `HAMMER2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `HAMMER2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/HAMMER2_1_1_5B.md b/docs/docs/06-api-reference/variables/HAMMER2_1_1_5B.md new file mode 100644 index 000000000..f04c373fa --- /dev/null +++ b/docs/docs/06-api-reference/variables/HAMMER2_1_1_5B.md @@ -0,0 +1,19 @@ +# Variable: HAMMER2\_1\_1\_5B + +> `const` **HAMMER2\_1\_1\_5B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:165](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L165) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `HAMMER2_1_1_5B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `HAMMER2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `HAMMER2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/HAMMER2_1_1_5B_QUANTIZED.md b/docs/docs/06-api-reference/variables/HAMMER2_1_1_5B_QUANTIZED.md new file mode 100644 index 000000000..8b8430bf0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/HAMMER2_1_1_5B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: HAMMER2\_1\_1\_5B\_QUANTIZED + +> `const` **HAMMER2\_1\_1\_5B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:174](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L174) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `HAMMER2_1_1_5B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `HAMMER2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `HAMMER2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/HAMMER2_1_3B.md b/docs/docs/06-api-reference/variables/HAMMER2_1_3B.md new file mode 100644 index 000000000..0b235f727 --- /dev/null +++ b/docs/docs/06-api-reference/variables/HAMMER2_1_3B.md @@ -0,0 +1,19 @@ +# Variable: HAMMER2\_1\_3B + +> `const` **HAMMER2\_1\_3B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:183](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L183) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `HAMMER2_1_3B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `HAMMER2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `HAMMER2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/HAMMER2_1_3B_QUANTIZED.md b/docs/docs/06-api-reference/variables/HAMMER2_1_3B_QUANTIZED.md new file mode 100644 index 000000000..aa4f582e1 --- /dev/null +++ b/docs/docs/06-api-reference/variables/HAMMER2_1_3B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: HAMMER2\_1\_3B\_QUANTIZED + +> `const` **HAMMER2\_1\_3B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:192](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L192) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `HAMMER2_1_3B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `HAMMER2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `HAMMER2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/KOKORO_MEDIUM.md b/docs/docs/06-api-reference/variables/KOKORO_MEDIUM.md new file mode 100644 index 000000000..fe843b5e6 --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_MEDIUM.md @@ -0,0 +1,21 @@ +# Variable: KOKORO\_MEDIUM + +> `const` **KOKORO\_MEDIUM**: `object` + +Defined in: [packages/react-native-executorch/src/constants/tts/models.ts:26](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/models.ts#L26) + +A standard Kokoro instance which processes the text in batches of maximum 128 tokens. + +## Type Declaration + +### durationPredictorSource + +> **durationPredictorSource**: `string` + +### synthesizerSource + +> **synthesizerSource**: `string` + +### type + +> **type**: `"kokoro"` diff --git a/docs/docs/06-api-reference/variables/KOKORO_SMALL.md b/docs/docs/06-api-reference/variables/KOKORO_SMALL.md new file mode 100644 index 000000000..9faf91a0e --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_SMALL.md @@ -0,0 +1,23 @@ +# Variable: KOKORO\_SMALL + +> `const` **KOKORO\_SMALL**: `object` + +Defined in: [packages/react-native-executorch/src/constants/tts/models.ts:15](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/models.ts#L15) + +A Kokoro model instance which processes the text in batches of maximum 64 tokens. +Uses significant less memory than the medium model, but could produce +a lower quality speech due to forced, aggressive text splitting. + +## Type Declaration + +### durationPredictorSource + +> **durationPredictorSource**: `string` + +### synthesizerSource + +> **synthesizerSource**: `string` + +### type + +> **type**: `"kokoro"` diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_HEART.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_HEART.md new file mode 100644 index 000000000..b8e36a25a --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_HEART.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_AF\_HEART + +> `const` **KOKORO\_VOICE\_AF\_HEART**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:24](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L24) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_RIVER.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_RIVER.md new file mode 100644 index 000000000..1cc221277 --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_RIVER.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_AF\_RIVER + +> `const` **KOKORO\_VOICE\_AF\_RIVER**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:32](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L32) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_SARAH.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_SARAH.md new file mode 100644 index 000000000..7ed697938 --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AF_SARAH.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_AF\_SARAH + +> `const` **KOKORO\_VOICE\_AF\_SARAH**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:40](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L40) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_ADAM.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_ADAM.md new file mode 100644 index 000000000..9feefd30a --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_ADAM.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_AM\_ADAM + +> `const` **KOKORO\_VOICE\_AM\_ADAM**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L48) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_MICHAEL.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_MICHAEL.md new file mode 100644 index 000000000..54aaebbcd --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_MICHAEL.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_AM\_MICHAEL + +> `const` **KOKORO\_VOICE\_AM\_MICHAEL**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:56](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L56) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_SANTA.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_SANTA.md new file mode 100644 index 000000000..de300d465 --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_AM_SANTA.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_AM\_SANTA + +> `const` **KOKORO\_VOICE\_AM\_SANTA**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L64) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_BF_EMMA.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_BF_EMMA.md new file mode 100644 index 000000000..eaae01cb7 --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_BF_EMMA.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_BF\_EMMA + +> `const` **KOKORO\_VOICE\_BF\_EMMA**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:72](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L72) diff --git a/docs/docs/06-api-reference/variables/KOKORO_VOICE_BM_DANIEL.md b/docs/docs/06-api-reference/variables/KOKORO_VOICE_BM_DANIEL.md new file mode 100644 index 000000000..2909af172 --- /dev/null +++ b/docs/docs/06-api-reference/variables/KOKORO_VOICE_BM_DANIEL.md @@ -0,0 +1,5 @@ +# Variable: KOKORO\_VOICE\_BM\_DANIEL + +> `const` **KOKORO\_VOICE\_BM\_DANIEL**: [`VoiceConfig`](../interfaces/VoiceConfig.md) + +Defined in: [packages/react-native-executorch/src/constants/tts/voices.ts:80](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/tts/voices.ts#L80) diff --git a/docs/docs/06-api-reference/variables/LLAMA3_2_1B.md b/docs/docs/06-api-reference/variables/LLAMA3_2_1B.md new file mode 100644 index 000000000..68902e24f --- /dev/null +++ b/docs/docs/06-api-reference/variables/LLAMA3_2_1B.md @@ -0,0 +1,19 @@ +# Variable: LLAMA3\_2\_1B + +> `const` **LLAMA3\_2\_1B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:46](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L46) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `LLAMA3_2_1B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `LLAMA3_2_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `LLAMA3_2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/LLAMA3_2_1B_QLORA.md b/docs/docs/06-api-reference/variables/LLAMA3_2_1B_QLORA.md new file mode 100644 index 000000000..1f9554914 --- /dev/null +++ b/docs/docs/06-api-reference/variables/LLAMA3_2_1B_QLORA.md @@ -0,0 +1,19 @@ +# Variable: LLAMA3\_2\_1B\_QLORA + +> `const` **LLAMA3\_2\_1B\_QLORA**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:55](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L55) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `LLAMA3_2_1B_QLORA_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `LLAMA3_2_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `LLAMA3_2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/LLAMA3_2_1B_SPINQUANT.md b/docs/docs/06-api-reference/variables/LLAMA3_2_1B_SPINQUANT.md new file mode 100644 index 000000000..b30fc331d --- /dev/null +++ b/docs/docs/06-api-reference/variables/LLAMA3_2_1B_SPINQUANT.md @@ -0,0 +1,19 @@ +# Variable: LLAMA3\_2\_1B\_SPINQUANT + +> `const` **LLAMA3\_2\_1B\_SPINQUANT**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:64](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L64) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `LLAMA3_2_1B_SPINQUANT_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `LLAMA3_2_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `LLAMA3_2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/LLAMA3_2_3B.md b/docs/docs/06-api-reference/variables/LLAMA3_2_3B.md new file mode 100644 index 000000000..322ffbdd8 --- /dev/null +++ b/docs/docs/06-api-reference/variables/LLAMA3_2_3B.md @@ -0,0 +1,19 @@ +# Variable: LLAMA3\_2\_3B + +> `const` **LLAMA3\_2\_3B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:19](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L19) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `LLAMA3_2_3B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `LLAMA3_2_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `LLAMA3_2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/LLAMA3_2_3B_QLORA.md b/docs/docs/06-api-reference/variables/LLAMA3_2_3B_QLORA.md new file mode 100644 index 000000000..678aba5b0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/LLAMA3_2_3B_QLORA.md @@ -0,0 +1,19 @@ +# Variable: LLAMA3\_2\_3B\_QLORA + +> `const` **LLAMA3\_2\_3B\_QLORA**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:28](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L28) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `LLAMA3_2_3B_QLORA_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `LLAMA3_2_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `LLAMA3_2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/LLAMA3_2_3B_SPINQUANT.md b/docs/docs/06-api-reference/variables/LLAMA3_2_3B_SPINQUANT.md new file mode 100644 index 000000000..87cfcb1af --- /dev/null +++ b/docs/docs/06-api-reference/variables/LLAMA3_2_3B_SPINQUANT.md @@ -0,0 +1,19 @@ +# Variable: LLAMA3\_2\_3B\_SPINQUANT + +> `const` **LLAMA3\_2\_3B\_SPINQUANT**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:37](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L37) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `LLAMA3_2_3B_SPINQUANT_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `LLAMA3_2_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `LLAMA3_2_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/MULTI_QA_MINILM_L6_COS_V1.md b/docs/docs/06-api-reference/variables/MULTI_QA_MINILM_L6_COS_V1.md new file mode 100644 index 000000000..f976b3537 --- /dev/null +++ b/docs/docs/06-api-reference/variables/MULTI_QA_MINILM_L6_COS_V1.md @@ -0,0 +1,15 @@ +# Variable: MULTI\_QA\_MINILM\_L6\_COS\_V1 + +> `const` **MULTI\_QA\_MINILM\_L6\_COS\_V1**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:568](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L568) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `MULTI_QA_MINILM_L6_COS_V1_MODEL` + +### tokenizerSource + +> **tokenizerSource**: `string` = `MULTI_QA_MINILM_L6_COS_V1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/MULTI_QA_MPNET_BASE_DOT_V1.md b/docs/docs/06-api-reference/variables/MULTI_QA_MPNET_BASE_DOT_V1.md new file mode 100644 index 000000000..a6350e0b0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/MULTI_QA_MPNET_BASE_DOT_V1.md @@ -0,0 +1,15 @@ +# Variable: MULTI\_QA\_MPNET\_BASE\_DOT\_V1 + +> `const` **MULTI\_QA\_MPNET\_BASE\_DOT\_V1**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:576](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L576) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `MULTI_QA_MPNET_BASE_DOT_V1_MODEL` + +### tokenizerSource + +> **tokenizerSource**: `string` = `MULTI_QA_MPNET_BASE_DOT_V1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/OCR_ABAZA.md b/docs/docs/06-api-reference/variables/OCR_ABAZA.md new file mode 100644 index 000000000..3920b527b --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ABAZA.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ABAZA + +> `const` **OCR\_ABAZA**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:33](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L33) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ADYGHE.md b/docs/docs/06-api-reference/variables/OCR_ADYGHE.md new file mode 100644 index 000000000..d4f2d526e --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ADYGHE.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ADYGHE + +> `const` **OCR\_ADYGHE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:38](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L38) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_AFRIKAANS.md b/docs/docs/06-api-reference/variables/OCR_AFRIKAANS.md new file mode 100644 index 000000000..3a352990e --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_AFRIKAANS.md @@ -0,0 +1,19 @@ +# Variable: OCR\_AFRIKAANS + +> `const` **OCR\_AFRIKAANS**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:43](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L43) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ALBANIAN.md b/docs/docs/06-api-reference/variables/OCR_ALBANIAN.md new file mode 100644 index 000000000..08a61b6f8 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ALBANIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ALBANIAN + +> `const` **OCR\_ALBANIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:302](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L302) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_AVAR.md b/docs/docs/06-api-reference/variables/OCR_AVAR.md new file mode 100644 index 000000000..fc01c7320 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_AVAR.md @@ -0,0 +1,19 @@ +# Variable: OCR\_AVAR + +> `const` **OCR\_AVAR**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:48](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L48) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_AZERBAIJANI.md b/docs/docs/06-api-reference/variables/OCR_AZERBAIJANI.md new file mode 100644 index 000000000..41cb74954 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_AZERBAIJANI.md @@ -0,0 +1,19 @@ +# Variable: OCR\_AZERBAIJANI + +> `const` **OCR\_AZERBAIJANI**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:53](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L53) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_BELARUSIAN.md b/docs/docs/06-api-reference/variables/OCR_BELARUSIAN.md new file mode 100644 index 000000000..3c7e7cc8e --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_BELARUSIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_BELARUSIAN + +> `const` **OCR\_BELARUSIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:58](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L58) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_BOSNIAN.md b/docs/docs/06-api-reference/variables/OCR_BOSNIAN.md new file mode 100644 index 000000000..126a7081f --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_BOSNIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_BOSNIAN + +> `const` **OCR\_BOSNIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:68](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L68) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_BULGARIAN.md b/docs/docs/06-api-reference/variables/OCR_BULGARIAN.md new file mode 100644 index 000000000..870862585 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_BULGARIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_BULGARIAN + +> `const` **OCR\_BULGARIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:63](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L63) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_CHECHEN.md b/docs/docs/06-api-reference/variables/OCR_CHECHEN.md new file mode 100644 index 000000000..c1ceb2a26 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_CHECHEN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_CHECHEN + +> `const` **OCR\_CHECHEN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:81](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L81) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_CROATIAN.md b/docs/docs/06-api-reference/variables/OCR_CROATIAN.md new file mode 100644 index 000000000..161af3a89 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_CROATIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_CROATIAN + +> `const` **OCR\_CROATIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:136](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L136) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_CZECH.md b/docs/docs/06-api-reference/variables/OCR_CZECH.md new file mode 100644 index 000000000..b0b26eed6 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_CZECH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_CZECH + +> `const` **OCR\_CZECH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:86](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L86) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_DANISH.md b/docs/docs/06-api-reference/variables/OCR_DANISH.md new file mode 100644 index 000000000..6a017b53c --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_DANISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_DANISH + +> `const` **OCR\_DANISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:96](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L96) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_DARGWA.md b/docs/docs/06-api-reference/variables/OCR_DARGWA.md new file mode 100644 index 000000000..c52a3dc97 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_DARGWA.md @@ -0,0 +1,19 @@ +# Variable: OCR\_DARGWA + +> `const` **OCR\_DARGWA**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:101](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L101) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_DUTCH.md b/docs/docs/06-api-reference/variables/OCR_DUTCH.md new file mode 100644 index 000000000..8e704f15e --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_DUTCH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_DUTCH + +> `const` **OCR\_DUTCH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:236](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L236) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ENGLISH.md b/docs/docs/06-api-reference/variables/OCR_ENGLISH.md new file mode 100644 index 000000000..ab0872da6 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ENGLISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ENGLISH + +> `const` **OCR\_ENGLISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:111](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L111) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ESTONIAN.md b/docs/docs/06-api-reference/variables/OCR_ESTONIAN.md new file mode 100644 index 000000000..dc6c62e01 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ESTONIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ESTONIAN + +> `const` **OCR\_ESTONIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:121](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L121) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_FRENCH.md b/docs/docs/06-api-reference/variables/OCR_FRENCH.md new file mode 100644 index 000000000..ebaecce35 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_FRENCH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_FRENCH + +> `const` **OCR\_FRENCH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:126](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L126) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_GERMAN.md b/docs/docs/06-api-reference/variables/OCR_GERMAN.md new file mode 100644 index 000000000..c77b5c781 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_GERMAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_GERMAN + +> `const` **OCR\_GERMAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:106](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L106) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_HUNGARIAN.md b/docs/docs/06-api-reference/variables/OCR_HUNGARIAN.md new file mode 100644 index 000000000..711466db8 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_HUNGARIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_HUNGARIAN + +> `const` **OCR\_HUNGARIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:141](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L141) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ICELANDIC.md b/docs/docs/06-api-reference/variables/OCR_ICELANDIC.md new file mode 100644 index 000000000..e4f936846 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ICELANDIC.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ICELANDIC + +> `const` **OCR\_ICELANDIC**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:156](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L156) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_INDONESIAN.md b/docs/docs/06-api-reference/variables/OCR_INDONESIAN.md new file mode 100644 index 000000000..f0c45e7b6 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_INDONESIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_INDONESIAN + +> `const` **OCR\_INDONESIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:146](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L146) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_INGUSH.md b/docs/docs/06-api-reference/variables/OCR_INGUSH.md new file mode 100644 index 000000000..d5e2e36a2 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_INGUSH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_INGUSH + +> `const` **OCR\_INGUSH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:151](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L151) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_IRISH.md b/docs/docs/06-api-reference/variables/OCR_IRISH.md new file mode 100644 index 000000000..5825035c0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_IRISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_IRISH + +> `const` **OCR\_IRISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:131](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L131) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ITALIAN.md b/docs/docs/06-api-reference/variables/OCR_ITALIAN.md new file mode 100644 index 000000000..137f73f2d --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ITALIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ITALIAN + +> `const` **OCR\_ITALIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:161](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L161) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_JAPANESE.md b/docs/docs/06-api-reference/variables/OCR_JAPANESE.md new file mode 100644 index 000000000..b77fa7990 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_JAPANESE.md @@ -0,0 +1,19 @@ +# Variable: OCR\_JAPANESE + +> `const` **OCR\_JAPANESE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:166](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L166) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_KANNADA.md b/docs/docs/06-api-reference/variables/OCR_KANNADA.md new file mode 100644 index 000000000..adb081a64 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_KANNADA.md @@ -0,0 +1,19 @@ +# Variable: OCR\_KANNADA + +> `const` **OCR\_KANNADA**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:176](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L176) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_KARBADIAN.md b/docs/docs/06-api-reference/variables/OCR_KARBADIAN.md new file mode 100644 index 000000000..68209b001 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_KARBADIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_KARBADIAN + +> `const` **OCR\_KARBADIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:171](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L171) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_KOREAN.md b/docs/docs/06-api-reference/variables/OCR_KOREAN.md new file mode 100644 index 000000000..90f5c5787 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_KOREAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_KOREAN + +> `const` **OCR\_KOREAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:181](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L181) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_KURDISH.md b/docs/docs/06-api-reference/variables/OCR_KURDISH.md new file mode 100644 index 000000000..489e1391c --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_KURDISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_KURDISH + +> `const` **OCR\_KURDISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:186](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L186) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_LAK.md b/docs/docs/06-api-reference/variables/OCR_LAK.md new file mode 100644 index 000000000..aaabfc554 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_LAK.md @@ -0,0 +1,19 @@ +# Variable: OCR\_LAK + +> `const` **OCR\_LAK**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:196](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L196) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_LATIN.md b/docs/docs/06-api-reference/variables/OCR_LATIN.md new file mode 100644 index 000000000..37b28df89 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_LATIN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_LATIN + +> `const` **OCR\_LATIN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:191](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L191) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_LATVIAN.md b/docs/docs/06-api-reference/variables/OCR_LATVIAN.md new file mode 100644 index 000000000..266fedfd2 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_LATVIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_LATVIAN + +> `const` **OCR\_LATVIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:211](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L211) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_LEZGHIAN.md b/docs/docs/06-api-reference/variables/OCR_LEZGHIAN.md new file mode 100644 index 000000000..52f198ea7 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_LEZGHIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_LEZGHIAN + +> `const` **OCR\_LEZGHIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:201](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L201) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_LITHUANIAN.md b/docs/docs/06-api-reference/variables/OCR_LITHUANIAN.md new file mode 100644 index 000000000..9f8a50e8f --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_LITHUANIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_LITHUANIAN + +> `const` **OCR\_LITHUANIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:206](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L206) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_MALAY.md b/docs/docs/06-api-reference/variables/OCR_MALAY.md new file mode 100644 index 000000000..333e97aca --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_MALAY.md @@ -0,0 +1,19 @@ +# Variable: OCR\_MALAY + +> `const` **OCR\_MALAY**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:226](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L226) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_MALTESE.md b/docs/docs/06-api-reference/variables/OCR_MALTESE.md new file mode 100644 index 000000000..8ef32c06e --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_MALTESE.md @@ -0,0 +1,19 @@ +# Variable: OCR\_MALTESE + +> `const` **OCR\_MALTESE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:231](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L231) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_MAORI.md b/docs/docs/06-api-reference/variables/OCR_MAORI.md new file mode 100644 index 000000000..bca451487 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_MAORI.md @@ -0,0 +1,19 @@ +# Variable: OCR\_MAORI + +> `const` **OCR\_MAORI**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:216](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L216) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_MONGOLIAN.md b/docs/docs/06-api-reference/variables/OCR_MONGOLIAN.md new file mode 100644 index 000000000..340cad002 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_MONGOLIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_MONGOLIAN + +> `const` **OCR\_MONGOLIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:221](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L221) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_NORWEGIAN.md b/docs/docs/06-api-reference/variables/OCR_NORWEGIAN.md new file mode 100644 index 000000000..ac3155821 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_NORWEGIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_NORWEGIAN + +> `const` **OCR\_NORWEGIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:241](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L241) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_OCCITAN.md b/docs/docs/06-api-reference/variables/OCR_OCCITAN.md new file mode 100644 index 000000000..2e7b7c4bc --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_OCCITAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_OCCITAN + +> `const` **OCR\_OCCITAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:246](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L246) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_PALI.md b/docs/docs/06-api-reference/variables/OCR_PALI.md new file mode 100644 index 000000000..c2b18f5d0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_PALI.md @@ -0,0 +1,19 @@ +# Variable: OCR\_PALI + +> `const` **OCR\_PALI**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:251](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L251) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_POLISH.md b/docs/docs/06-api-reference/variables/OCR_POLISH.md new file mode 100644 index 000000000..6e4fa47d0 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_POLISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_POLISH + +> `const` **OCR\_POLISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:256](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L256) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_PORTUGUESE.md b/docs/docs/06-api-reference/variables/OCR_PORTUGUESE.md new file mode 100644 index 000000000..71440218c --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_PORTUGUESE.md @@ -0,0 +1,19 @@ +# Variable: OCR\_PORTUGUESE + +> `const` **OCR\_PORTUGUESE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:261](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L261) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_ROMANIAN.md b/docs/docs/06-api-reference/variables/OCR_ROMANIAN.md new file mode 100644 index 000000000..4c3a8e515 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_ROMANIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_ROMANIAN + +> `const` **OCR\_ROMANIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:266](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L266) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_RUSSIAN.md b/docs/docs/06-api-reference/variables/OCR_RUSSIAN.md new file mode 100644 index 000000000..f5a3805ae --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_RUSSIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_RUSSIAN + +> `const` **OCR\_RUSSIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:271](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L271) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SERBIAN_CYRILLIC.md b/docs/docs/06-api-reference/variables/OCR_SERBIAN_CYRILLIC.md new file mode 100644 index 000000000..3a319679a --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SERBIAN_CYRILLIC.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SERBIAN\_CYRILLIC + +> `const` **OCR\_SERBIAN\_CYRILLIC**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:276](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L276) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SERBIAN_LATIN.md b/docs/docs/06-api-reference/variables/OCR_SERBIAN_LATIN.md new file mode 100644 index 000000000..ab9f0adf4 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SERBIAN_LATIN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SERBIAN\_LATIN + +> `const` **OCR\_SERBIAN\_LATIN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:284](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L284) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SIMPLIFIED_CHINESE.md b/docs/docs/06-api-reference/variables/OCR_SIMPLIFIED_CHINESE.md new file mode 100644 index 000000000..d4eadbfb1 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SIMPLIFIED_CHINESE.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SIMPLIFIED\_CHINESE + +> `const` **OCR\_SIMPLIFIED\_CHINESE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:73](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L73) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SLOVAK.md b/docs/docs/06-api-reference/variables/OCR_SLOVAK.md new file mode 100644 index 000000000..a0abb585e --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SLOVAK.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SLOVAK + +> `const` **OCR\_SLOVAK**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:292](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L292) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SLOVENIAN.md b/docs/docs/06-api-reference/variables/OCR_SLOVENIAN.md new file mode 100644 index 000000000..d30c09bb2 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SLOVENIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SLOVENIAN + +> `const` **OCR\_SLOVENIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:297](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L297) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SPANISH.md b/docs/docs/06-api-reference/variables/OCR_SPANISH.md new file mode 100644 index 000000000..ae9904c16 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SPANISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SPANISH + +> `const` **OCR\_SPANISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:116](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L116) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SWAHILI.md b/docs/docs/06-api-reference/variables/OCR_SWAHILI.md new file mode 100644 index 000000000..2f0c328ea --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SWAHILI.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SWAHILI + +> `const` **OCR\_SWAHILI**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:312](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L312) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_SWEDISH.md b/docs/docs/06-api-reference/variables/OCR_SWEDISH.md new file mode 100644 index 000000000..4dcfcd3be --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_SWEDISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_SWEDISH + +> `const` **OCR\_SWEDISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:307](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L307) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_TABASSARAN.md b/docs/docs/06-api-reference/variables/OCR_TABASSARAN.md new file mode 100644 index 000000000..be4d58d9b --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_TABASSARAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_TABASSARAN + +> `const` **OCR\_TABASSARAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:317](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L317) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_TAGALOG.md b/docs/docs/06-api-reference/variables/OCR_TAGALOG.md new file mode 100644 index 000000000..4b68230a8 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_TAGALOG.md @@ -0,0 +1,19 @@ +# Variable: OCR\_TAGALOG + +> `const` **OCR\_TAGALOG**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:332](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L332) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_TAJIK.md b/docs/docs/06-api-reference/variables/OCR_TAJIK.md new file mode 100644 index 000000000..eaf199a36 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_TAJIK.md @@ -0,0 +1,19 @@ +# Variable: OCR\_TAJIK + +> `const` **OCR\_TAJIK**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:327](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L327) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_TELUGU.md b/docs/docs/06-api-reference/variables/OCR_TELUGU.md new file mode 100644 index 000000000..0abc89032 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_TELUGU.md @@ -0,0 +1,19 @@ +# Variable: OCR\_TELUGU + +> `const` **OCR\_TELUGU**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:322](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L322) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_TURKISH.md b/docs/docs/06-api-reference/variables/OCR_TURKISH.md new file mode 100644 index 000000000..76532ab43 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_TURKISH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_TURKISH + +> `const` **OCR\_TURKISH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:337](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L337) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_UKRAINIAN.md b/docs/docs/06-api-reference/variables/OCR_UKRAINIAN.md new file mode 100644 index 000000000..d4ad3458f --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_UKRAINIAN.md @@ -0,0 +1,19 @@ +# Variable: OCR\_UKRAINIAN + +> `const` **OCR\_UKRAINIAN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:342](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L342) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_UZBEK.md b/docs/docs/06-api-reference/variables/OCR_UZBEK.md new file mode 100644 index 000000000..26d5ba3d6 --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_UZBEK.md @@ -0,0 +1,19 @@ +# Variable: OCR\_UZBEK + +> `const` **OCR\_UZBEK**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:347](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L347) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_VIETNAMESE.md b/docs/docs/06-api-reference/variables/OCR_VIETNAMESE.md new file mode 100644 index 000000000..dfc4facdf --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_VIETNAMESE.md @@ -0,0 +1,19 @@ +# Variable: OCR\_VIETNAMESE + +> `const` **OCR\_VIETNAMESE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:352](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L352) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/OCR_WELSH.md b/docs/docs/06-api-reference/variables/OCR_WELSH.md new file mode 100644 index 000000000..cdd06205c --- /dev/null +++ b/docs/docs/06-api-reference/variables/OCR_WELSH.md @@ -0,0 +1,19 @@ +# Variable: OCR\_WELSH + +> `const` **OCR\_WELSH**: `object` + +Defined in: [packages/react-native-executorch/src/constants/ocr/models.ts:91](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/ocr/models.ts#L91) + +## Type Declaration + +### detectorSource + +> **detectorSource**: `string` = `DETECTOR_CRAFT_MODEL` + +### language + +> **language**: `"abq"` \| `"ady"` \| `"af"` \| `"ava"` \| `"az"` \| `"be"` \| `"bg"` \| `"bs"` \| `"chSim"` \| `"che"` \| `"cs"` \| `"cy"` \| `"da"` \| `"dar"` \| `"de"` \| `"en"` \| `"es"` \| `"et"` \| `"fr"` \| `"ga"` \| `"hr"` \| `"hu"` \| `"id"` \| `"inh"` \| `"ic"` \| `"it"` \| `"ja"` \| `"kbd"` \| `"kn"` \| `"ko"` \| `"ku"` \| `"la"` \| `"lbe"` \| `"lez"` \| `"lt"` \| `"lv"` \| `"mi"` \| `"mn"` \| `"ms"` \| `"mt"` \| `"nl"` \| `"no"` \| `"oc"` \| `"pi"` \| `"pl"` \| `"pt"` \| `"ro"` \| `"ru"` \| `"rsCyrillic"` \| `"rsLatin"` \| `"sk"` \| `"sl"` \| `"sq"` \| `"sv"` \| `"sw"` \| `"tab"` \| `"te"` \| `"tjk"` \| `"tl"` \| `"tr"` \| `"uk"` \| `"uz"` \| `"vi"` + +### recognizerSource + +> **recognizerSource**: `string` diff --git a/docs/docs/06-api-reference/variables/PHI_4_MINI_4B.md b/docs/docs/06-api-reference/variables/PHI_4_MINI_4B.md new file mode 100644 index 000000000..9c50555c9 --- /dev/null +++ b/docs/docs/06-api-reference/variables/PHI_4_MINI_4B.md @@ -0,0 +1,19 @@ +# Variable: PHI\_4\_MINI\_4B + +> `const` **PHI\_4\_MINI\_4B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:335](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L335) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `PHI_4_MINI_4B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `PHI_4_MINI_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `PHI_4_MINI_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/PHI_4_MINI_4B_QUANTIZED.md b/docs/docs/06-api-reference/variables/PHI_4_MINI_4B_QUANTIZED.md new file mode 100644 index 000000000..0e1e32c35 --- /dev/null +++ b/docs/docs/06-api-reference/variables/PHI_4_MINI_4B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: PHI\_4\_MINI\_4B\_QUANTIZED + +> `const` **PHI\_4\_MINI\_4B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:344](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L344) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `PHI_4_MINI_4B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `PHI_4_MINI_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `PHI_4_MINI_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN2_5_0_5B.md b/docs/docs/06-api-reference/variables/QWEN2_5_0_5B.md new file mode 100644 index 000000000..759a546e1 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN2_5_0_5B.md @@ -0,0 +1,19 @@ +# Variable: QWEN2\_5\_0\_5B + +> `const` **QWEN2\_5\_0\_5B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:275](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L275) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN2_5_0_5B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN2_5_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN2_5_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN2_5_0_5B_QUANTIZED.md b/docs/docs/06-api-reference/variables/QWEN2_5_0_5B_QUANTIZED.md new file mode 100644 index 000000000..418375a66 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN2_5_0_5B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: QWEN2\_5\_0\_5B\_QUANTIZED + +> `const` **QWEN2\_5\_0\_5B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:284](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L284) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN2_5_0_5B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN2_5_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN2_5_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN2_5_1_5B.md b/docs/docs/06-api-reference/variables/QWEN2_5_1_5B.md new file mode 100644 index 000000000..9cfac1d53 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN2_5_1_5B.md @@ -0,0 +1,19 @@ +# Variable: QWEN2\_5\_1\_5B + +> `const` **QWEN2\_5\_1\_5B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:293](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L293) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN2_5_1_5B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN2_5_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN2_5_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN2_5_1_5B_QUANTIZED.md b/docs/docs/06-api-reference/variables/QWEN2_5_1_5B_QUANTIZED.md new file mode 100644 index 000000000..7864600d1 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN2_5_1_5B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: QWEN2\_5\_1\_5B\_QUANTIZED + +> `const` **QWEN2\_5\_1\_5B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:302](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L302) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN2_5_1_5B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN2_5_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN2_5_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN2_5_3B.md b/docs/docs/06-api-reference/variables/QWEN2_5_3B.md new file mode 100644 index 000000000..31c4b5185 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN2_5_3B.md @@ -0,0 +1,19 @@ +# Variable: QWEN2\_5\_3B + +> `const` **QWEN2\_5\_3B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:311](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L311) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN2_5_3B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN2_5_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN2_5_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN2_5_3B_QUANTIZED.md b/docs/docs/06-api-reference/variables/QWEN2_5_3B_QUANTIZED.md new file mode 100644 index 000000000..7f7fbbd72 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN2_5_3B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: QWEN2\_5\_3B\_QUANTIZED + +> `const` **QWEN2\_5\_3B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:320](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L320) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN2_5_3B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN2_5_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN2_5_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN3_0_6B.md b/docs/docs/06-api-reference/variables/QWEN3_0_6B.md new file mode 100644 index 000000000..022414ea8 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN3_0_6B.md @@ -0,0 +1,19 @@ +# Variable: QWEN3\_0\_6B + +> `const` **QWEN3\_0\_6B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:83](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L83) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN3_0_6B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN3_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN3_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN3_0_6B_QUANTIZED.md b/docs/docs/06-api-reference/variables/QWEN3_0_6B_QUANTIZED.md new file mode 100644 index 000000000..779a315fb --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN3_0_6B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: QWEN3\_0\_6B\_QUANTIZED + +> `const` **QWEN3\_0\_6B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:92](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L92) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN3_0_6B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN3_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN3_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN3_1_7B.md b/docs/docs/06-api-reference/variables/QWEN3_1_7B.md new file mode 100644 index 000000000..0c1da2447 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN3_1_7B.md @@ -0,0 +1,19 @@ +# Variable: QWEN3\_1\_7B + +> `const` **QWEN3\_1\_7B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:101](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L101) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN3_1_7B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN3_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN3_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN3_1_7B_QUANTIZED.md b/docs/docs/06-api-reference/variables/QWEN3_1_7B_QUANTIZED.md new file mode 100644 index 000000000..4d4109344 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN3_1_7B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: QWEN3\_1\_7B\_QUANTIZED + +> `const` **QWEN3\_1\_7B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:110](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L110) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN3_1_7B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN3_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN3_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN3_4B.md b/docs/docs/06-api-reference/variables/QWEN3_4B.md new file mode 100644 index 000000000..e7bbbabfa --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN3_4B.md @@ -0,0 +1,19 @@ +# Variable: QWEN3\_4B + +> `const` **QWEN3\_4B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:119](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L119) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN3_4B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN3_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN3_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/QWEN3_4B_QUANTIZED.md b/docs/docs/06-api-reference/variables/QWEN3_4B_QUANTIZED.md new file mode 100644 index 000000000..fe01cb239 --- /dev/null +++ b/docs/docs/06-api-reference/variables/QWEN3_4B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: QWEN3\_4B\_QUANTIZED + +> `const` **QWEN3\_4B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:128](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L128) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `QWEN3_4B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `QWEN3_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `QWEN3_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SMOLLM2_1_135M.md b/docs/docs/06-api-reference/variables/SMOLLM2_1_135M.md new file mode 100644 index 000000000..01fe69c24 --- /dev/null +++ b/docs/docs/06-api-reference/variables/SMOLLM2_1_135M.md @@ -0,0 +1,19 @@ +# Variable: SMOLLM2\_1\_135M + +> `const` **SMOLLM2\_1\_135M**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:211](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L211) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SMOLLM2_1_135M_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `SMOLLM2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `SMOLLM2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SMOLLM2_1_135M_QUANTIZED.md b/docs/docs/06-api-reference/variables/SMOLLM2_1_135M_QUANTIZED.md new file mode 100644 index 000000000..a02728085 --- /dev/null +++ b/docs/docs/06-api-reference/variables/SMOLLM2_1_135M_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: SMOLLM2\_1\_135M\_QUANTIZED + +> `const` **SMOLLM2\_1\_135M\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:220](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L220) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SMOLLM2_1_135M_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `SMOLLM2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `SMOLLM2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SMOLLM2_1_1_7B.md b/docs/docs/06-api-reference/variables/SMOLLM2_1_1_7B.md new file mode 100644 index 000000000..428d9315f --- /dev/null +++ b/docs/docs/06-api-reference/variables/SMOLLM2_1_1_7B.md @@ -0,0 +1,19 @@ +# Variable: SMOLLM2\_1\_1\_7B + +> `const` **SMOLLM2\_1\_1\_7B**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:247](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L247) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SMOLLM2_1_1_7B_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `SMOLLM2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `SMOLLM2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SMOLLM2_1_1_7B_QUANTIZED.md b/docs/docs/06-api-reference/variables/SMOLLM2_1_1_7B_QUANTIZED.md new file mode 100644 index 000000000..4e37b41a6 --- /dev/null +++ b/docs/docs/06-api-reference/variables/SMOLLM2_1_1_7B_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: SMOLLM2\_1\_1\_7B\_QUANTIZED + +> `const` **SMOLLM2\_1\_1\_7B\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:256](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L256) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SMOLLM2_1_1_7B_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `SMOLLM2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `SMOLLM2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SMOLLM2_1_360M.md b/docs/docs/06-api-reference/variables/SMOLLM2_1_360M.md new file mode 100644 index 000000000..6d04af1c3 --- /dev/null +++ b/docs/docs/06-api-reference/variables/SMOLLM2_1_360M.md @@ -0,0 +1,19 @@ +# Variable: SMOLLM2\_1\_360M + +> `const` **SMOLLM2\_1\_360M**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:229](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L229) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SMOLLM2_1_360M_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `SMOLLM2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `SMOLLM2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SMOLLM2_1_360M_QUANTIZED.md b/docs/docs/06-api-reference/variables/SMOLLM2_1_360M_QUANTIZED.md new file mode 100644 index 000000000..1e9d5950c --- /dev/null +++ b/docs/docs/06-api-reference/variables/SMOLLM2_1_360M_QUANTIZED.md @@ -0,0 +1,19 @@ +# Variable: SMOLLM2\_1\_360M\_QUANTIZED + +> `const` **SMOLLM2\_1\_360M\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:238](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L238) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SMOLLM2_1_360M_QUANTIZED_MODEL` + +### tokenizerConfigSource + +> **tokenizerConfigSource**: `string` = `SMOLLM2_1_TOKENIZER_CONFIG` + +### tokenizerSource + +> **tokenizerSource**: `string` = `SMOLLM2_1_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/SPECIAL_TOKENS.md b/docs/docs/06-api-reference/variables/SPECIAL_TOKENS.md new file mode 100644 index 000000000..ea5129ddf --- /dev/null +++ b/docs/docs/06-api-reference/variables/SPECIAL_TOKENS.md @@ -0,0 +1,37 @@ +# Variable: SPECIAL\_TOKENS + +> `const` **SPECIAL\_TOKENS**: `object` + +Defined in: [packages/react-native-executorch/src/types/llm.ts:223](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/types/llm.ts#L223) + +Special tokens used in Large Language Models (LLMs). + +## Type Declaration + +### BOS\_TOKEN + +> **BOS\_TOKEN**: `string` = `'bos_token'` + +### CLS\_TOKEN + +> **CLS\_TOKEN**: `string` = `'cls_token'` + +### EOS\_TOKEN + +> **EOS\_TOKEN**: `string` = `'eos_token'` + +### MASK\_TOKEN + +> **MASK\_TOKEN**: `string` = `'mask_token'` + +### PAD\_TOKEN + +> **PAD\_TOKEN**: `string` = `'pad_token'` + +### SEP\_TOKEN + +> **SEP\_TOKEN**: `string` = `'sep_token'` + +### UNK\_TOKEN + +> **UNK\_TOKEN**: `string` = `'unk_token'` diff --git a/docs/docs/06-api-reference/variables/SSDLITE_320_MOBILENET_V3_LARGE.md b/docs/docs/06-api-reference/variables/SSDLITE_320_MOBILENET_V3_LARGE.md new file mode 100644 index 000000000..0f84d9ae7 --- /dev/null +++ b/docs/docs/06-api-reference/variables/SSDLITE_320_MOBILENET_V3_LARGE.md @@ -0,0 +1,11 @@ +# Variable: SSDLITE\_320\_MOBILENET\_V3\_LARGE + +> `const` **SSDLITE\_320\_MOBILENET\_V3\_LARGE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:369](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L369) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `SSDLITE_320_MOBILENET_V3_LARGE_MODEL` diff --git a/docs/docs/06-api-reference/variables/STYLE_TRANSFER_CANDY.md b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_CANDY.md new file mode 100644 index 000000000..05991dc23 --- /dev/null +++ b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_CANDY.md @@ -0,0 +1,11 @@ +# Variable: STYLE\_TRANSFER\_CANDY + +> `const` **STYLE\_TRANSFER\_CANDY**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:394](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L394) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `STYLE_TRANSFER_CANDY_MODEL` diff --git a/docs/docs/06-api-reference/variables/STYLE_TRANSFER_MOSAIC.md b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_MOSAIC.md new file mode 100644 index 000000000..f10b04950 --- /dev/null +++ b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_MOSAIC.md @@ -0,0 +1,11 @@ +# Variable: STYLE\_TRANSFER\_MOSAIC + +> `const` **STYLE\_TRANSFER\_MOSAIC**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:401](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L401) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `STYLE_TRANSFER_MOSAIC_MODEL` diff --git a/docs/docs/06-api-reference/variables/STYLE_TRANSFER_RAIN_PRINCESS.md b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_RAIN_PRINCESS.md new file mode 100644 index 000000000..b8449b311 --- /dev/null +++ b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_RAIN_PRINCESS.md @@ -0,0 +1,11 @@ +# Variable: STYLE\_TRANSFER\_RAIN\_PRINCESS + +> `const` **STYLE\_TRANSFER\_RAIN\_PRINCESS**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:408](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L408) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `STYLE_TRANSFER_RAIN_PRINCESS_MODEL` diff --git a/docs/docs/06-api-reference/variables/STYLE_TRANSFER_UDNIE.md b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_UDNIE.md new file mode 100644 index 000000000..ae3d3cee3 --- /dev/null +++ b/docs/docs/06-api-reference/variables/STYLE_TRANSFER_UDNIE.md @@ -0,0 +1,11 @@ +# Variable: STYLE\_TRANSFER\_UDNIE + +> `const` **STYLE\_TRANSFER\_UDNIE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:415](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L415) + +## Type Declaration + +### modelSource + +> **modelSource**: `string` = `STYLE_TRANSFER_UDNIE_MODEL` diff --git a/docs/docs/06-api-reference/variables/WHISPER_BASE.md b/docs/docs/06-api-reference/variables/WHISPER_BASE.md new file mode 100644 index 000000000..b7751b7f3 --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_BASE.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_BASE + +> `const` **WHISPER\_BASE**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:500](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L500) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_BASE_DECODER_MODEL` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_BASE_ENCODER_MODEL` + +### isMultilingual + +> **isMultilingual**: `boolean` = `true` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_BASE_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/WHISPER_BASE_EN.md b/docs/docs/06-api-reference/variables/WHISPER_BASE_EN.md new file mode 100644 index 000000000..fdec9a9bd --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_BASE_EN.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_BASE\_EN + +> `const` **WHISPER\_BASE\_EN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:470](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L470) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_BASE_EN_DECODER` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_BASE_EN_ENCODER` + +### isMultilingual + +> **isMultilingual**: `boolean` = `false` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_BASE_EN_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/WHISPER_SMALL.md b/docs/docs/06-api-reference/variables/WHISPER_SMALL.md new file mode 100644 index 000000000..1213d2ca9 --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_SMALL.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_SMALL + +> `const` **WHISPER\_SMALL**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:510](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L510) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_SMALL_DECODER_MODEL` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_SMALL_ENCODER_MODEL` + +### isMultilingual + +> **isMultilingual**: `boolean` = `true` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_SMALL_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/WHISPER_SMALL_EN.md b/docs/docs/06-api-reference/variables/WHISPER_SMALL_EN.md new file mode 100644 index 000000000..4c6996d9a --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_SMALL_EN.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_SMALL\_EN + +> `const` **WHISPER\_SMALL\_EN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:480](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L480) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_SMALL_EN_DECODER` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_SMALL_EN_ENCODER` + +### isMultilingual + +> **isMultilingual**: `boolean` = `false` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_SMALL_EN_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/WHISPER_TINY.md b/docs/docs/06-api-reference/variables/WHISPER_TINY.md new file mode 100644 index 000000000..ecba823b1 --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_TINY.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_TINY + +> `const` **WHISPER\_TINY**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:490](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L490) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_TINY_DECODER_MODEL` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_TINY_ENCODER_MODEL` + +### isMultilingual + +> **isMultilingual**: `boolean` = `true` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_TINY_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/WHISPER_TINY_EN.md b/docs/docs/06-api-reference/variables/WHISPER_TINY_EN.md new file mode 100644 index 000000000..ed43620a9 --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_TINY_EN.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_TINY\_EN + +> `const` **WHISPER\_TINY\_EN**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:450](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L450) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_TINY_EN_DECODER` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_TINY_EN_ENCODER` + +### isMultilingual + +> **isMultilingual**: `boolean` = `false` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_TINY_EN_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/WHISPER_TINY_EN_QUANTIZED.md b/docs/docs/06-api-reference/variables/WHISPER_TINY_EN_QUANTIZED.md new file mode 100644 index 000000000..33a4db9c1 --- /dev/null +++ b/docs/docs/06-api-reference/variables/WHISPER_TINY_EN_QUANTIZED.md @@ -0,0 +1,23 @@ +# Variable: WHISPER\_TINY\_EN\_QUANTIZED + +> `const` **WHISPER\_TINY\_EN\_QUANTIZED**: `object` + +Defined in: [packages/react-native-executorch/src/constants/modelUrls.ts:460](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/constants/modelUrls.ts#L460) + +## Type Declaration + +### decoderSource + +> **decoderSource**: `string` = `WHISPER_TINY_EN_DECODER_QUANTIZED` + +### encoderSource + +> **encoderSource**: `string` = `WHISPER_TINY_EN_ENCODER_QUANTIZED` + +### isMultilingual + +> **isMultilingual**: `boolean` = `false` + +### tokenizerSource + +> **tokenizerSource**: `string` = `WHISPER_TINY_EN_TOKENIZER` diff --git a/docs/docs/06-api-reference/variables/parseToolCall.md b/docs/docs/06-api-reference/variables/parseToolCall.md new file mode 100644 index 000000000..ceb3ac179 --- /dev/null +++ b/docs/docs/06-api-reference/variables/parseToolCall.md @@ -0,0 +1,21 @@ +# Variable: parseToolCall() + +> `const` **parseToolCall**: (`message`) => [`ToolCall`](../interfaces/ToolCall.md)[] + +Defined in: [packages/react-native-executorch/src/utils/llm.ts:16](https://github.com/software-mansion/react-native-executorch/blob/41ebfb44b8f7a0e75b79ecbd41a0ff716cb5fb5c/packages/react-native-executorch/src/utils/llm.ts#L16) + +Parses tool calls from a given message string. + +## Parameters + +### message + +`string` + +The message string containing tool calls in JSON format. + +## Returns + +[`ToolCall`](../interfaces/ToolCall.md)[] + +An array of `ToolCall` objects extracted from the message. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 25a064103..dc92ca313 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -50,6 +50,46 @@ const config = { ], ], + plugins: [ + [ + 'docusaurus-plugin-typedoc', + { + // 1. Point to the specific entry point inside the package + entryPoints: ['../packages/react-native-executorch/src/index.ts'], + + // 2. Point to the specific tsconfig inside that package + tsconfig: '../packages/react-native-executorch/tsconfig.doc.json', + + out: './docs/06-api-reference', + + // Remove invalid 'sidebar' option (v4+) + // sidebar: { ... } + }, + ], + [ + '@signalwire/docusaurus-plugin-llms-txt', + /** @type {import('@signalwire/docusaurus-plugin-llms-txt').PluginOptions} */ + ({ + siteTitle: 'React Native ExecuTorch', + siteDescription: + "React Native ExecuTorch brings Meta's ExecuTorch AI framework into the React Native ecosystem, enabling developers to run AI models and LLMs locally, directly on mobile devices. It provides a declarative API for on-device inference, allowing you to use local AI models without relying on cloud infrastructure. Built on the ExecuTorch foundation - part of the PyTorch Edge ecosystem - it extends efficient on-device AI deployment to cross-platform mobile applications in React Native.", + depth: 3, + enableDescriptions: true, + content: { + includeVersionedDocs: false, + relativePaths: false, + enableMarkdownFiles: false, + excludeRoutes: ['**/react-native-executorch/search'], + }, + includeOrder: [ + '**/docs/!(category|benchmarks)**', + '**/docs/benchmarks/**', + '**/docs/category/**', + ], + }), + ], + ], + themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ @@ -120,31 +160,7 @@ const config = { suggestedQuestions: true, enableSidePanel: true, }, - }, - plugins: [ - [ - '@signalwire/docusaurus-plugin-llms-txt', - /** @type {import('@signalwire/docusaurus-plugin-llms-txt').PluginOptions} */ - ({ - siteTitle: 'React Native ExecuTorch', - siteDescription: - "React Native ExecuTorch brings Meta's ExecuTorch AI framework into the React Native ecosystem, enabling developers to run AI models and LLMs locally, directly on mobile devices. It provides a declarative API for on-device inference, allowing you to use local AI models without relying on cloud infrastructure. Built on the ExecuTorch foundation - part of the PyTorch Edge ecosystem - it extends efficient on-device AI deployment to cross-platform mobile applications in React Native.", - depth: 3, - enableDescriptions: true, - content: { - includeVersionedDocs: false, - relativePaths: false, - enableMarkdownFiles: false, - excludeRoutes: ['**/react-native-executorch/search'], - }, - includeOrder: [ - '**/docs/!(category|benchmarks)**', - '**/docs/benchmarks/**', - '**/docs/category/**', - ], - }), - ], - ], + } }; module.exports = config; diff --git a/docs/package.json b/docs/package.json index fb3a791bd..27ed8d87b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -37,7 +37,10 @@ }, "devDependencies": { "@docusaurus/module-type-aliases": "^3.9.2", - "@docusaurus/tsconfig": "^3.9.2" + "@docusaurus/tsconfig": "^3.9.2", + "docusaurus-plugin-typedoc": "^1.4.2", + "typedoc": "^0.28.16", + "typedoc-plugin-markdown": "^4.9.0" }, "browserslist": { "production": [ diff --git a/docs/sidebars.js b/docs/sidebars.js index ef1bd11a1..9199fa33c 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -14,7 +14,103 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], + tutorialSidebar: [ + { + type: 'category', + label: 'Fundamentals', + items: [{ type: 'autogenerated', dirName: '01-fundamentals' }], + }, + { + type: 'category', + label: 'Benchmarks', + items: [{ type: 'autogenerated', dirName: '02-benchmarks' }], + }, + { + type: 'category', + label: 'Hooks', + items: [{ type: 'autogenerated', dirName: '03-hooks' }], + }, + { + type: 'category', + label: 'Typescript API', + items: [{ type: 'autogenerated', dirName: '04-typescript-api' }], + }, + { + type: 'category', + label: 'Utilities', + items: [{ type: 'autogenerated', dirName: '05-utilities' }], + }, + + // --------------------------------------------------------- + // 2. The New Clean API Section + // --------------------------------------------------------- + // { + // type: 'category', + // label: 'API Reference', + // collapsible: false, + // collapsed: false, + // link: { + // type: 'doc', + // id: 'api-reference/index', // This links to the page containing Classes/Enums list + // }, + // // LEAVE THIS EMPTY. + // // Instead of listing 100 files in the sidebar, we let the user + // // click "API Reference" and use the Table of Contents (Right Sidebar) + // // to jump to Classes, Enums, etc. + // items: [], + // }, + + { + type: 'category', + label: 'API Reference', + collapsible: false, // Allows expanding/collapsing + collapsed: false, // Open by default + + // 1. REMOVE the 'link' property from here. + // This makes the "API Reference" label just a section header, not a link. + + items: [ + // 2. ADD the link here as a child item + { + type: 'doc', + id: 'api-reference/index', + label: 'API Reference', // Optional: Rename it to "Overview" or "Introduction" to avoid repetition + }, + ], + }, + // { type: 'autogenerated', dirName: '.' }, + // { + // type: 'category', + // label: 'API Reference', + // collapsible: false, // Make it look like a top-level header + // collapsed: false, + // link: { + // type: 'doc', + // id: 'api/index', // This handles versioning automatically (/docs/next/api vs /docs/1.0/api) + // }, + // items: [], // Leave empty: cleaner sidebar, no broken links + // }, + // // 2. API Reference (Manually Added) + // // "label" works perfectly fine here! + // { + // type: 'category', + // label: 'API Reference', + // // CHANGE THIS: Use 'generated-index' instead of 'doc' + // // This tells Docusaurus: "Just generate a list of children here." + // link: { + // type: 'generated-index', + // title: 'API Reference', + // description: 'React Native ExecuTorch API', + // slug: '/api', + // }, + // items: [ + // { + // type: 'autogenerated', + // dirName: 'api', + // }, + // ], + // }, + ], // But you can create a sidebar manually /* diff --git a/docs/src/theme/SearchBar.tsx b/docs/src/theme/SearchBar.tsx new file mode 100644 index 000000000..7536c3716 --- /dev/null +++ b/docs/src/theme/SearchBar.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function SearchBar() { + return
; +} \ No newline at end of file diff --git a/docs/yarn.lock b/docs/yarn.lock index 8fe7ad114..351fd3330 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -2938,6 +2938,19 @@ __metadata: languageName: node linkType: hard +"@gerrit0/mini-shiki@npm:^3.17.0": + version: 3.21.0 + resolution: "@gerrit0/mini-shiki@npm:3.21.0" + dependencies: + "@shikijs/engine-oniguruma": "npm:^3.21.0" + "@shikijs/langs": "npm:^3.21.0" + "@shikijs/themes": "npm:^3.21.0" + "@shikijs/types": "npm:^3.21.0" + "@shikijs/vscode-textmate": "npm:^10.0.2" + checksum: 10/e3f997e18ff3e0654a951f3be2c8fa1deba02afa77865861fbedd62775ef06d38333c76b67ecab4cc38b07d4fe39720f8fe2170ac685323991b4ed7500079b11 + languageName: node + linkType: hard + "@hapi/hoek@npm:^9.0.0, @hapi/hoek@npm:^9.3.0": version: 9.3.0 resolution: "@hapi/hoek@npm:9.3.0" @@ -3734,6 +3747,51 @@ __metadata: languageName: node linkType: hard +"@shikijs/engine-oniguruma@npm:^3.21.0": + version: 3.21.0 + resolution: "@shikijs/engine-oniguruma@npm:3.21.0" + dependencies: + "@shikijs/types": "npm:3.21.0" + "@shikijs/vscode-textmate": "npm:^10.0.2" + checksum: 10/670dcb10195b7aabe7965921e7ff5e315182ca15287a61867f16df3046d8bb81b53416803f2fe6b12b5656be61e7a9990da3a5caf4d7d75b1386884b0e9568d1 + languageName: node + linkType: hard + +"@shikijs/langs@npm:^3.21.0": + version: 3.21.0 + resolution: "@shikijs/langs@npm:3.21.0" + dependencies: + "@shikijs/types": "npm:3.21.0" + checksum: 10/37c56fbfdacd3b74a4943cb8d481e3c3288eba72e55c76e34b1a56dd528f728d636c1691433d8bdc96cc5c0b63789754b9515995f28943580b6ef72abc5fd8d9 + languageName: node + linkType: hard + +"@shikijs/themes@npm:^3.21.0": + version: 3.21.0 + resolution: "@shikijs/themes@npm:3.21.0" + dependencies: + "@shikijs/types": "npm:3.21.0" + checksum: 10/dd3d333f85da79b0904f0ca33e66fc6b01984d161c3ac0e8373df865dabb73f4a7fe5bb7425475aa041082d364c657a756b246d85de4735557902be408e079d4 + languageName: node + linkType: hard + +"@shikijs/types@npm:3.21.0, @shikijs/types@npm:^3.21.0": + version: 3.21.0 + resolution: "@shikijs/types@npm:3.21.0" + dependencies: + "@shikijs/vscode-textmate": "npm:^10.0.2" + "@types/hast": "npm:^3.0.4" + checksum: 10/814dfbbaae55b9d1d86874ed870e80da0cba521a96fb799c73c8439f88b2218fb9e84f64485a50258508d0f912bdd19d0fb8494c2717a9eed2a809e243a81a49 + languageName: node + linkType: hard + +"@shikijs/vscode-textmate@npm:^10.0.2": + version: 10.0.2 + resolution: "@shikijs/vscode-textmate@npm:10.0.2" + checksum: 10/d924cba8a01cd9ca12f56ba097d628fdb81455abb85884c8d8a5ae85b628a37dd5907e7691019b97107bd6608c866adf91ba04a1c3bba391281c88e386c044ea + languageName: node + linkType: hard + "@sideway/address@npm:^4.1.5": version: 4.1.5 resolution: "@sideway/address@npm:4.1.5" @@ -4144,7 +4202,7 @@ __metadata: languageName: node linkType: hard -"@types/hast@npm:^3.0.0": +"@types/hast@npm:^3.0.0, @types/hast@npm:^3.0.4": version: 3.0.4 resolution: "@types/hast@npm:3.0.4" dependencies: @@ -5154,6 +5212,15 @@ __metadata: languageName: node linkType: hard +"brace-expansion@npm:^2.0.1": + version: 2.0.2 + resolution: "brace-expansion@npm:2.0.2" + dependencies: + balanced-match: "npm:^1.0.0" + checksum: 10/01dff195e3646bc4b0d27b63d9bab84d2ebc06121ff5013ad6e5356daa5a9d6b60fa26cf73c74797f2dc3fbec112af13578d51f75228c1112b26c790a87b0488 + languageName: node + linkType: hard + "braces@npm:^3.0.3, braces@npm:~3.0.2": version: 3.0.3 resolution: "braces@npm:3.0.3" @@ -6331,13 +6398,27 @@ __metadata: "@swmansion/t-rex-ui": "npm:^1.2.1" clsx: "npm:^2.1.0" copy-text-to-clipboard: "npm:^3.2.2" + docusaurus-plugin-typedoc: "npm:^1.4.2" prism-react-renderer: "npm:^2.1.0" react: "npm:^19.2.3" react-dom: "npm:^19.2.3" swiper: "npm:^11.2.10" + typedoc: "npm:^0.28.16" + typedoc-plugin-markdown: "npm:^4.9.0" languageName: unknown linkType: soft +"docusaurus-plugin-typedoc@npm:^1.4.2": + version: 1.4.2 + resolution: "docusaurus-plugin-typedoc@npm:1.4.2" + dependencies: + typedoc-docusaurus-theme: "npm:^1.4.0" + peerDependencies: + typedoc-plugin-markdown: ">=4.8.0" + checksum: 10/1d66505021efca3546c3457619932b2ad4d754a96103f3b2685c1772cf6a54311a83f686979c0bfde68f79a0f7960bad331f6315065e42b62373b5539319477a + languageName: node + linkType: hard + "dom-converter@npm:^0.2.0": version: 0.2.0 resolution: "dom-converter@npm:0.2.0" @@ -8652,6 +8733,15 @@ __metadata: languageName: node linkType: hard +"linkify-it@npm:^5.0.0": + version: 5.0.0 + resolution: "linkify-it@npm:5.0.0" + dependencies: + uc.micro: "npm:^2.0.0" + checksum: 10/ef3b7609dda6ec0c0be8a7b879cea195f0d36387b0011660cd6711bba0ad82137f59b458b7e703ec74f11d88e7c1328e2ad9b855a8500c0ded67461a8c4519e6 + languageName: node + linkType: hard + "loader-runner@npm:^4.3.1": version: 4.3.1 resolution: "loader-runner@npm:4.3.1" @@ -8757,6 +8847,13 @@ __metadata: languageName: node linkType: hard +"lunr@npm:^2.3.9": + version: 2.3.9 + resolution: "lunr@npm:2.3.9" + checksum: 10/f2f6db34c046f5a767782fe2454e6dd69c75ba3c5cf5c1cb9cacca2313a99c2ba78ff8fa67dac866fb7c4ffd5f22e06684793f5f15ba14bddb598b94513d54bf + languageName: node + linkType: hard + "make-fetch-happen@npm:^15.0.0": version: 15.0.3 resolution: "make-fetch-happen@npm:15.0.3" @@ -8783,6 +8880,22 @@ __metadata: languageName: node linkType: hard +"markdown-it@npm:^14.1.0": + version: 14.1.0 + resolution: "markdown-it@npm:14.1.0" + dependencies: + argparse: "npm:^2.0.1" + entities: "npm:^4.4.0" + linkify-it: "npm:^5.0.0" + mdurl: "npm:^2.0.0" + punycode.js: "npm:^2.3.1" + uc.micro: "npm:^2.1.0" + bin: + markdown-it: bin/markdown-it.mjs + checksum: 10/f34f921be178ed0607ba9e3e27c733642be445e9bb6b1dba88da7aafe8ba1bc5d2f1c3aa8f3fc33b49a902da4e4c08c2feadfafb290b8c7dda766208bb6483a9 + languageName: node + linkType: hard + "markdown-table@npm:^2.0.0": version: 2.0.0 resolution: "markdown-table@npm:2.0.0" @@ -9074,6 +9187,13 @@ __metadata: languageName: node linkType: hard +"mdurl@npm:^2.0.0": + version: 2.0.0 + resolution: "mdurl@npm:2.0.0" + checksum: 10/1720349d4a53e401aa993241368e35c0ad13d816ad0b28388928c58ca9faa0cf755fa45f18ccbf64f4ce54a845a50ddce5c84e4016897b513096a68dac4b0158 + languageName: node + linkType: hard + "media-typer@npm:0.3.0": version: 0.3.0 resolution: "media-typer@npm:0.3.0" @@ -9756,6 +9876,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.5": + version: 9.0.5 + resolution: "minimatch@npm:9.0.5" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10/dd6a8927b063aca6d910b119e1f2df6d2ce7d36eab91de83167dd136bb85e1ebff97b0d3de1cb08bd1f7e018ca170b4962479fefab5b2a69e2ae12cb2edc8348 + languageName: node + linkType: hard + "minimist@npm:^1.2.0": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -11347,6 +11476,13 @@ __metadata: languageName: node linkType: hard +"punycode.js@npm:^2.3.1": + version: 2.3.1 + resolution: "punycode.js@npm:2.3.1" + checksum: 10/f0e946d1edf063f9e3d30a32ca86d8ff90ed13ca40dad9c75d37510a04473340cfc98db23a905cc1e517b1e9deb0f6021dce6f422ace235c60d3c9ac47c5a16a + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" @@ -13054,6 +13190,48 @@ __metadata: languageName: node linkType: hard +"typedoc-docusaurus-theme@npm:^1.4.0": + version: 1.4.2 + resolution: "typedoc-docusaurus-theme@npm:1.4.2" + peerDependencies: + typedoc-plugin-markdown: ">=4.8.0" + checksum: 10/238186fbb4508f60cef1a3c44e4895f2a3ad198152959cf57c7efb52e7dffee32b76b5b56c1c148f1f615832ec6b6d71d236d3768bb3ef7066601b8b43daf424 + languageName: node + linkType: hard + +"typedoc-plugin-markdown@npm:^4.9.0": + version: 4.9.0 + resolution: "typedoc-plugin-markdown@npm:4.9.0" + peerDependencies: + typedoc: 0.28.x + checksum: 10/69293e9cd1a5cecd9d2f92872472dbc48b3912c658d0a2d07b6d7bd96bd1efa9617e9bea6a4e6181482610733533b1b058dc1fc505cac7931875f081f0023a0c + languageName: node + linkType: hard + +"typedoc@npm:^0.28.16": + version: 0.28.16 + resolution: "typedoc@npm:0.28.16" + dependencies: + "@gerrit0/mini-shiki": "npm:^3.17.0" + lunr: "npm:^2.3.9" + markdown-it: "npm:^14.1.0" + minimatch: "npm:^9.0.5" + yaml: "npm:^2.8.1" + peerDependencies: + typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x + bin: + typedoc: bin/typedoc + checksum: 10/657afd087d88a14cf77ad941de8913041a6a025e87c78833a5ee58a52b8252b685730394ab7920781b0b2faa0507b1c9d87fcf82dd86d1b788420716fc17ded3 + languageName: node + linkType: hard + +"uc.micro@npm:^2.0.0, uc.micro@npm:^2.1.0": + version: 2.1.0 + resolution: "uc.micro@npm:2.1.0" + checksum: 10/37197358242eb9afe367502d4638ac8c5838b78792ab218eafe48287b0ed28aaca268ec0392cc5729f6c90266744de32c06ae938549aee041fc93b0f9672d6b2 + languageName: node + linkType: hard + "undici-types@npm:~7.16.0": version: 7.16.0 resolution: "undici-types@npm:7.16.0" @@ -13737,6 +13915,15 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.8.1": + version: 2.8.2 + resolution: "yaml@npm:2.8.2" + bin: + yaml: bin.mjs + checksum: 10/4eab0074da6bc5a5bffd25b9b359cf7061b771b95d1b3b571852098380db3b1b8f96e0f1f354b56cc7216aa97cea25163377ccbc33a2e9ce00316fe8d02f4539 + languageName: node + linkType: hard + "yocto-queue@npm:^1.0.0": version: 1.2.2 resolution: "yocto-queue@npm:1.2.2" diff --git a/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h b/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h index 2a95ce847..fa6137930 100644 --- a/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h +++ b/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h @@ -9,33 +9,27 @@ namespace rnexecutorch { enum class RnExecutorchErrorCode : int32_t { /** - * An umbrella-error that is thrown usually when something unexpected happens, - * for example a 3rd-party library error. + * An umbrella-error that is thrown usually when something unexpected happens, for example a 3rd-party library error. */ UnknownError = 101, /** - * Thrown when a user tries to run a model that is not yet downloaded or - * loaded into memory. + * Thrown when a user tries to run a model that is not yet downloaded or loaded into memory. */ ModuleNotLoaded = 102, /** - * An error ocurred when saving a file. This could be, for instance a result - * image from an image model. + * An error ocurred when saving a file. This could be, for instance a result image from an image model. */ FileWriteFailed = 103, /** - * Thrown when a user tries to run a model that is currently processing. It is - * only allowed to run a single model prediction at a time. + * Thrown when a user tries to run a model that is currently processing. It is only allowed to run a single model prediction at a time. */ ModelGenerating = 104, /** - * Thrown when a language is passed to a multi-language model that is not - * supported. For example OCR or Speech To Text. + * Thrown when a language is passed to a multi-language model that is not supported. For example OCR or Speech To Text. */ LanguageNotSupported = 105, /** - * Thrown when config parameters passed to a model are invalid. For example, - * when LLM's topp is outside of range [0, 1]. + * Thrown when config parameters passed to a model are invalid. For example, when LLM's topp is outside of range [0, 1]. */ InvalidConfig = 112, /** @@ -43,8 +37,7 @@ enum class RnExecutorchErrorCode : int32_t { */ InvalidModelSource = 255, /** - * Thrown when the number of passed inputs to the model is different than the - * model metadata specifies. + * Thrown when the number of passed inputs to the model is different than the model metadata specifies. */ UnexpectedNumInputs = 97, /** @@ -52,8 +45,7 @@ enum class RnExecutorchErrorCode : int32_t { */ ThreadPoolError = 113, /** - * Thrown when a file read operation failed. This could be invalid image url - * passed to image models, or unsupported format. + * Thrown when a file read operation failed. This could be invalid image url passed to image models, or unsupported format. */ FileReadFailed = 114, /** @@ -61,43 +53,35 @@ enum class RnExecutorchErrorCode : int32_t { */ InvalidModelOutput = 115, /** - * Thrown when the dimensions of input tensors don't match the model's - * expected dimensions. + * Thrown when the dimensions of input tensors don't match the model's expected dimensions. */ WrongDimensions = 116, /** - * Thrown when the input passed to our APIs is invalid, for example when - * passing an empty message aray to LLM's generate(). + * Thrown when the input passed to our APIs is invalid, for example when passing an empty message aray to LLM's generate(). */ InvalidUserInput = 117, /** - * Thrown when the number of downloaded files is unexpected, due to download - * interruptions. + * Thrown when the number of downloaded files is unexpected, due to download interruptions. */ DownloadInterrupted = 118, /** - * Thrown when there's a configuration mismatch between multilingual and - * language settings in Speech-to-Text models. + * Thrown when there's a configuration mismatch between multilingual and language settings in Speech-to-Text models. */ MultilingualConfiguration = 160, /** - * Thrown when streaming transcription is attempted but audio data chunk is - * missing. + * Thrown when streaming transcription is attempted but audio data chunk is missing. */ MissingDataChunk = 161, /** - * Thrown when trying to stop or insert data into a stream that hasn't been - * started. + * Thrown when trying to stop or insert data into a stream that hasn't been started. */ StreamingNotStarted = 162, /** - * Thrown when trying to start a new streaming session while another is - * already in progress. + * Thrown when trying to start a new streaming session while another is already in progress. */ StreamingInProgress = 163, /** - * Thrown when a resource fails to download. This could be due to invalid URL, - * or for example a network problem. + * Thrown when a resource fails to download. This could be due to invalid URL, or for example a network problem. */ ResourceFetcherDownloadFailed = 180, /** @@ -113,8 +97,7 @@ enum class RnExecutorchErrorCode : int32_t { */ ResourceFetcherAlreadyOngoing = 183, /** - * Thrown when trying to pause, resume, or cancel a download that is not - * active. + * Thrown when trying to pause, resume, or cancel a download that is not active. */ ResourceFetcherNotActive = 184, /** diff --git a/packages/react-native-executorch/src/constants/llmDefaults.ts b/packages/react-native-executorch/src/constants/llmDefaults.ts index d58648855..815ba2942 100644 --- a/packages/react-native-executorch/src/constants/llmDefaults.ts +++ b/packages/react-native-executorch/src/constants/llmDefaults.ts @@ -1,8 +1,20 @@ import { ChatConfig, Message } from '../types/llm'; +/** + * Default system prompt used to guide the behavior of Large Language Models (LLMs). + * + * @category Utilities - LLM + */ export const DEFAULT_SYSTEM_PROMPT = "You are a knowledgeable, efficient, and direct AI assistant. Provide concise answers, focusing on the key information needed. Offer suggestions tactfully when appropriate to improve outcomes. Engage in productive collaboration with the user. Don't return too much text."; +/** + * Generates a default structured output prompt based on the provided JSON schema. + * + * @category Utilities - LLM + * @param structuredOutputSchema - A string representing the JSON schema for the desired output format. + * @returns A prompt string instructing the model to format its output according to the given schema. + */ export const DEFAULT_STRUCTURED_OUTPUT_PROMPT = ( structuredOutputSchema: string ) => `The output should be formatted as a JSON instance that conforms to the JSON schema below. @@ -14,10 +26,25 @@ Here is the output schema: ${structuredOutputSchema} `; +/** + * Default message history for Large Language Models (LLMs). + * + * @category Utilities - LLM + */ export const DEFAULT_MESSAGE_HISTORY: Message[] = []; +/** + * Default context window length for Large Language Models (LLMs). + * + * @category Utilities - LLM + */ export const DEFAULT_CONTEXT_WINDOW_LENGTH = 5; +/** + * Default chat configuration for Large Language Models (LLMs). + * + * @category Utilities - LLM + */ export const DEFAULT_CHAT_CONFIG: ChatConfig = { systemPrompt: DEFAULT_SYSTEM_PROMPT, initialMessageHistory: DEFAULT_MESSAGE_HISTORY, diff --git a/packages/react-native-executorch/src/constants/modelUrls.ts b/packages/react-native-executorch/src/constants/modelUrls.ts index 7096e6344..b9202a854 100644 --- a/packages/react-native-executorch/src/constants/modelUrls.ts +++ b/packages/react-native-executorch/src/constants/modelUrls.ts @@ -13,36 +13,54 @@ const LLAMA3_2_1B_SPINQUANT_MODEL = `${URL_PREFIX}-llama-3.2/${VERSION_TAG}/llam const LLAMA3_2_TOKENIZER = `${URL_PREFIX}-llama-3.2/${VERSION_TAG}/tokenizer.json`; const LLAMA3_2_TOKENIZER_CONFIG = `${URL_PREFIX}-llama-3.2/${VERSION_TAG}/tokenizer_config.json`; +/** + * @category Models - LMM + */ export const LLAMA3_2_3B = { modelSource: LLAMA3_2_3B_MODEL, tokenizerSource: LLAMA3_2_TOKENIZER, tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const LLAMA3_2_3B_QLORA = { modelSource: LLAMA3_2_3B_QLORA_MODEL, tokenizerSource: LLAMA3_2_TOKENIZER, tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const LLAMA3_2_3B_SPINQUANT = { modelSource: LLAMA3_2_3B_SPINQUANT_MODEL, tokenizerSource: LLAMA3_2_TOKENIZER, tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const LLAMA3_2_1B = { modelSource: LLAMA3_2_1B_MODEL, tokenizerSource: LLAMA3_2_TOKENIZER, tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const LLAMA3_2_1B_QLORA = { modelSource: LLAMA3_2_1B_QLORA_MODEL, tokenizerSource: LLAMA3_2_TOKENIZER, tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const LLAMA3_2_1B_SPINQUANT = { modelSource: LLAMA3_2_1B_SPINQUANT_MODEL, tokenizerSource: LLAMA3_2_TOKENIZER, @@ -59,36 +77,54 @@ const QWEN3_4B_QUANTIZED_MODEL = `${URL_PREFIX}-qwen-3/${VERSION_TAG}/qwen-3-4B/ const QWEN3_TOKENIZER = `${URL_PREFIX}-qwen-3/${VERSION_TAG}/tokenizer.json`; const QWEN3_TOKENIZER_CONFIG = `${URL_PREFIX}-qwen-3/${VERSION_TAG}/tokenizer_config.json`; +/** + * @category Models - LMM + */ export const QWEN3_0_6B = { modelSource: QWEN3_0_6B_MODEL, tokenizerSource: QWEN3_TOKENIZER, tokenizerConfigSource: QWEN3_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN3_0_6B_QUANTIZED = { modelSource: QWEN3_0_6B_QUANTIZED_MODEL, tokenizerSource: QWEN3_TOKENIZER, tokenizerConfigSource: QWEN3_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN3_1_7B = { modelSource: QWEN3_1_7B_MODEL, tokenizerSource: QWEN3_TOKENIZER, tokenizerConfigSource: QWEN3_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN3_1_7B_QUANTIZED = { modelSource: QWEN3_1_7B_QUANTIZED_MODEL, tokenizerSource: QWEN3_TOKENIZER, tokenizerConfigSource: QWEN3_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN3_4B = { modelSource: QWEN3_4B_MODEL, tokenizerSource: QWEN3_TOKENIZER, tokenizerConfigSource: QWEN3_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN3_4B_QUANTIZED = { modelSource: QWEN3_4B_QUANTIZED_MODEL, tokenizerSource: QWEN3_TOKENIZER, @@ -105,36 +141,54 @@ const HAMMER2_1_3B_QUANTIZED_MODEL = `${URL_PREFIX}-hammer-2.1/${VERSION_TAG}/ha const HAMMER2_1_TOKENIZER = `${URL_PREFIX}-hammer-2.1/${VERSION_TAG}/tokenizer.json`; const HAMMER2_1_TOKENIZER_CONFIG = `${URL_PREFIX}-hammer-2.1/${VERSION_TAG}/tokenizer_config.json`; +/** + * @category Models - LMM + */ export const HAMMER2_1_0_5B = { modelSource: HAMMER2_1_0_5B_MODEL, tokenizerSource: HAMMER2_1_TOKENIZER, tokenizerConfigSource: HAMMER2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const HAMMER2_1_0_5B_QUANTIZED = { modelSource: HAMMER2_1_0_5B_QUANTIZED_MODEL, tokenizerSource: HAMMER2_1_TOKENIZER, tokenizerConfigSource: HAMMER2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const HAMMER2_1_1_5B = { modelSource: HAMMER2_1_1_5B_MODEL, tokenizerSource: HAMMER2_1_TOKENIZER, tokenizerConfigSource: HAMMER2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const HAMMER2_1_1_5B_QUANTIZED = { modelSource: HAMMER2_1_1_5B_QUANTIZED_MODEL, tokenizerSource: HAMMER2_1_TOKENIZER, tokenizerConfigSource: HAMMER2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const HAMMER2_1_3B = { modelSource: HAMMER2_1_3B_MODEL, tokenizerSource: HAMMER2_1_TOKENIZER, tokenizerConfigSource: HAMMER2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const HAMMER2_1_3B_QUANTIZED = { modelSource: HAMMER2_1_3B_QUANTIZED_MODEL, tokenizerSource: HAMMER2_1_TOKENIZER, @@ -151,36 +205,54 @@ const SMOLLM2_1_1_7B_QUANTIZED_MODEL = `${URL_PREFIX}-smolLm-2/${VERSION_TAG}/sm const SMOLLM2_1_TOKENIZER = `${URL_PREFIX}-smolLm-2/${VERSION_TAG}/tokenizer.json`; const SMOLLM2_1_TOKENIZER_CONFIG = `${URL_PREFIX}-smolLm-2/${VERSION_TAG}/tokenizer_config.json`; +/** + * @category Models - LMM + */ export const SMOLLM2_1_135M = { modelSource: SMOLLM2_1_135M_MODEL, tokenizerSource: SMOLLM2_1_TOKENIZER, tokenizerConfigSource: SMOLLM2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const SMOLLM2_1_135M_QUANTIZED = { modelSource: SMOLLM2_1_135M_QUANTIZED_MODEL, tokenizerSource: SMOLLM2_1_TOKENIZER, tokenizerConfigSource: SMOLLM2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const SMOLLM2_1_360M = { modelSource: SMOLLM2_1_360M_MODEL, tokenizerSource: SMOLLM2_1_TOKENIZER, tokenizerConfigSource: SMOLLM2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const SMOLLM2_1_360M_QUANTIZED = { modelSource: SMOLLM2_1_360M_QUANTIZED_MODEL, tokenizerSource: SMOLLM2_1_TOKENIZER, tokenizerConfigSource: SMOLLM2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const SMOLLM2_1_1_7B = { modelSource: SMOLLM2_1_1_7B_MODEL, tokenizerSource: SMOLLM2_1_TOKENIZER, tokenizerConfigSource: SMOLLM2_1_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const SMOLLM2_1_1_7B_QUANTIZED = { modelSource: SMOLLM2_1_1_7B_QUANTIZED_MODEL, tokenizerSource: SMOLLM2_1_TOKENIZER, @@ -197,36 +269,54 @@ const QWEN2_5_3B_QUANTIZED_MODEL = `${URL_PREFIX}-qwen-2.5/${VERSION_TAG}/qwen-2 const QWEN2_5_TOKENIZER = `${URL_PREFIX}-qwen-2.5/${VERSION_TAG}/tokenizer.json`; const QWEN2_5_TOKENIZER_CONFIG = `${URL_PREFIX}-qwen-2.5/${VERSION_TAG}/tokenizer_config.json`; +/** + * @category Models - LMM + */ export const QWEN2_5_0_5B = { modelSource: QWEN2_5_0_5B_MODEL, tokenizerSource: QWEN2_5_TOKENIZER, tokenizerConfigSource: QWEN2_5_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN2_5_0_5B_QUANTIZED = { modelSource: QWEN2_5_0_5B_QUANTIZED_MODEL, tokenizerSource: QWEN2_5_TOKENIZER, tokenizerConfigSource: QWEN2_5_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN2_5_1_5B = { modelSource: QWEN2_5_1_5B_MODEL, tokenizerSource: QWEN2_5_TOKENIZER, tokenizerConfigSource: QWEN2_5_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN2_5_1_5B_QUANTIZED = { modelSource: QWEN2_5_1_5B_QUANTIZED_MODEL, tokenizerSource: QWEN2_5_TOKENIZER, tokenizerConfigSource: QWEN2_5_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN2_5_3B = { modelSource: QWEN2_5_3B_MODEL, tokenizerSource: QWEN2_5_TOKENIZER, tokenizerConfigSource: QWEN2_5_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const QWEN2_5_3B_QUANTIZED = { modelSource: QWEN2_5_3B_QUANTIZED_MODEL, tokenizerSource: QWEN2_5_TOKENIZER, @@ -239,12 +329,18 @@ const PHI_4_MINI_4B_QUANTIZED_MODEL = `${URL_PREFIX}-phi-4-mini/${VERSION_TAG}/q const PHI_4_MINI_TOKENIZER = `${URL_PREFIX}-phi-4-mini/${VERSION_TAG}/tokenizer.json`; const PHI_4_MINI_TOKENIZER_CONFIG = `${URL_PREFIX}-phi-4-mini/${VERSION_TAG}/tokenizer_config.json`; +/** + * @category Models - LMM + */ export const PHI_4_MINI_4B = { modelSource: PHI_4_MINI_4B_MODEL, tokenizerSource: PHI_4_MINI_TOKENIZER, tokenizerConfigSource: PHI_4_MINI_TOKENIZER_CONFIG, }; +/** + * @category Models - LMM + */ export const PHI_4_MINI_4B_QUANTIZED = { modelSource: PHI_4_MINI_4B_QUANTIZED_MODEL, tokenizerSource: PHI_4_MINI_TOKENIZER, @@ -257,6 +353,9 @@ const EFFICIENTNET_V2_S_MODEL = ? `${URL_PREFIX}-efficientnet-v2-s/${VERSION_TAG}/coreml/efficientnet_v2_s_coreml_all.pte` : `${URL_PREFIX}-efficientnet-v2-s/${VERSION_TAG}/xnnpack/efficientnet_v2_s_xnnpack.pte`; +/** + * @category Models - Classification + */ export const EFFICIENTNET_V2_S = { modelSource: EFFICIENTNET_V2_S_MODEL, }; @@ -264,6 +363,9 @@ export const EFFICIENTNET_V2_S = { // Object detection const SSDLITE_320_MOBILENET_V3_LARGE_MODEL = `${URL_PREFIX}-ssdlite320-mobilenet-v3-large/${VERSION_TAG}/ssdlite320-mobilenetv3-large.pte`; +/** + * @category Models - Object Detection + */ export const SSDLITE_320_MOBILENET_V3_LARGE = { modelSource: SSDLITE_320_MOBILENET_V3_LARGE_MODEL, }; @@ -286,18 +388,30 @@ const STYLE_TRANSFER_UDNIE_MODEL = ? `${URL_PREFIX}-style-transfer-udnie/${VERSION_TAG}/coreml/style_transfer_udnie_coreml.pte` : `${URL_PREFIX}-style-transfer-udnie/${VERSION_TAG}/xnnpack/style_transfer_udnie_xnnpack.pte`; +/** + * @category Models - Style Transfer + */ export const STYLE_TRANSFER_CANDY = { modelSource: STYLE_TRANSFER_CANDY_MODEL, }; +/** + * @category Models - Style Transfer + */ export const STYLE_TRANSFER_MOSAIC = { modelSource: STYLE_TRANSFER_MOSAIC_MODEL, }; +/** + * @category Models - Style Transfer + */ export const STYLE_TRANSFER_RAIN_PRINCESS = { modelSource: STYLE_TRANSFER_RAIN_PRINCESS_MODEL, }; +/** + * @category Models - Style Transfer + */ export const STYLE_TRANSFER_UDNIE = { modelSource: STYLE_TRANSFER_UDNIE_MODEL, }; @@ -330,6 +444,9 @@ const WHISPER_SMALL_TOKENIZER = `${URL_PREFIX}-whisper-small/${VERSION_TAG}/toke const WHISPER_SMALL_ENCODER_MODEL = `${URL_PREFIX}-whisper-small/${VERSION_TAG}/xnnpack/whisper_small_encoder_xnnpack.pte`; const WHISPER_SMALL_DECODER_MODEL = `${URL_PREFIX}-whisper-small/${VERSION_TAG}/xnnpack/whisper_small_decoder_xnnpack.pte`; +/** + * @category Models - Speech To Text + */ export const WHISPER_TINY_EN = { isMultilingual: false, encoderSource: WHISPER_TINY_EN_ENCODER, @@ -337,6 +454,9 @@ export const WHISPER_TINY_EN = { tokenizerSource: WHISPER_TINY_EN_TOKENIZER, }; +/** + * @category Models - Speech To Text + */ export const WHISPER_TINY_EN_QUANTIZED = { isMultilingual: false, encoderSource: WHISPER_TINY_EN_ENCODER_QUANTIZED, @@ -344,6 +464,9 @@ export const WHISPER_TINY_EN_QUANTIZED = { tokenizerSource: WHISPER_TINY_EN_TOKENIZER, }; +/** + * @category Models - Speech To Text + */ export const WHISPER_BASE_EN = { isMultilingual: false, encoderSource: WHISPER_BASE_EN_ENCODER, @@ -351,6 +474,9 @@ export const WHISPER_BASE_EN = { tokenizerSource: WHISPER_BASE_EN_TOKENIZER, }; +/** + * @category Models - Speech To Text + */ export const WHISPER_SMALL_EN = { isMultilingual: false, encoderSource: WHISPER_SMALL_EN_ENCODER, @@ -358,6 +484,9 @@ export const WHISPER_SMALL_EN = { tokenizerSource: WHISPER_SMALL_EN_TOKENIZER, }; +/** + * @category Models - Speech To Text + */ export const WHISPER_TINY = { isMultilingual: true, encoderSource: WHISPER_TINY_ENCODER_MODEL, @@ -365,6 +494,9 @@ export const WHISPER_TINY = { tokenizerSource: WHISPER_TINY_TOKENIZER, }; +/** + * @category Models - Speech To Text + */ export const WHISPER_BASE = { isMultilingual: true, encoderSource: WHISPER_BASE_ENCODER_MODEL, @@ -372,6 +504,9 @@ export const WHISPER_BASE = { tokenizerSource: WHISPER_BASE_TOKENIZER, }; +/** + * @category Models - Speech To Text + */ export const WHISPER_SMALL = { isMultilingual: true, encoderSource: WHISPER_SMALL_ENCODER_MODEL, @@ -382,6 +517,9 @@ export const WHISPER_SMALL = { // Image segmentation const DEEPLAB_V3_RESNET50_MODEL = `${URL_PREFIX}-deeplab-v3/${VERSION_TAG}/xnnpack/deeplabV3_xnnpack_fp32.pte`; +/** + * @category Models - Image Segmentation + */ export const DEEPLAB_V3_RESNET50 = { modelSource: DEEPLAB_V3_RESNET50_MODEL, }; @@ -389,6 +527,9 @@ export const DEEPLAB_V3_RESNET50 = { // Image Embeddings const CLIP_VIT_BASE_PATCH32_IMAGE_MODEL = `${URL_PREFIX}-clip-vit-base-patch32/${VERSION_TAG}/clip-vit-base-patch32-vision_xnnpack.pte`; +/** + * @category Models - Image Embeddings + */ export const CLIP_VIT_BASE_PATCH32_IMAGE = { modelSource: CLIP_VIT_BASE_PATCH32_IMAGE_MODEL, }; @@ -405,32 +546,51 @@ const MULTI_QA_MPNET_BASE_DOT_V1_TOKENIZER = `${URL_PREFIX}-multi-qa-mpnet-base- const CLIP_VIT_BASE_PATCH32_TEXT_MODEL = `${URL_PREFIX}-clip-vit-base-patch32/${VERSION_TAG}/clip-vit-base-patch32-text_xnnpack.pte`; const CLIP_VIT_BASE_PATCH32_TEXT_TOKENIZER = `${URL_PREFIX}-clip-vit-base-patch32/${VERSION_TAG}/tokenizer.json`; +/** + * @category Models - Text Embeddings + */ export const ALL_MINILM_L6_V2 = { modelSource: ALL_MINILM_L6_V2_MODEL, tokenizerSource: ALL_MINILM_L6_V2_TOKENIZER, }; +/** + * @category Models - Text Embeddings + */ export const ALL_MPNET_BASE_V2 = { modelSource: ALL_MPNET_BASE_V2_MODEL, tokenizerSource: ALL_MPNET_BASE_V2_TOKENIZER, }; +/** + * @category Models - Text Embeddings + */ export const MULTI_QA_MINILM_L6_COS_V1 = { modelSource: MULTI_QA_MINILM_L6_COS_V1_MODEL, tokenizerSource: MULTI_QA_MINILM_L6_COS_V1_TOKENIZER, }; +/** + * @category Models - Text Embeddings + */ export const MULTI_QA_MPNET_BASE_DOT_V1 = { modelSource: MULTI_QA_MPNET_BASE_DOT_V1_MODEL, tokenizerSource: MULTI_QA_MPNET_BASE_DOT_V1_TOKENIZER, }; +/** + * @category Models - Text Embeddings + */ export const CLIP_VIT_BASE_PATCH32_TEXT = { modelSource: CLIP_VIT_BASE_PATCH32_TEXT_MODEL, tokenizerSource: CLIP_VIT_BASE_PATCH32_TEXT_TOKENIZER, }; // Image generation + +/** + * @category Models - Image Generation + */ export const BK_SDM_TINY_VPRED_512 = { schedulerSource: `${URL_PREFIX}-bk-sdm-tiny/${VERSION_TAG}/scheduler/scheduler_config.json`, tokenizerSource: `${URL_PREFIX}-bk-sdm-tiny/${VERSION_TAG}/tokenizer/tokenizer.json`, @@ -439,6 +599,9 @@ export const BK_SDM_TINY_VPRED_512 = { decoderSource: `${URL_PREFIX}-bk-sdm-tiny/${VERSION_TAG}/vae/model.pte`, }; +/** + * @category Models - Image Generation + */ export const BK_SDM_TINY_VPRED_256 = { schedulerSource: `${URL_PREFIX}-bk-sdm-tiny/${VERSION_TAG}/scheduler/scheduler_config.json`, tokenizerSource: `${URL_PREFIX}-bk-sdm-tiny/${VERSION_TAG}/tokenizer/tokenizer.json`, @@ -450,6 +613,9 @@ export const BK_SDM_TINY_VPRED_256 = { // Voice Activity Detection const FSMN_VAD_MODEL = `${URL_PREFIX}-fsmn-vad/${VERSION_TAG}/xnnpack/fsmn-vad_xnnpack.pte`; +/** + * @category Models - Voice Activity Detection + */ export const FSMN_VAD = { modelSource: FSMN_VAD_MODEL, -}; +}; \ No newline at end of file diff --git a/packages/react-native-executorch/src/constants/ocr/models.ts b/packages/react-native-executorch/src/constants/ocr/models.ts index 9f462b738..45a411aef 100644 --- a/packages/react-native-executorch/src/constants/ocr/models.ts +++ b/packages/react-native-executorch/src/constants/ocr/models.ts @@ -27,400 +27,326 @@ const createOCRObject = ( }; }; -const createVerticalOCRObject = ( - recognizerSource: string, - language: keyof typeof symbols -) => { - return { - detectorSource: DETECTOR_CRAFT_MODEL, - recognizerSource, - language, - }; -}; - +/** + * @category OCR Supported Alphabets + */ export const OCR_ABAZA = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'abq'); -export const VERTICAL_OCR_ABAZA = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'abq' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ADYGHE = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'ady'); -export const VERTICAL_OCR_ADYGHE = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'ady' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_AFRIKAANS = createOCRObject(RECOGNIZER_LATIN_CRNN, 'af'); -export const VERTICAL_OCR_AFRIKAANS = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'af' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_AVAR = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'ava'); -export const VERTICAL_OCR_AVAR = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'ava' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_AZERBAIJANI = createOCRObject(RECOGNIZER_LATIN_CRNN, 'az'); -export const VERTICAL_OCR_AZERBAIJANI = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'az' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_BELARUSIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'be'); -export const VERTICAL_OCR_BELARUSIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'be' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_BULGARIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'bg'); -export const VERTICAL_OCR_BULGARIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'bg' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_BOSNIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'bs'); -export const VERTICAL_OCR_BOSNIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'bs' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SIMPLIFIED_CHINESE = createOCRObject( RECOGNIZER_ZH_SIM_CRNN, 'chSim' ); -export const VERTICAL_OCR_SIMPLIFIED_CHINESE = createVerticalOCRObject( - RECOGNIZER_ZH_SIM_CRNN, - 'chSim' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_CHECHEN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'che'); -export const VERTICAL_OCR_CHECHEN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'che' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_CZECH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'cs'); -export const VERTICAL_OCR_CZECH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'cs' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_WELSH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'cy'); -export const VERTICAL_OCR_WELSH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'cy' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_DANISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'da'); -export const VERTICAL_OCR_DANISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'da' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_DARGWA = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'dar'); -export const VERTICAL_OCR_DARGWA = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'dar' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_GERMAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'de'); -export const VERTICAL_OCR_GERMAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'de' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ENGLISH = createOCRObject(RECOGNIZER_ENGLISH_CRNN, 'en'); -export const VERTICAL_OCR_ENGLISH = createVerticalOCRObject( - RECOGNIZER_ENGLISH_CRNN, - 'en' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SPANISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'es'); -export const VERTICAL_OCR_SPANISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'es' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ESTONIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'et'); -export const VERTICAL_OCR_ESTONIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'et' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_FRENCH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'fr'); -export const VERTICAL_OCR_FRENCH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'fr' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_IRISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'ga'); -export const VERTICAL_OCR_IRISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'ga' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_CROATIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'hr'); -export const VERTICAL_OCR_CROATIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'hr' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_HUNGARIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'hu'); -export const VERTICAL_OCR_HUNGARIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'hu' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_INDONESIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'id'); -export const VERTICAL_OCR_INDONESIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'id' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_INGUSH = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'inh'); -export const VERTICAL_OCR_INGUSH = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'inh' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ICELANDIC = createOCRObject(RECOGNIZER_LATIN_CRNN, 'ic'); -export const VERTICAL_OCR_ICELANDIC = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'ic' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ITALIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'it'); -export const VERTICAL_OCR_ITALIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'it' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_JAPANESE = createOCRObject(RECOGNIZER_JAPANESE_CRNN, 'ja'); -export const VERTICAL_OCR_JAPANESE = createVerticalOCRObject( - RECOGNIZER_JAPANESE_CRNN, - 'ja' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_KARBADIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'kbd'); -export const VERTICAL_OCR_KARBADIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'kbd' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_KANNADA = createOCRObject(RECOGNIZER_KANNADA_CRNN, 'kn'); -export const VERTICAL_OCR_KANNADA = createVerticalOCRObject( - RECOGNIZER_KANNADA_CRNN, - 'kn' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_KOREAN = createOCRObject(RECOGNIZER_KOREAN_CRNN, 'ko'); -export const VERTICAL_OCR_KOREAN = createVerticalOCRObject( - RECOGNIZER_KOREAN_CRNN, - 'ko' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_KURDISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'ku'); -export const VERTICAL_OCR_KURDISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'ku' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_LATIN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'la'); -export const VERTICAL_OCR_LATIN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'la' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_LAK = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'lbe'); -export const VERTICAL_OCR_LAK = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'lbe' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_LEZGHIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'lez'); -export const VERTICAL_OCR_LEZGHIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'lez' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_LITHUANIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'lt'); -export const VERTICAL_OCR_LITHUANIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'lt' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_LATVIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'lv'); -export const VERTICAL_OCR_LATVIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'lv' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_MAORI = createOCRObject(RECOGNIZER_LATIN_CRNN, 'mi'); -export const VERTICAL_OCR_MAORI = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'mi' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_MONGOLIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'mn'); -export const VERTICAL_OCR_MONGOLIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'mn' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_MALAY = createOCRObject(RECOGNIZER_LATIN_CRNN, 'ms'); -export const VERTICAL_OCR_MALAY = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'ms' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_MALTESE = createOCRObject(RECOGNIZER_LATIN_CRNN, 'mt'); -export const VERTICAL_OCR_MALTESE = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'mt' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_DUTCH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'nl'); -export const VERTICAL_OCR_DUTCH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'nl' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_NORWEGIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'no'); -export const VERTICAL_OCR_NORWEGIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'no' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_OCCITAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'oc'); -export const VERTICAL_OCR_OCCITAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'oc' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_PALI = createOCRObject(RECOGNIZER_LATIN_CRNN, 'pi'); -export const VERTICAL_OCR_PALI = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'pi' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_POLISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'pl'); -export const VERTICAL_OCR_POLISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'pl' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_PORTUGUESE = createOCRObject(RECOGNIZER_LATIN_CRNN, 'pt'); -export const VERTICAL_OCR_PORTUGUESE = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'pt' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ROMANIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'ro'); -export const VERTICAL_OCR_ROMANIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'ro' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_RUSSIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'ru'); -export const VERTICAL_OCR_RUSSIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'ru' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SERBIAN_CYRILLIC = createOCRObject( RECOGNIZER_CYRILLIC_CRNN, 'rsCyrillic' ); -export const VERTICAL_OCR_SERBIAN_CYRILLIC = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'rsCyrillic' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SERBIAN_LATIN = createOCRObject( RECOGNIZER_LATIN_CRNN, 'rsLatin' ); -export const VERTICAL_OCR_SERBIAN_LATIN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'rsLatin' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SLOVAK = createOCRObject(RECOGNIZER_LATIN_CRNN, 'sk'); -export const VERTICAL_OCR_SLOVAK = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'sk' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SLOVENIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'sl'); -export const VERTICAL_OCR_SLOVENIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'sl' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_ALBANIAN = createOCRObject(RECOGNIZER_LATIN_CRNN, 'sq'); -export const VERTICAL_OCR_ALBANIAN = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'sq' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SWEDISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'sv'); -export const VERTICAL_OCR_SWEDISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'sv' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_SWAHILI = createOCRObject(RECOGNIZER_LATIN_CRNN, 'sw'); -export const VERTICAL_OCR_SWAHILI = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'sw' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_TABASSARAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'tab'); -export const VERTICAL_OCR_TABASSARAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'tab' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_TELUGU = createOCRObject(RECOGNIZER_TELUGU_CRNN, 'te'); -export const VERTICAL_OCR_TELUGU = createVerticalOCRObject( - RECOGNIZER_TELUGU_CRNN, - 'te' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_TAJIK = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'tjk'); -export const VERTICAL_OCR_TAJIK = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'tjk' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_TAGALOG = createOCRObject(RECOGNIZER_LATIN_CRNN, 'tl'); -export const VERTICAL_OCR_TAGALOG = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'tl' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_TURKISH = createOCRObject(RECOGNIZER_LATIN_CRNN, 'tr'); -export const VERTICAL_OCR_TURKISH = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'tr' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_UKRAINIAN = createOCRObject(RECOGNIZER_CYRILLIC_CRNN, 'uk'); -export const VERTICAL_OCR_UKRAINIAN = createVerticalOCRObject( - RECOGNIZER_CYRILLIC_CRNN, - 'uk' -); +/** + * @category OCR Supported Alphabets + */ export const OCR_UZBEK = createOCRObject(RECOGNIZER_LATIN_CRNN, 'uz'); -export const VERTICAL_OCR_UZBEK = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'uz' -); -export const OCR_VIETNAMESE = createOCRObject(RECOGNIZER_LATIN_CRNN, 'vi'); -export const VERTICAL_OCR_VIETNAMESE = createVerticalOCRObject( - RECOGNIZER_LATIN_CRNN, - 'vi' -); +/** + * @category OCR Supported Alphabets + */ +export const OCR_VIETNAMESE = createOCRObject(RECOGNIZER_LATIN_CRNN, 'vi'); \ No newline at end of file diff --git a/packages/react-native-executorch/src/constants/ocr/symbols.ts b/packages/react-native-executorch/src/constants/ocr/symbols.ts index aaf2241e2..e122958c6 100644 --- a/packages/react-native-executorch/src/constants/ocr/symbols.ts +++ b/packages/react-native-executorch/src/constants/ocr/symbols.ts @@ -19,6 +19,9 @@ export const alphabets = { '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZಂಃಅಆಇಈಉಊಋಎಏಐಒಓಔಕಖಗಘಙಚಛಜಝಞಟಠಡಢಣತಥದಧನಪಫಬಭಮಯರಲಳವಶಷಸಹಾಿೀುೂೃೆೇೈೊೋೌ್೦೧೨೩೪೫೬೭೮೯', }; +/** + * Mapping of language codes to their corresponding symbol sets. + */ export const symbols = { // Abaza abq: alphabets.cyrillic, diff --git a/packages/react-native-executorch/src/constants/tts/models.ts b/packages/react-native-executorch/src/constants/tts/models.ts index f9677478e..40624848a 100644 --- a/packages/react-native-executorch/src/constants/tts/models.ts +++ b/packages/react-native-executorch/src/constants/tts/models.ts @@ -9,6 +9,8 @@ const KOKORO_EN_MEDIUM_MODELS_ROOT = `${KOKORO_EN_MODELS_ROOT}/medium`; * A Kokoro model instance which processes the text in batches of maximum 64 tokens. * Uses significant less memory than the medium model, but could produce * a lower quality speech due to forced, aggressive text splitting. + * + * @category Models - Text to Speech */ export const KOKORO_SMALL = { type: 'kokoro' as const, @@ -18,6 +20,8 @@ export const KOKORO_SMALL = { /** * A standard Kokoro instance which processes the text in batches of maximum 128 tokens. + * + * @category Models - Text to Speech */ export const KOKORO_MEDIUM = { type: 'kokoro' as const, diff --git a/packages/react-native-executorch/src/constants/tts/voices.ts b/packages/react-native-executorch/src/constants/tts/voices.ts index 7736c8d79..16a682829 100644 --- a/packages/react-native-executorch/src/constants/tts/voices.ts +++ b/packages/react-native-executorch/src/constants/tts/voices.ts @@ -18,41 +18,65 @@ const EN_GB_RESOURCES = { // Kokoro voices const KOKORO_VOICE_PREFIX = `${URL_PREFIX}-kokoro/${NEXT_VERSION_TAG}/voices`; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_AF_HEART = { lang: 'en-us' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/af_heart.bin`, extra: EN_US_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_AF_RIVER = { lang: 'en-us' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/af_river.bin`, extra: EN_US_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_AF_SARAH = { lang: 'en-us' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/af_sarah.bin`, extra: EN_US_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_AM_ADAM = { lang: 'en-us' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/am_adam.bin`, extra: EN_US_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_AM_MICHAEL = { lang: 'en-us' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/am_michael.bin`, extra: EN_US_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_AM_SANTA = { lang: 'en-us' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/am_santa.bin`, extra: EN_US_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_BF_EMMA = { lang: 'en-gb' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/bf_emma.bin`, extra: EN_GB_RESOURCES, } as VoiceConfig; +/** + * @category TTS Supported Voices + */ export const KOKORO_VOICE_BM_DANIEL = { lang: 'en-gb' as const, voiceSource: `${KOKORO_VOICE_PREFIX}/bm_daniel.bin`, diff --git a/packages/react-native-executorch/src/errors/ErrorCodes.ts b/packages/react-native-executorch/src/errors/ErrorCodes.ts index a3e6e28ee..26378f9b1 100644 --- a/packages/react-native-executorch/src/errors/ErrorCodes.ts +++ b/packages/react-native-executorch/src/errors/ErrorCodes.ts @@ -51,7 +51,7 @@ export enum RnExecutorchErrorCode { */ WrongDimensions = 116, /** - * Thrown when the input passed to our APIs is invalid, for example when passing an empty message array to LLM's generate(). + * Thrown when the input passed to our APIs is invalid, for example when passing an empty message aray to LLM's generate(). */ InvalidUserInput = 117, /** @@ -98,22 +98,76 @@ export enum RnExecutorchErrorCode { * Thrown when required URI information is missing for a download operation. */ ResourceFetcherMissingUri = 185, + /** + * Status indicating a successful operation. + */ Ok = 0, + /** + * An internal error occurred. + */ Internal = 1, + /** + * Status indicating the executor is in an invalid state for a targeted operation. + */ InvalidState = 2, + /** + * Status indicating there are no more steps of execution to run + */ EndOfMethod = 3, + /** + * Operation is not supported in the current context. + */ NotSupported = 16, + /** + * Operation is not yet implemented. + */ NotImplemented = 17, + /** + * User provided an invalid argument. + */ InvalidArgument = 18, + /** + * Object is an invalid type for the operation. + */ InvalidType = 19, + /** + * Operator(s) missing in the operator registry. + */ OperatorMissing = 20, + /** + * Requested resource could not be found. + */ NotFound = 32, + /** + * Could not allocate the requested memory. + */ MemoryAllocationFailed = 33, + /** + * Could not access a resource. + */ AccessFailed = 34, + /** + * Error caused by the contents of a program. + */ InvalidProgram = 35, + /** + * Error caused by the contents of external data. + */ InvalidExternalData = 36, + /** + * Does not have enough resources to perform the requested operation. + */ OutOfResources = 37, + /** + * Init stage: Backend receives an incompatible delegate version. + */ DelegateInvalidCompatibility = 48, + /** + * Init stage: Backend fails to allocate memory. + */ DelegateMemoryAllocationFailed = 49, + /** + * Execute stage: The handle is invalid. + */ DelegateInvalidHandle = 50, } diff --git a/packages/react-native-executorch/src/errors/errorUtils.ts b/packages/react-native-executorch/src/errors/errorUtils.ts index cc32f314b..794f0e67b 100644 --- a/packages/react-native-executorch/src/errors/errorUtils.ts +++ b/packages/react-native-executorch/src/errors/errorUtils.ts @@ -1,13 +1,34 @@ import { RnExecutorchErrorCode } from './ErrorCodes'; +/** + * Custom error class for React Native ExecuTorch errors. + */ export class RnExecutorchError extends Error { + /** + * The error code representing the type of error. + */ public code: RnExecutorchErrorCode; + + /** + * The original cause of the error, if any. + */ public cause?: unknown; constructor(code: number, message: string, cause?: unknown) { super(message); + /** + * The error code representing the type of error. + */ this.code = code; + + /** + * The message describing the error. + */ this.message = message; + + /** + * The original cause of the error, if any. + */ this.cause = cause; } } diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useClassification.ts b/packages/react-native-executorch/src/hooks/computer_vision/useClassification.ts index a2a569ca4..83c9a31e4 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useClassification.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useClassification.ts @@ -1,13 +1,15 @@ -import { ResourceSource } from '../../types/common'; import { useModule } from '../useModule'; import { ClassificationModule } from '../../modules/computer_vision/ClassificationModule'; +import { ClassificationProps, ClassificationType } from '../../types/classification'; -interface Props { - model: { modelSource: ResourceSource }; - preventLoad?: boolean; -} - -export const useClassification = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing a Classification model instance. + * + * @category Hooks + * @param ClassificationConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Classification model. + */ +export const useClassification = ({ model, preventLoad = false }: ClassificationProps): ClassificationType => useModule({ module: ClassificationModule, model, diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useImageEmbeddings.ts b/packages/react-native-executorch/src/hooks/computer_vision/useImageEmbeddings.ts index 2882d410d..7d1d21893 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useImageEmbeddings.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useImageEmbeddings.ts @@ -1,13 +1,15 @@ import { ImageEmbeddingsModule } from '../../modules/computer_vision/ImageEmbeddingsModule'; -import { ResourceSource } from '../../types/common'; +import { ImageEmbeddingsProps } from '../../types/imageEmbeddings'; import { useModule } from '../useModule'; -interface Props { - model: { modelSource: ResourceSource }; - preventLoad?: boolean; -} - -export const useImageEmbeddings = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing an Image Embeddings model instance. + * + * @category Hooks + * @param ImageEmbeddingsConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Image Embeddings model. + */ +export const useImageEmbeddings = ({ model, preventLoad = false }: ImageEmbeddingsProps) => useModule({ module: ImageEmbeddingsModule, model, diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useImageSegmentation.ts b/packages/react-native-executorch/src/hooks/computer_vision/useImageSegmentation.ts index 8b37c21be..9fdc4771f 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useImageSegmentation.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useImageSegmentation.ts @@ -1,13 +1,15 @@ import { useModule } from '../useModule'; import { ImageSegmentationModule } from '../../modules/computer_vision/ImageSegmentationModule'; -import { ResourceSource } from '../../types/common'; +import { ImageSegmentationProps, ImageSegmentationType } from '../../types/imageSegmentation'; -interface Props { - model: { modelSource: ResourceSource }; - preventLoad?: boolean; -} - -export const useImageSegmentation = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing an Image Segmentation model instance. + * + * @category Hooks + * @param ImageSegmentationConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Image Segmentation model. + */ +export const useImageSegmentation = ({ model, preventLoad = false }: ImageSegmentationProps): ImageSegmentationType => useModule({ module: ImageSegmentationModule, model, diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useOCR.ts b/packages/react-native-executorch/src/hooks/computer_vision/useOCR.ts index 1790023c3..3fb49307c 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useOCR.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useOCR.ts @@ -1,28 +1,19 @@ import { useEffect, useState } from 'react'; -import { ResourceSource } from '../../types/common'; -import { OCRDetection, OCRLanguage } from '../../types/ocr'; +import { OCRProps, OCRType } from '../../types/ocr'; import { OCRController } from '../../controllers/OCRController'; import { RnExecutorchError } from '../../errors/errorUtils'; -interface OCRModule { - error: RnExecutorchError | null; - isReady: boolean; - isGenerating: boolean; - forward: (imageSource: string) => Promise; - downloadProgress: number; -} - +/** + * React hook for managing an OCR instance. + * + * @category Hooks + * @param OCRConfiguration - Configuration object containing `model` sources and optional `preventLoad` flag. + * @returns Ready to use OCR model. + */ export const useOCR = ({ model, preventLoad = false, -}: { - model: { - detectorSource: ResourceSource; - recognizerSource: ResourceSource; - language: OCRLanguage; - }; - preventLoad?: boolean; -}): OCRModule => { +}: OCRProps): OCRType => { const [error, setError] = useState(null); const [isReady, setIsReady] = useState(false); const [isGenerating, setIsGenerating] = useState(false); diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useObjectDetection.ts b/packages/react-native-executorch/src/hooks/computer_vision/useObjectDetection.ts index 19c7dce3d..19537a80a 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useObjectDetection.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useObjectDetection.ts @@ -1,13 +1,15 @@ -import { ResourceSource } from '../../types/common'; import { useModule } from '../useModule'; import { ObjectDetectionModule } from '../../modules/computer_vision/ObjectDetectionModule'; +import { ObjectDetectionProps, ObjectDetectionType } from '../../types/objectDetection'; -interface Props { - model: { modelSource: ResourceSource }; - preventLoad?: boolean; -} - -export const useObjectDetection = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing an Object Detection model instance. + * + * @category Hooks + * @param ObjectDetectionConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Object Detection model. + */ +export const useObjectDetection = ({ model, preventLoad = false }: ObjectDetectionProps): ObjectDetectionType => useModule({ module: ObjectDetectionModule, model, diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useStyleTransfer.ts b/packages/react-native-executorch/src/hooks/computer_vision/useStyleTransfer.ts index 6ad168934..a5ea05009 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useStyleTransfer.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useStyleTransfer.ts @@ -1,13 +1,15 @@ -import { ResourceSource } from '../../types/common'; import { useModule } from '../useModule'; import { StyleTransferModule } from '../../modules/computer_vision/StyleTransferModule'; +import { StyleTransferProps, StyleTransferType } from '../../types/styleTransfer'; -interface Props { - model: { modelSource: ResourceSource }; - preventLoad?: boolean; -} - -export const useStyleTransfer = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing a Style Transfer model instance. + * + * @category Hooks + * @param StyleTransferConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Style Transfer model. + */ +export const useStyleTransfer = ({ model, preventLoad = false }: StyleTransferProps): StyleTransferType => useModule({ module: StyleTransferModule, model, diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useTextToImage.ts b/packages/react-native-executorch/src/hooks/computer_vision/useTextToImage.ts index b33fe59f0..204452c45 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useTextToImage.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useTextToImage.ts @@ -1,38 +1,21 @@ import { useCallback, useEffect, useState } from 'react'; import { RnExecutorchError, parseUnknownError } from '../../errors/errorUtils'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; -import { ResourceSource } from '../../types/common'; import { TextToImageModule } from '../../modules/computer_vision/TextToImageModule'; +import { TextToImageParams, TextToImageType } from '../../types/tti'; -interface TextToImageType { - isReady: boolean; - isGenerating: boolean; - downloadProgress: number; - error: RnExecutorchError | null; - generate: ( - input: string, - imageSize?: number, - numSteps?: number, - seed?: number - ) => Promise; - interrupt: () => void; -} - +/** + * React hook for managing a Text to Image instance. + * + * @category Hooks + * @param TextToImageConfiguration - Configuration object containing `model` source, `inferenceCallback`, and optional `preventLoad` flag. + * @returns Ready to use Text to Image model. + */ export const useTextToImage = ({ model, inferenceCallback, preventLoad = false, -}: { - model: { - tokenizerSource: ResourceSource; - schedulerSource: ResourceSource; - encoderSource: ResourceSource; - unetSource: ResourceSource; - decoderSource: ResourceSource; - }; - inferenceCallback?: (stepIdx: number) => void; - preventLoad?: boolean; -}): TextToImageType => { +}: TextToImageParams): TextToImageType => { const [isReady, setIsReady] = useState(false); const [isGenerating, setIsGenerating] = useState(false); const [downloadProgress, setDownloadProgress] = useState(0); diff --git a/packages/react-native-executorch/src/hooks/computer_vision/useVerticalOCR.ts b/packages/react-native-executorch/src/hooks/computer_vision/useVerticalOCR.ts index bf7da6e03..fc215720f 100644 --- a/packages/react-native-executorch/src/hooks/computer_vision/useVerticalOCR.ts +++ b/packages/react-native-executorch/src/hooks/computer_vision/useVerticalOCR.ts @@ -1,30 +1,20 @@ import { useEffect, useState } from 'react'; -import { ResourceSource } from '../../types/common'; -import { OCRDetection, OCRLanguage } from '../../types/ocr'; +import { OCRType, VerticalOCRProps } from '../../types/ocr'; import { VerticalOCRController } from '../../controllers/VerticalOCRController'; import { RnExecutorchError } from '../../errors/errorUtils'; -interface OCRModule { - error: RnExecutorchError | null; - isReady: boolean; - isGenerating: boolean; - forward: (imageSource: string) => Promise; - downloadProgress: number; -} - +/** + * React hook for managing a Vertical OCR instance. + * + * @category Hooks + * @param VerticalOCRConfiguration - Configuration object containing `model` sources, optional `independentCharacters` and `preventLoad` flag. + * @returns Ready to use Vertical OCR model. + */ export const useVerticalOCR = ({ model, independentCharacters = false, preventLoad = false, -}: { - model: { - detectorSource: ResourceSource; - recognizerSource: ResourceSource; - language: OCRLanguage; - }; - independentCharacters?: boolean; - preventLoad?: boolean; -}): OCRModule => { +}: VerticalOCRProps): OCRType => { const [error, setError] = useState(null); const [isReady, setIsReady] = useState(false); const [isGenerating, setIsGenerating] = useState(false); diff --git a/packages/react-native-executorch/src/hooks/general/useExecutorchModule.ts b/packages/react-native-executorch/src/hooks/general/useExecutorchModule.ts index 457d127d0..3f38bd691 100644 --- a/packages/react-native-executorch/src/hooks/general/useExecutorchModule.ts +++ b/packages/react-native-executorch/src/hooks/general/useExecutorchModule.ts @@ -1,16 +1,18 @@ import { ExecutorchModule } from '../../modules/general/ExecutorchModule'; -import { ResourceSource } from '../../types/common'; +import { ExecutorchModuleProps, ExecutorchModuleType } from '../../types/executorchModule'; import { useModule } from '../useModule'; -interface Props { - modelSource: ResourceSource; - preventLoad?: boolean; -} - +/** + * React hook for managing an arbitrary Executorch module instance. + * + * @category Hooks + * @param executorchModuleConfiguration - Configuration object containing `modelSource` and optional `preventLoad` flag. + * @returns Ready to use Executorch module. + */ export const useExecutorchModule = ({ modelSource, preventLoad = false, -}: Props) => +}: ExecutorchModuleProps): ExecutorchModuleType => useModule({ module: ExecutorchModule, model: modelSource, diff --git a/packages/react-native-executorch/src/hooks/natural_language_processing/useLLM.ts b/packages/react-native-executorch/src/hooks/natural_language_processing/useLLM.ts index 23882e65c..4b8464c2a 100644 --- a/packages/react-native-executorch/src/hooks/natural_language_processing/useLLM.ts +++ b/packages/react-native-executorch/src/hooks/natural_language_processing/useLLM.ts @@ -1,28 +1,42 @@ import { useCallback, useEffect, useState } from 'react'; import { ResourceSource } from '../../types/common'; import { - ChatConfig, - GenerationConfig, + LLMConfig, LLMTool, LLMType, Message, - ToolsConfig, } from '../../types/llm'; import { LLMController } from '../../controllers/LLMController'; import { RnExecutorchError, parseUnknownError } from '../../errors/errorUtils'; -/* -Hook version of LLMModule -*/ +/** + * React hook for managing a Large Language Model (LLM) instance. + * + * @category Hooks + * @param model - Object containing model, tokenizer, and tokenizer config sources. + * @returns An object implementing the `LLMType` interface for interacting with the LLM. + */ export const useLLM = ({ model, preventLoad = false, }: { model: { + /** + * `ResourceSource` that specifies the location of the model binary. + */ modelSource: ResourceSource; + /** + * `ResourceSource pointing` to the JSON file which contains the tokenizer. + */ tokenizerSource: ResourceSource; + /** + * `ResourceSource` pointing to the JSON file which contains the tokenizer config. + */ tokenizerConfigSource: ResourceSource; }; + /** + * Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ preventLoad?: boolean; }): LLMType => { const [token, setToken] = useState(''); @@ -84,11 +98,7 @@ export const useLLM = ({ chatConfig, toolsConfig, generationConfig, - }: { - chatConfig?: Partial; - toolsConfig?: ToolsConfig; - generationConfig?: GenerationConfig; - }) => + }: LLMConfig) => controllerInstance.configure({ chatConfig, toolsConfig, diff --git a/packages/react-native-executorch/src/hooks/natural_language_processing/useSpeechToText.ts b/packages/react-native-executorch/src/hooks/natural_language_processing/useSpeechToText.ts index 3e1324f54..aeb32690d 100644 --- a/packages/react-native-executorch/src/hooks/natural_language_processing/useSpeechToText.ts +++ b/packages/react-native-executorch/src/hooks/natural_language_processing/useSpeechToText.ts @@ -1,16 +1,38 @@ import { useEffect, useCallback, useState } from 'react'; import { SpeechToTextModule } from '../../modules/natural_language_processing/SpeechToTextModule'; -import { DecodingOptions, SpeechToTextModelConfig } from '../../types/stt'; +import { DecodingOptions, SpeechToTextModelConfig, SpeechToTextType } from '../../types/stt'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError, parseUnknownError } from '../../errors/errorUtils'; +/** + * React hook for managing a Speech to Text (STT) instance. + * + * @category Hooks + * @param speechToTextConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Speech to Text model. + */ export const useSpeechToText = ({ model, preventLoad = false, }: { + /** + * Object containing: + * + * `isMultilingual` - A boolean flag indicating whether the model supports multiple languages. + * + * `encoderSource` - A string that specifies the location of a `.pte` file for the encoder. + * + * `decoderSource` - A string that specifies the location of a `.pte` file for the decoder. + * + * `tokenizerSource` - A string that specifies the location to the tokenizer for the model. + */ model: SpeechToTextModelConfig; + + /** + * Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ preventLoad?: boolean; -}) => { +}): SpeechToTextType => { const [error, setError] = useState(null); const [isReady, setIsReady] = useState(false); const [isGenerating, setIsGenerating] = useState(false); diff --git a/packages/react-native-executorch/src/hooks/natural_language_processing/useTextEmbeddings.ts b/packages/react-native-executorch/src/hooks/natural_language_processing/useTextEmbeddings.ts index 2f7ece798..8543522e6 100644 --- a/packages/react-native-executorch/src/hooks/natural_language_processing/useTextEmbeddings.ts +++ b/packages/react-native-executorch/src/hooks/natural_language_processing/useTextEmbeddings.ts @@ -1,16 +1,15 @@ import { TextEmbeddingsModule } from '../../modules/natural_language_processing/TextEmbeddingsModule'; -import { ResourceSource } from '../../types/common'; import { useModule } from '../useModule'; +import { TextEmbeddingsType, TextEmbeddingsProps } from '../../types/textEmbeddings'; -interface Props { - model: { - modelSource: ResourceSource; - tokenizerSource: ResourceSource; - }; - preventLoad?: boolean; -} - -export const useTextEmbeddings = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing a Text Embeddings model instance. + * + * @category Hooks + * @param TextEmbeddingsConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use Text Embeddings model. + */ +export const useTextEmbeddings = ({ model, preventLoad = false }: TextEmbeddingsProps): TextEmbeddingsType => useModule({ module: TextEmbeddingsModule, model, diff --git a/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts b/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts index 2161f9682..d30ffa598 100644 --- a/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts +++ b/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts @@ -1,22 +1,26 @@ import { useCallback, useEffect, useState } from 'react'; import { TextToSpeechModule } from '../../modules/natural_language_processing/TextToSpeechModule'; import { - TextToSpeechConfig, + TextToSpeechProps, TextToSpeechInput, + TextToSpeechType, TextToSpeechStreamingInput, } from '../../types/tts'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError, parseUnknownError } from '../../errors/errorUtils'; -interface Props extends TextToSpeechConfig { - preventLoad?: boolean; -} - +/** + * React hook for managing Text to Speech instance. + * + * @category Hooks + * @param TextToSpeechConfiguration - Configuration object containing `model` source, `voice` and optional `preventLoad`. + * @returns Ready to use Text to Speech model. + */ export const useTextToSpeech = ({ model, voice, preventLoad = false, -}: Props) => { +}: TextToSpeechProps): TextToSpeechType => { const [error, setError] = useState(null); const [isReady, setIsReady] = useState(false); const [isGenerating, setIsGenerating] = useState(false); diff --git a/packages/react-native-executorch/src/hooks/natural_language_processing/useTokenizer.ts b/packages/react-native-executorch/src/hooks/natural_language_processing/useTokenizer.ts index 34e33067e..e9cf2e794 100644 --- a/packages/react-native-executorch/src/hooks/natural_language_processing/useTokenizer.ts +++ b/packages/react-native-executorch/src/hooks/natural_language_processing/useTokenizer.ts @@ -3,14 +3,31 @@ import { TokenizerModule } from '../../modules/natural_language_processing/Token import { ResourceSource } from '../../types/common'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError, parseUnknownError } from '../../errors/errorUtils'; +import { TokenizerType } from '../../types/tokenizer'; +/** + * React hook for managing a Tokenizer instance. + * + * @category Hooks + * @param tokenizerConfiguration - Configuration object containing `tokenizer` source and optional `preventLoad` flag. + * @returns Ready to use Tokenizer model. + */ export const useTokenizer = ({ tokenizer, preventLoad = false, }: { + /** + * Object containing: + * + * `tokenizerSource` - A `ResourceSource` that specifies the location of the tokenizer. + */ tokenizer: { tokenizerSource: ResourceSource }; + + /** + * Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ preventLoad?: boolean; -}) => { +}): TokenizerType => { const [error, setError] = useState(null); const [isReady, setIsReady] = useState(false); const [isGenerating, setIsGenerating] = useState(false); @@ -36,7 +53,7 @@ export const useTokenizer = ({ }, [tokenizerInstance, tokenizer.tokenizerSource, preventLoad]); const stateWrapper = Promise>(fn: T) => { - return (...args: Parameters): Promise> => { + return (...args: Parameters): Promise>> => { if (!isReady) throw new RnExecutorchError( RnExecutorchErrorCode.ModuleNotLoaded, diff --git a/packages/react-native-executorch/src/hooks/natural_language_processing/useVAD.ts b/packages/react-native-executorch/src/hooks/natural_language_processing/useVAD.ts index 2e3cb4235..2fd9c9126 100644 --- a/packages/react-native-executorch/src/hooks/natural_language_processing/useVAD.ts +++ b/packages/react-native-executorch/src/hooks/natural_language_processing/useVAD.ts @@ -1,13 +1,15 @@ -import { ResourceSource } from '../../types/common'; import { useModule } from '../useModule'; import { VADModule } from '../../modules/natural_language_processing/VADModule'; +import { VADType, VADProps } from '../../types/vad'; -interface Props { - model: { modelSource: ResourceSource }; - preventLoad?: boolean; -} - -export const useVAD = ({ model, preventLoad = false }: Props) => +/** + * React hook for managing a VAD model instance. + * + * @category Hooks + * @param VADConfiguration - Configuration object containing `model` source and optional `preventLoad` flag. + * @returns Ready to use VAD model. + */ +export const useVAD = ({ model, preventLoad = false }: VADProps): VADType => useModule({ module: VADModule, model, diff --git a/packages/react-native-executorch/src/hooks/useModule.ts b/packages/react-native-executorch/src/hooks/useModule.ts index 4c97abb67..39b10249b 100644 --- a/packages/react-native-executorch/src/hooks/useModule.ts +++ b/packages/react-native-executorch/src/hooks/useModule.ts @@ -74,9 +74,24 @@ export const useModule = < }; return { + /** + * Contains the error message if the model failed to load. + */ error, + + /** + * Indicates whether the model is ready. + */ isReady, + + /** + * Indicates whether the model is currently generating a response. + */ isGenerating, + + /** + * Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. + */ downloadProgress, forward, }; diff --git a/packages/react-native-executorch/src/index.ts b/packages/react-native-executorch/src/index.ts index 3b8b3e8e4..a42881f45 100644 --- a/packages/react-native-executorch/src/index.ts +++ b/packages/react-native-executorch/src/index.ts @@ -104,6 +104,7 @@ export * from './modules/computer_vision/TextToImageModule'; export * from './modules/natural_language_processing/LLMModule'; export * from './modules/natural_language_processing/SpeechToTextModule'; +export * from './modules/natural_language_processing/TextToSpeechModule'; export * from './modules/natural_language_processing/TextEmbeddingsModule'; export * from './modules/natural_language_processing/TokenizerModule'; export * from './modules/natural_language_processing/VADModule'; @@ -121,11 +122,15 @@ export * from './types/imageSegmentation'; export * from './types/llm'; export * from './types/vad'; export * from './types/common'; -export { - SpeechToTextLanguage, - SpeechToTextModelConfig, - DecodingOptions, -} from './types/stt'; +export * from './types/stt'; +export * from './types/textEmbeddings'; +export * from './types/tts'; +export * from './types/tokenizer'; +export * from './types/executorchModule'; +export * from './types/classification'; +export * from './types/imageEmbeddings'; +export * from './types/styleTransfer'; +export * from './types/tti'; // constants export * from './constants/modelUrls'; diff --git a/packages/react-native-executorch/src/modules/BaseModule.ts b/packages/react-native-executorch/src/modules/BaseModule.ts index 4d5b00ad0..2ea7306b1 100644 --- a/packages/react-native-executorch/src/modules/BaseModule.ts +++ b/packages/react-native-executorch/src/modules/BaseModule.ts @@ -2,6 +2,9 @@ import { ResourceSource } from '../types/common'; import { TensorPtr } from '../types/common'; export abstract class BaseModule { + /** + * Native module instance + */ nativeModule: any = null; abstract load( @@ -10,14 +13,31 @@ export abstract class BaseModule { ...args: any[] ): Promise; + /** + * Runs the model's forward method with the given input tensors. + * It returns the output tensors that mimic the structure of output from ExecuTorch. + * + * @param inputTensor - Array of input tensors. + * @returns Array of output tensors. + */ protected async forwardET(inputTensor: TensorPtr[]): Promise { return await this.nativeModule.forward(inputTensor); } + /** + * Gets the input shape for a given method and index. + * + * @param methodName method name + * @param index index of the argument which shape is requested + * @returns The input shape as an array of numbers. + */ async getInputShape(methodName: string, index: number): Promise { return this.nativeModule.getInputShape(methodName, index); } + /** + * Unloads the model from memory. + */ delete() { if (this.nativeModule !== null) { this.nativeModule.unload(); diff --git a/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts b/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts index deaabbdcd..5b7c49824 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts @@ -4,7 +4,19 @@ import { BaseModule } from '../BaseModule'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; +/** + * Module for image classification tasks. + * + * @category Typescript API + */ export class ClassificationModule extends BaseModule { + /** + * Loads the model, where `modelSource` is a string that specifies the location of the model binary. + * To track the download progress, supply a callback function `onDownloadProgressCallback`. + * + * @param model - Object containing `modelSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { modelSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -22,7 +34,13 @@ export class ClassificationModule extends BaseModule { this.nativeModule = global.loadClassification(paths[0] || ''); } - async forward(imageSource: string) { + /** + * Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + * + * @param imageSource - The image source to be classified. + * @returns The classification result. + */ + async forward(imageSource: string): Promise<{ [category: string]: number }> { if (this.nativeModule == null) throw new RnExecutorchError( RnExecutorchErrorCode.ModuleNotLoaded, diff --git a/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts b/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts index 6ca6ea3b9..07845d058 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts @@ -4,7 +4,18 @@ import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; import { BaseModule } from '../BaseModule'; +/** + * Module for generating image embeddings from input images. + * + * @category Typescript API + */ export class ImageEmbeddingsModule extends BaseModule { + /** + * Loads the model, where `modelSource` is a string that specifies the location of the model binary. + * + * @param model - Object containing `modelSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { modelSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -22,6 +33,12 @@ export class ImageEmbeddingsModule extends BaseModule { this.nativeModule = global.loadImageEmbeddings(paths[0] || ''); } + /** + * Executes the model's forward pass, where `imageSource` is a URI/URL to image that will be embedded. + * + * @param imageSource - The image source to be embedded. + * @returns A Float32Array containing the image embeddings. + */ async forward(imageSource: string): Promise { if (this.nativeModule == null) throw new RnExecutorchError( diff --git a/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts b/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts index d964f530d..ace786640 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts @@ -5,7 +5,20 @@ import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; import { BaseModule } from '../BaseModule'; +/** + * Module for image segmentation tasks. + * + * @category Typescript API + */ export class ImageSegmentationModule extends BaseModule { + + /** + * Loads the model, where `modelSource` is a string that specifies the location of the model binary. + * To track the download progress, supply a callback function `onDownloadProgressCallback`. + * + * @param model - Object containing `modelSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { modelSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -23,11 +36,19 @@ export class ImageSegmentationModule extends BaseModule { this.nativeModule = global.loadImageSegmentation(paths[0] || ''); } + /** + * Executes the model's forward pass + * + * @param imageSource - a fetchable resource or a Base64-encoded string. + * @param classesOfInterest - an optional list of DeeplabLabel used to indicate additional arrays of probabilities to output (see section "Running the model"). The default is an empty list. + * @param resize - an optional boolean to indicate whether the output should be resized to the original image dimensions, or left in the size of the model (see section "Running the model"). The default is `false`. + * @returns A dictionary where keys are `DeeplabLabel` and values are arrays of probabilities for each pixel belonging to the corresponding class. + */ async forward( imageSource: string, classesOfInterest?: DeeplabLabel[], resize?: boolean - ): Promise<{ [key in DeeplabLabel]?: number[] }> { + ): Promise>> { if (this.nativeModule == null) { throw new RnExecutorchError( RnExecutorchErrorCode.ModuleNotLoaded, diff --git a/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts b/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts index ac4e2e2ff..f2d3cb369 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts @@ -2,6 +2,11 @@ import { OCRController } from '../../controllers/OCRController'; import { ResourceSource } from '../../types/common'; import { OCRLanguage } from '../../types/ocr'; +/** + * Module for Optical Character Recognition (OCR) tasks. + * + * @category Typescript API + */ export class OCRModule { private controller: OCRController; @@ -9,6 +14,14 @@ export class OCRModule { this.controller = new OCRController(); } + /** + * Loads the model, where `detectorSource` is a string that specifies the location of the detector binary, + * `recognizerSource` is a string that specifies the location of the recognizer binary, + * and `language` is a parameter that specifies the language of the text to be recognized by the OCR. + * + * @param model - Object containing `detectorSource`, `recognizerSource`, and `language`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { detectorSource: ResourceSource; @@ -25,10 +38,20 @@ export class OCRModule { ); } + /** + * Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + * + * @param imageSource - The image source to be processed. + * @returns The OCR result as a string. + */ async forward(imageSource: string) { return await this.controller.forward(imageSource); } + /** + * Release the memory held by the module. Calling `forward` afterwards is invalid. + * Note that you cannot delete model while it's generating. + */ delete() { this.controller.delete(); } diff --git a/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts b/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts index dde5d2233..08500589d 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts @@ -5,7 +5,20 @@ import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; import { BaseModule } from '../BaseModule'; +/** + * Module for object detection tasks. + * + * @category Typescript API + */ export class ObjectDetectionModule extends BaseModule { + + /** + * Loads the model, where `modelSource` is a string that specifies the location of the model binary. + * To track the download progress, supply a callback function `onDownloadProgressCallback`. + * + * @param model - Object containing `modelSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { modelSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -23,6 +36,14 @@ export class ObjectDetectionModule extends BaseModule { this.nativeModule = global.loadObjectDetection(paths[0] || ''); } + /** + * Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + * `detectionThreshold` can be supplied to alter the sensitivity of the detection. + * + * @param imageSource - The image source to be processed. + * @param detectionThreshold - The threshold for detection sensitivity. Default is 0.7. + * @returns An array of Detection objects representing detected items in the image. + */ async forward( imageSource: string, detectionThreshold: number = 0.7 diff --git a/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts b/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts index 772beeded..ac85cc51a 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts @@ -4,7 +4,19 @@ import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; import { BaseModule } from '../BaseModule'; +/** + * Module for style transfer tasks. + * + * @category Typescript API + */ export class StyleTransferModule extends BaseModule { + /** + * Loads the model, where `modelSource` is a string that specifies the location of the model binary. + * To track the download progress, supply a callback function `onDownloadProgressCallback`. + * + * @param model - Object containing `modelSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { modelSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -22,6 +34,12 @@ export class StyleTransferModule extends BaseModule { this.nativeModule = global.loadStyleTransfer(paths[0] || ''); } + /** + * Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + * + * @param imageSource - The image source to be processed. + * @returns The stylized image as a Base64-encoded string. + */ async forward(imageSource: string): Promise { if (this.nativeModule == null) throw new RnExecutorchError( diff --git a/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts b/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts index 5526fcc8e..f8866f747 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts @@ -6,9 +6,19 @@ import { PNG } from 'pngjs/browser'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; +/** + * Module for text-to-image generation tasks. + * + * @category Typescript API + */ export class TextToImageModule extends BaseModule { private inferenceCallback: (stepIdx: number) => void; + /** + * Creates a new instance of `TextToImageModule` with optional callback on inference step. + * + * @param inferenceCallback - Optional callback function that receives the current step index during inference. + */ constructor(inferenceCallback?: (stepIdx: number) => void) { super(); this.inferenceCallback = (stepIdx: number) => { @@ -16,6 +26,12 @@ export class TextToImageModule extends BaseModule { }; } + /** + * Loads the model from specified resources. + * + * @param model - Object containing sources for tokenizer, scheduler, encoder, unet, and decoder. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { tokenizerSource: ResourceSource; @@ -71,6 +87,16 @@ export class TextToImageModule extends BaseModule { ); } + /** + * Runs the model to generate an image described by `input`, and conditioned by `seed`, performing `numSteps` inference steps. + * The resulting image, with dimensions `imageSize`×`imageSize` pixels, is returned as a base64-encoded string. + * + * @param input - The text prompt to generate the image from. + * @param imageSize - The desired width and height of the output image in pixels. + * @param numSteps - The number of inference steps to perform. + * @param seed - An optional seed for random number generation to ensure reproducibility. + * @returns A Base64-encoded string representing the generated PNG image. + */ async forward( input: string, imageSize: number = 512, @@ -95,6 +121,9 @@ export class TextToImageModule extends BaseModule { return pngString; } + /** + * Interrupts model generation. The model is stopped in the nearest step. + */ public interrupt(): void { this.nativeModule.interrupt(); } diff --git a/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts b/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts index 3eebec716..9dacf473f 100644 --- a/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts +++ b/packages/react-native-executorch/src/modules/computer_vision/VerticalOCRModule.ts @@ -2,6 +2,11 @@ import { VerticalOCRController } from '../../controllers/VerticalOCRController'; import { ResourceSource } from '../../types/common'; import { OCRLanguage } from '../../types/ocr'; +/** + * Module for Vertical Optical Character Recognition (Vertical OCR) tasks. + * + * @category Typescript API + */ export class VerticalOCRModule { private controller: VerticalOCRController; @@ -9,6 +14,15 @@ export class VerticalOCRModule { this.controller = new VerticalOCRController(); } + /** + * Loads the model, where `detectorSource` is a string that specifies the location of the detector binary, + * `recognizerSource` is a string that specifies the location of the recognizer binary, + * and `language` is a parameter that specifies the language of the text to be recognized by the OCR. + * + * @param model - Object containing `detectorSource`, `recognizerSource`, and `language`. + * @param independentCharacters - Whether to treat characters independently during recognition. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { detectorSource: ResourceSource; @@ -27,10 +41,20 @@ export class VerticalOCRModule { ); } + /** + * Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string. + * + * @param imageSource - The image source to be processed. + * @returns The OCR result as a string. + */ async forward(imageSource: string) { return await this.controller.forward(imageSource); } + /** + * Release the memory held by the module. Calling `forward` afterwards is invalid. + * Note that you cannot delete model while it's generating. + */ delete() { this.controller.delete(); } diff --git a/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts b/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts index 6cf3bbc03..02076933f 100644 --- a/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts +++ b/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts @@ -5,7 +5,19 @@ import { ResourceFetcher } from '../../utils/ResourceFetcher'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; +/** + * General module for executing custom Executorch models. + * + * @category Typescript API + */ export class ExecutorchModule extends BaseModule { + /** + * Loads the model, where `modelSource` is a string, number, or object that specifies the location of the model binary. + * Optionally accepts a download progress callback. + * + * @param modelSource - Source of the model to be loaded. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( modelSource: ResourceSource, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -23,6 +35,13 @@ export class ExecutorchModule extends BaseModule { this.nativeModule = global.loadExecutorchModule(paths[0] || ''); } + /** + * Executes the model's forward pass, where input is an array of `TensorPtr` objects. + * If the inference is successful, an array of tensor pointers is returned. + * + * @param inputTensor - Array of input tensor pointers. + * @returns An array of output tensor pointers. + */ async forward(inputTensor: TensorPtr[]): Promise { return await this.forwardET(inputTensor); } diff --git a/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts b/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts index d4b46f4cd..86dbeb926 100644 --- a/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts +++ b/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts @@ -1,23 +1,41 @@ import { LLMController } from '../../controllers/LLMController'; import { ResourceSource } from '../../types/common'; import { - ChatConfig, - GenerationConfig, + LLMConfig, LLMTool, Message, - ToolsConfig, } from '../../types/llm'; +/** + * Module for managing a Large Language Model (LLM) instance. + * + * @category Typescript API + */ export class LLMModule { private controller: LLMController; + /** + * Creates a new instance of LLMModule with optional callbacks. + * @param optionalCallbacks - Object containing optional callbacks. + * + * @returns A new LLMModule instance. + */ constructor({ tokenCallback, responseCallback, messageHistoryCallback, }: { + /** + * Optional callback invoked on every token batch (`string`). + */ tokenCallback?: (token: string) => void; + /** + * Optional callback invoked on every response update (`string`). + */ responseCallback?: (response: string) => void; + /** + * Optional callback invoked on message history updates (`Message[]`). + */ messageHistoryCallback?: (messageHistory: Message[]) => void; } = {}) { this.controller = new LLMController({ @@ -27,6 +45,15 @@ export class LLMModule { }); } + /** + * Loads the LLM model and tokenizer. + * + * @param model - Object containing model, tokenizer, and tokenizer config sources. + * @param model.modelSource - `ResourceSource` that specifies the location of the model binary. + * @param model.tokenizerSource - `ResourceSource` pointing to the JSON file which contains the tokenizer. + * @param model.tokenizerConfigSource - `ResourceSource` pointing to the JSON file which contains the tokenizer config. + * @param onDownloadProgressCallback - Optional callback to track download progress (value between 0 and 1). + */ async load( model: { modelSource: ResourceSource; @@ -41,6 +68,11 @@ export class LLMModule { }); } + /** + * Sets new token callback invoked on every token batch. + * + * @param tokenCallback - Callback function to handle new tokens. + */ setTokenCallback({ tokenCallback, }: { @@ -49,46 +81,93 @@ export class LLMModule { this.controller.setTokenCallback(tokenCallback); } + /** + * Configures chat and tool calling and generation settings. + * See [Configuring the model](../../03-hooks/01-natural-language-processing/useLLM.md#configuring-the-model) for details. + * + * @param configuration - Configuration object containing `chatConfig`, `toolsConfig`, and `generationConfig`. + */ configure({ chatConfig, toolsConfig, generationConfig, - }: { - chatConfig?: Partial; - toolsConfig?: ToolsConfig; - generationConfig?: GenerationConfig; - }) { + }: LLMConfig) { this.controller.configure({ chatConfig, toolsConfig, generationConfig }); } + /** + * Runs model inference with raw input string. + * You need to provide entire conversation and prompt (in correct format and with special tokens!) in input string to this method. + * It doesn't manage conversation context. It is intended for users that need access to the model itself without any wrapper. + * If you want a simple chat with model the consider using `sendMessage` + * + * @param input - Raw input string containing the prompt and conversation history. + * @returns The generated response as a string. + */ async forward(input: string): Promise { await this.controller.forward(input); return this.controller.response; } + /** + * Runs model to complete chat passed in `messages` argument. It doesn't manage conversation context. + * + * @param messages - Array of messages representing the chat history. + * @param tools - Optional array of tools that can be used during generation. + * @returns The generated response as a string. + */ async generate(messages: Message[], tools?: LLMTool[]): Promise { await this.controller.generate(messages, tools); return this.controller.response; } + /** + * Method to add user message to conversation. + * After model responds it will call `messageHistoryCallback()` containing both user message and model response. + * It also returns them. + * + * @param message - The message string to send. + * @returns - Updated message history including the new user message and model response. + */ async sendMessage(message: string): Promise { await this.controller.sendMessage(message); return this.controller.messageHistory; } + /** + * Deletes all messages starting with message on `index` position. + * After deletion it will call `messageHistoryCallback()` containing new history. + * It also returns it. + * + * @param index - The index of the message to delete from history. + * @returns - Updated message history after deletion. + */ deleteMessage(index: number): Message[] { this.controller.deleteMessage(index); return this.controller.messageHistory; } + /** + * Interrupts model generation. It may return one more token after interrupt. + */ interrupt() { this.controller.interrupt(); } - getGeneratedTokenCount() { + /** + * Returns the number of tokens generated in the last response. + * + * @returns The count of generated tokens. + */ + getGeneratedTokenCount(): number { return this.controller.getGeneratedTokenCount(); } + /** + * Method to delete the model from memory. + * Note you cannot delete model while it's generating. + * You need to interrupt it first and make sure model stopped generation. + */ delete() { this.controller.delete(); } diff --git a/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts b/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts index 9619547c8..238f2320b 100644 --- a/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts +++ b/packages/react-native-executorch/src/modules/natural_language_processing/SpeechToTextModule.ts @@ -4,6 +4,11 @@ import { ResourceFetcher } from '../../utils/ResourceFetcher'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError, parseUnknownError } from '../../errors/errorUtils'; +/** + * Module for Speech to Text (STT) functionalities. + * + * @category Typescript API + */ export class SpeechToTextModule { private nativeModule: any; @@ -14,6 +19,13 @@ export class SpeechToTextModule { ignoreBOM: true, }); + /** + * Loads the model specified by the config object. + * `onDownloadProgressCallback` allows you to monitor the current progress of the model download. + * + * @param model - Configuration object containing model sources. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ public async load( model: SpeechToTextModelConfig, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -48,10 +60,20 @@ export class SpeechToTextModule { ); } + /** + * Unloads the model from memory. + */ public delete(): void { this.nativeModule.unload(); } + /** + * Runs the encoding part of the model on the provided waveform. + * Returns the encoded waveform as a Float32Array. Passing `number[]` is deprecated. + * + * @param waveform - The input audio waveform. + * @returns The encoded output. + */ public async encode( waveform: Float32Array | number[] ): Promise { @@ -64,6 +86,13 @@ export class SpeechToTextModule { return new Float32Array(await this.nativeModule.encode(waveform)); } + /** + * Runs the decoder of the model. Passing number[] is deprecated. + * + * @param tokens - The input tokens. + * @param encoderOutput - The encoder output. + * @returns Decoded output. + */ public async decode( tokens: Int32Array | number[], encoderOutput: Float32Array | number[] @@ -85,6 +114,15 @@ export class SpeechToTextModule { ); } + /** + * Starts a transcription process for a given input array (16kHz waveform). + * For multilingual models, specify the language in `options`. + * Returns the transcription as a string. Passing `number[]` is deprecated. + * + * @param waveform - The Float32Array audio data. + * @param options - Decoding options including language. + * @returns The transcription string. + */ public async transcribe( waveform: Float32Array | number[], options: DecodingOptions = {} @@ -104,6 +142,14 @@ export class SpeechToTextModule { return this.textDecoder.decode(new Uint8Array(transcriptionBytes)); } + /** + * Starts a streaming transcription session. + * Yields objects with `committed` and `nonCommitted` transcriptions. + * Use with `streamInsert` and `streamStop` to control the stream. + * + * @param options - Decoding options including language. + * @returns An async generator yielding transcription updates. + */ public async *stream( options: DecodingOptions = {} ): AsyncGenerator<{ committed: string; nonCommitted: string }> { @@ -159,6 +205,11 @@ export class SpeechToTextModule { } } + /** + * Inserts a new audio chunk into the streaming transcription session. Passing `number[]` is deprecated. + * + * @param waveform - The audio chunk to insert. + */ public streamInsert(waveform: Float32Array | number[]): void { if (Array.isArray(waveform)) { Logger.info( @@ -169,6 +220,9 @@ export class SpeechToTextModule { this.nativeModule.streamInsert(waveform); } + /** + * Stops the current streaming transcription session. + */ public streamStop(): void { this.nativeModule.streamStop(); } diff --git a/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts b/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts index 173909b33..cbba62154 100644 --- a/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts +++ b/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts @@ -4,7 +4,21 @@ import { BaseModule } from '../BaseModule'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; +/** + * Module for generating text embeddings from input text. + * + * @category Typescript API + */ export class TextEmbeddingsModule extends BaseModule { + + /** + * Loads the model and tokenizer specified by the config object. + * + * @param model - Object containing model and tokenizer sources. + * @param model.modelSource - `ResourceSource` that specifies the location of the text embeddings model binary. + * @param model.tokenizerSource - `ResourceSource` that specifies the location of the tokenizer JSON file. + * @param onDownloadProgressCallback - Optional callback to track download progress (value between 0 and 1). + */ async load( model: { modelSource: ResourceSource; tokenizerSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -32,6 +46,12 @@ export class TextEmbeddingsModule extends BaseModule { this.nativeModule = global.loadTextEmbeddings(modelPath, tokenizerPath); } + /** + * Executes the model's forward pass, where `input` is a text that will be embedded. + * + * @param input - The text string to embed. + * @returns A Float32Array containing the vector embeddings. + */ async forward(input: string): Promise { return new Float32Array(await this.nativeModule.generate(input)); } diff --git a/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts b/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts index 18b7e9106..66b4e5676 100644 --- a/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts +++ b/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts @@ -8,9 +8,24 @@ import { VoiceConfig, } from '../../types/tts'; +/** + * Module for Text to Speech (TTS) functionalities. + * + * @category Typescript API + */ export class TextToSpeechModule { + /** + * Native module instance + */ nativeModule: any = null; + /** + * Loads the model and voice assets specified by the config object. + * `onDownloadProgressCallback` allows you to monitor the current progress. + * + * @param config - Configuration object containing `model` source, `voice` and optional `preventLoad`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ public async load( config: TextToSpeechConfig, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -73,7 +88,15 @@ export class TextToSpeechModule { ); } - public async forward(text: string, speed: number = 1.0) { + /** + * Synthesizes the provided text into speech. + * Returns a promise that resolves to the full audio waveform as a `Float32Array`. + * + * @param text The input text to be synthesized. + * @param speed Optional speed multiplier for the speech synthesis (default is 1.0). + * @returns A promise resolving to the synthesized audio waveform. + */ + public async forward(text: string, speed: number = 1.0): Promise { if (this.nativeModule == null) throw new RnExecutorchError( RnExecutorchErrorCode.ModuleNotLoaded, @@ -82,7 +105,13 @@ export class TextToSpeechModule { return await this.nativeModule.generate(text, speed); } - public async *stream({ text, speed }: TextToSpeechStreamingInput) { + /** + * Starts a streaming synthesis session. Yields audio chunks as they are generated. + * + * @param input - Input object containing text and optional speed. + * @returns An async generator yielding Float32Array audio chunks. + */ + public async *stream({ text, speed }: TextToSpeechStreamingInput): AsyncGenerator { // Stores computed audio segments const queue: Float32Array[] = []; @@ -124,10 +153,16 @@ export class TextToSpeechModule { } } + /** + * Stops the streaming process if there is any ongoing. + */ public streamStop(): void { this.nativeModule.streamStop(); } + /** + * Unloads the model from memory. + */ delete() { if (this.nativeModule !== null) { this.nativeModule.unload(); diff --git a/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts b/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts index 2dd35e048..e49dabef3 100644 --- a/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts +++ b/packages/react-native-executorch/src/modules/natural_language_processing/TokenizerModule.ts @@ -3,9 +3,24 @@ import { ResourceFetcher } from '../../utils/ResourceFetcher'; import { RnExecutorchError } from '../../errors/errorUtils'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; +/** + * Module for Tokenizer functionalities. + * + * @category Typescript API + */ export class TokenizerModule { + /** + * Native module instance + */ nativeModule: any; + /** + * Loads the tokenizer from the specified source. + * `tokenizerSource` is a string that points to the location of the tokenizer JSON file. + * + * @param tokenizer - Object containing `tokenizerSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( tokenizer: { tokenizerSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -24,25 +39,55 @@ export class TokenizerModule { this.nativeModule = global.loadTokenizerModule(path); } - async encode(s: string) { - return await this.nativeModule.encode(s); + /** + * Converts a string into an array of token IDs. + * + * @param input - The input string to be tokenized. + * @returns An array of token IDs. + */ + async encode(input: string): Promise { + return await this.nativeModule.encode(input); } - async decode(tokens: number[], skipSpecialTokens: boolean = true) { + /** + * Converts an array of token IDs into a string. + * + * @param tokens - Array of token IDs to be decoded. + * @param skipSpecialTokens - Whether to skip special tokens during decoding (default: true). + * @returns The decoded string. + */ + async decode(tokens: number[], skipSpecialTokens: boolean = true): Promise { if (tokens.length === 0) { return ''; } return await this.nativeModule.decode(tokens, skipSpecialTokens); } + /** + * Returns the size of the tokenizer's vocabulary. + * + * @returns The vocabulary size. + */ async getVocabSize(): Promise { return await this.nativeModule.getVocabSize(); } + /** + * Returns the token associated to the ID. + * + * @param tokenId - ID of the token. + * @returns The token string associated to ID. + */ async idToToken(tokenId: number): Promise { return this.nativeModule.idToToken(tokenId); } + /** + * Returns the ID associated to the token. + * + * @param token - The token string. + * @returns The ID associated to the token. + */ async tokenToId(token: string): Promise { return await this.nativeModule.tokenToId(token); } diff --git a/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts b/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts index 43a3c9eee..6152966c5 100644 --- a/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts +++ b/packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts @@ -5,7 +5,19 @@ import { BaseModule } from '../BaseModule'; import { RnExecutorchErrorCode } from '../../errors/ErrorCodes'; import { RnExecutorchError } from '../../errors/errorUtils'; +/** + * Module for Voice Activity Detection (VAD) functionalities. + * + * @category Typescript API + */ export class VADModule extends BaseModule { + /** + * Loads the model, where `modelSource` is a string that specifies the location of the model binary. + * To track the download progress, supply a callback function `onDownloadProgressCallback`. + * + * @param model - Object containing `modelSource`. + * @param onDownloadProgressCallback - Optional callback to monitor download progress. + */ async load( model: { modelSource: ResourceSource }, onDownloadProgressCallback: (progress: number) => void = () => {} @@ -23,6 +35,12 @@ export class VADModule extends BaseModule { this.nativeModule = global.loadVAD(paths[0] || ''); } + /** + * Executes the model's forward pass, where `waveform` is a Float32Array representing the audio signal. + * + * @param waveform - The input audio waveform as a Float32Array. + * @returns A promise resolving to an array of detected speech segments. + */ async forward(waveform: Float32Array): Promise { if (this.nativeModule == null) throw new RnExecutorchError( diff --git a/packages/react-native-executorch/src/types/classification.ts b/packages/react-native-executorch/src/types/classification.ts new file mode 100644 index 000000000..b03034a6c --- /dev/null +++ b/packages/react-native-executorch/src/types/classification.ts @@ -0,0 +1,51 @@ +import { RnExecutorchError } from "../errors/errorUtils"; +import { ResourceSource } from "./common"; + +/** + * Props for the `useClassification` hook. + * + * @category Types + * @property {Object} model - An object containing the model source. + * @property {ResourceSource} model.modelSource - The source of the classification model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface ClassificationProps { + model: { modelSource: ResourceSource }; + preventLoad?: boolean; +} + +/** + * Return type for the `useClassification` hook. + * Manages the state and operations for Computer Vision image classification. + * + * @category Types + */ +export interface ClassificationType { + /** + * Contains the error object if the model failed to load, download, or encountered a runtime error during classification. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the classification model is loaded and ready to process images. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an image. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model binary as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the model's forward pass to classify the provided image. + * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be classified. + * @returns A Promise that resolves to the classification result (typically containing labels and confidence scores). + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image. + */ + forward: (imageSource: string) => Promise<{ [category: string]: number }> +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/common.ts b/packages/react-native-executorch/src/types/common.ts index 165e8fe7f..1cdc0983c 100644 --- a/packages/react-native-executorch/src/types/common.ts +++ b/packages/react-native-executorch/src/types/common.ts @@ -1,30 +1,115 @@ +/** + * Common types used across the React Native Executorch package. + */ + +/** + * Represents a source of a resource, which can be a string (e.g., URL or file path), a number (e.g., resource ID), or an object (e.g., binary data). + * + * @category Types + */ export type ResourceSource = string | number | object; +/** + * Enum representing the scalar types of tensors. + * + * @category Types + */ export enum ScalarType { + /** + * Byte type (8-bit unsigned integer). + */ BYTE = 0, + /** + * Character type (8-bit signed integer). + */ CHAR = 1, + /** + * Short integer type (16-bit signed integer). + */ SHORT = 2, + /** + * Integer type (32-bit signed integer). + */ INT = 3, + /** + * Long integer type (64-bit signed integer). + */ LONG = 4, + /** + * Half-precision floating point type (16-bit). + */ HALF = 5, + /** + * Single-precision floating point type (32-bit). + */ FLOAT = 6, + /** + * Double-precision floating point type (64-bit). + */ DOUBLE = 7, + /** + * Boolean type. + */ BOOL = 11, + /** + * Quantized 8-bit signed integer type. + */ QINT8 = 12, + /** + * Quantized 8-bit unsigned integer type. + */ QUINT8 = 13, + /** + * Quantized 32-bit signed integer type. + */ QINT32 = 14, + /** + * Packed Quantized Unsigned 4-bit Integers type (2 number in 1 byte). + */ QUINT4X2 = 16, + /** + * Packed Quantized Unsigned 2-bit Integer type (4 numbers in 1 byte). + */ QUINT2X4 = 17, + /** + * Raw Bits type. + */ BITS16 = 22, + /** + * Quantized 8-bit floating point type: Sign bit, 5 Exponent bits, 2 Mantissa bits. + */ FLOAT8E5M2 = 23, + /** + * Quantized 8-bit floating point type: Sign bit, 4 Exponent bits, 3 Mantissa bits. + */ FLOAT8E4M3FN = 24, + /** + * Quantized 8-bit floating point type with No Unsigned Zero (NUZ): Sign bit, 5 Exponent bits, 2 Mantissa bits. + */ FLOAT8E5M2FNUZ = 25, + /** + * Quantized 8-bit floating point type with No Unsigned Zero (NUZ): Sign bit, 4 Exponent bits, 3 Mantissa bits. + */ FLOAT8E4M3FNUZ = 26, + /** + * Unsigned 16-bit integer type. + */ UINT16 = 27, + /** + * Unsigned 32-bit integer type. + */ UINT32 = 28, + /** + * Unsigned 64-bit integer type. + */ UINT64 = 29, } +/** + * Represents the data buffer of a tensor, which can be one of several typed array formats. + * + * @category Types + */ export type TensorBuffer = | ArrayBuffer | Float32Array @@ -38,6 +123,14 @@ export type TensorBuffer = | BigInt64Array | BigUint64Array; +/** + * Represents a pointer to a tensor, including its data buffer, size dimensions, and scalar type. + * + * @category Types + * @property {TensorBuffer} dataPtr - The data buffer of the tensor. + * @property {number[]} sizes - An array representing the size of each dimension of the tensor. + * @property {ScalarType} scalarType - The scalar type of the tensor, as defined in the `ScalarType` enum. + */ export interface TensorPtr { dataPtr: TensorBuffer; sizes: number[]; diff --git a/packages/react-native-executorch/src/types/executorchModule.ts b/packages/react-native-executorch/src/types/executorchModule.ts new file mode 100644 index 000000000..579e97de0 --- /dev/null +++ b/packages/react-native-executorch/src/types/executorchModule.ts @@ -0,0 +1,50 @@ +import { ResourceSource, TensorPtr } from '../types/common'; +import { RnExecutorchError } from '../errors/errorUtils'; + +/** + * Props for the `useExecutorchModule` hook. + * + * @category Types + * @property {ResourceSource} modelSource - The source of the ExecuTorch model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface ExecutorchModuleProps { + modelSource: ResourceSource; + preventLoad?: boolean; +} + +/** + * Return type for the `useExecutorchModule` hook. + * Manages the state and core execution methods for a general ExecuTorch model. + * + * @category Types + */ +export interface ExecutorchModuleType { + /** + * Contains the error object if the model failed to load, download, or encountered a runtime error. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the ExecuTorch model binary has successfully loaded into memory and is ready for inference. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing a forward pass. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model binary as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the model's forward pass with the provided input tensors. + * @param inputTensor - An array of `TensorPtr` objects representing the input tensors required by the model. + * @returns A Promise that resolves to an array of output `TensorPtr` objects resulting from the model's inference. + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another request. + */ + forward: (inputTensor: TensorPtr[]) => Promise; +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/imageEmbeddings.ts b/packages/react-native-executorch/src/types/imageEmbeddings.ts new file mode 100644 index 000000000..48625b56e --- /dev/null +++ b/packages/react-native-executorch/src/types/imageEmbeddings.ts @@ -0,0 +1,51 @@ +import { RnExecutorchError } from "../errors/errorUtils"; +import { ResourceSource } from "./common"; + +/** + * Props for the `useImageEmbeddings` hook. + * + * @category Types + * @property {Object} model - An object containing the model source. + * @property {ResourceSource} model.modelSource - The source of the image embeddings model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface ImageEmbeddingsProps { + model: { modelSource: ResourceSource }; + preventLoad?: boolean; +} + +/** + * Return type for the `useImageEmbeddings` hook. + * Manages the state and operations for generating image embeddings (feature vectors) used in Computer Vision tasks. + * + * @category Types + */ +export interface ImageEmbeddingsType { + /** + * Contains the error object if the model failed to load, download, or encountered a runtime error during embedding generation. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the image embeddings model is loaded and ready to process images. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently generating embeddings for an image. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model binary as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the model's forward pass to generate embeddings (a feature vector) for the provided image. + * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + * @returns A Promise that resolves to a `Float32Array` containing the generated embedding vector. + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image. + */ + forward: (imageSource: string) => Promise; +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/imageSegmentation.ts b/packages/react-native-executorch/src/types/imageSegmentation.ts index 747d97fcd..2eb3ece33 100644 --- a/packages/react-native-executorch/src/types/imageSegmentation.ts +++ b/packages/react-native-executorch/src/types/imageSegmentation.ts @@ -1,3 +1,11 @@ +import { RnExecutorchError } from "../errors/errorUtils"; +import { ResourceSource } from "./common"; + +/** + * Labels used in the DeepLab image segmentation model. + * + * @category Types + */ /* eslint-disable @cspell/spellchecker */ export enum DeeplabLabel { BACKGROUND, @@ -23,3 +31,60 @@ export enum DeeplabLabel { TVMONITOR, ARGMAX, // Additional label not present in the model } + +/** + * Props for the `useImageSegmentation` hook. + * + * @property {Object} model - An object containing the model source. + * @property {ResourceSource} model.modelSource - The source of the image segmentation model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + * + * @category Types + */ +export interface ImageSegmentationProps { + model: { modelSource: ResourceSource }; + preventLoad?: boolean; +} + +/** + * Return type for the `useImageSegmentation` hook. + * Manages the state and operations for Computer Vision image segmentation (e.g., DeepLab). + * + * @category Types + */ +export interface ImageSegmentationType { + /** + * Contains the error object if the model failed to load, download, or encountered a runtime error during segmentation. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the segmentation model is loaded and ready to process images. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an image. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model binary as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the model's forward pass to perform semantic segmentation on the provided image. + * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + * @param classesOfInterest - An optional array of `DeeplabLabel` enums. If provided, the model will only return segmentation masks for these specific classes. + * @param resize - An optional boolean indicating whether the output segmentation masks should be resized to match the original image dimensions. Defaults to standard model behavior if undefined. + * @returns A Promise that resolves to an object mapping each detected `DeeplabLabel` to its corresponding segmentation mask (represented as a flattened array of numbers). + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image. + */ + forward: ( + imageSource: string, + classesOfInterest?: DeeplabLabel[], + resize?: boolean + ) => Promise>>; +} + diff --git a/packages/react-native-executorch/src/types/llm.ts b/packages/react-native-executorch/src/types/llm.ts index 53b13cbd0..7b59bb2f2 100644 --- a/packages/react-native-executorch/src/types/llm.ts +++ b/packages/react-native-executorch/src/types/llm.ts @@ -1,57 +1,213 @@ import { RnExecutorchError } from '../errors/errorUtils'; +/** + * React hook for managing a Large Language Model (LLM) instance. + * + * @category Types + */ export interface LLMType { + /** + * History containing all messages in conversation. This field is updated after model responds to sendMessage. + */ messageHistory: Message[]; + + /** + * State of the generated response. This field is updated with each token generated by the model. + */ response: string; + + /** + * The most recently generated token. + */ token: string; + + /** + * Indicates whether the model is ready. + */ isReady: boolean; + + /** + * Indicates whether the model is currently generating a response. + */ isGenerating: boolean; + + /** + * Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval. + */ downloadProgress: number; + + /** + * Contains the error message if the model failed to load. + */ error: RnExecutorchError | null; + + /** + * Configures chat and tool calling. + * See [Configuring the model](../../03-hooks/01-natural-language-processing/useLLM.md#configuring-the-model) for details. + * + * @param {LLMConfig} configuration - Configuration object containing `chatConfig`, `toolsConfig`, and `generationConfig`. + */ configure: ({ chatConfig, toolsConfig, generationConfig, - }: { - chatConfig?: Partial; - toolsConfig?: ToolsConfig; - generationConfig?: GenerationConfig; - }) => void; + }: LLMConfig) => void; + + /** + * Returns the number of tokens generated so far in the current generation. + * + * @returns The count of generated tokens. + */ getGeneratedTokenCount: () => number; + + /** + * Runs model to complete chat passed in `messages` argument. It doesn't manage conversation context. + * + * @param messages - Array of messages representing the chat history. + * @param tools - Optional array of tools that can be used during generation. + */ generate: (messages: Message[], tools?: LLMTool[]) => Promise; + + /** + * Function to add user message to conversation. + * After model responds, `messageHistory` will be updated with both user message and model response. + * + * @param message - The message string to send. + */ sendMessage: (message: string) => Promise; + + /** + * Deletes all messages starting with message on `index` position. After deletion `messageHistory` will be updated. + * + * @param index - The index of the message to delete from history. + */ deleteMessage: (index: number) => void; + + /** + * Function to interrupt the current inference. + */ interrupt: () => void; } +/** + * Configuration object for initializing and customizing a Large Language Model (LLM) instance. + * + * @category Types + */ +export interface LLMConfig { + /** + * Object configuring chat management, contains following properties: + * + * `systemPrompt` - Often used to tell the model what is its purpose, for example - "Be a helpful translator". + * + * `initialMessageHistory` - An array of `Message` objects that represent the conversation history. This can be used to provide initial context to the model. + * + * `contextWindowLength` - The number of messages from the current conversation that the model will use to generate a response. The higher the number, the more context the model will have. Keep in mind that using larger context windows will result in longer inference time and higher memory usage. + */ + chatConfig?: Partial; + + /** + * Object configuring options for enabling and managing tool use. **It will only have effect if your model's chat template support it**. Contains following properties: + * + * `tools` - List of objects defining tools. + * + * `executeToolCallback` - Function that accepts `ToolCall`, executes tool and returns the string to model. + * + * `displayToolCalls` - If set to true, JSON tool calls will be displayed in chat. If false, only answers will be displayed. + */ + toolsConfig?: ToolsConfig; + + /** + * Object configuring generation settings. + * + * `outputTokenBatchSize` - Soft upper limit on the number of tokens in each token batch (in certain cases there can be more tokens in given batch, i.e. when the batch would end with special emoji join character). + * + * `batchTimeInterval` - Upper limit on the time interval between consecutive token batches. + * + * `temperature` - Scales output logits by the inverse of temperature. Controls the randomness / creativity of text generation. + * + * `topp` - Only samples from the smallest set of tokens whose cumulative probability exceeds topp. + */ + generationConfig?: GenerationConfig; +}; + +/** + * Roles that a message sender can have. + * + * @category Types + */ export type MessageRole = 'user' | 'assistant' | 'system'; +/** + * Represents a message in the conversation. + * + * @category Types + * @property {MessageRole} role - Role of the message sender of type `MessageRole`. + * @property {string} content - Content of the message. + */ export interface Message { role: MessageRole; content: string; } +/** + * Represents a tool call made by the model. + * + * @category Types + * @property {string} toolName - The name of the tool being called. + * @property {Object} arguments - The arguments passed to the tool. + */ export interface ToolCall { toolName: string; arguments: Object; } -// usually tool is represented with dictionary (Object), but fields depend on the model -// unfortunately there's no one standard so it's hard to type it better +/** + * Represents a tool that can be used by the model. + * Usually tool is represented with dictionary (Object), but fields depend on the model. + * Unfortunately there's no one standard so it's hard to type it better. + * + * @category Types + */ export type LLMTool = Object; +/** + * Object configuring chat management. + * + * @category Types + * @property {Message[]} initialMessageHistory - An array of `Message` objects that represent the conversation history. This can be used to provide initial context to the model. + * @property {number} contextWindowLength - The number of messages from the current conversation that the model will use to generate a response. The higher the number, the more context the model will have. Keep in mind that using larger context windows will result in longer inference time and higher memory usage. + * @property {string} systemPrompt - Often used to tell the model what is its purpose, for example - "Be a helpful translator". + */ export interface ChatConfig { initialMessageHistory: Message[]; contextWindowLength: number; systemPrompt: string; } +/** + * Object configuring options for enabling and managing tool use. **It will only have effect if your model's chat template support it**. + * + * @category Types + * @property {LLMTool[]} tools - List of objects defining tools. + * @property {(call: ToolCall) => Promise} executeToolCallback - Function that accepts `ToolCall`, executes tool and returns the string to model. + * @property {boolean} [displayToolCalls] - If set to true, JSON tool calls will be displayed in chat. If false, only answers will be displayed. + */ export interface ToolsConfig { tools: LLMTool[]; executeToolCallback: (call: ToolCall) => Promise; displayToolCalls?: boolean; } +/** + * Object configuring generation settings. + * + * @category Types + * @property {number} [temperature] - Scales output logits by the inverse of temperature. Controls the randomness / creativity of text generation. + * @property {number} [topp] - Only samples from the smallest set of tokens whose cumulative probability exceeds topp. + * @property {number} [outputTokenBatchSize] - Soft upper limit on the number of tokens in each token batch (in certain cases there can be more tokens in given batch, i.e. when the batch would end with special emoji join character). + * @property {number} [batchTimeInterval] - Upper limit on the time interval between consecutive token batches. + */ export interface GenerationConfig { temperature?: number; topp?: number; @@ -59,6 +215,11 @@ export interface GenerationConfig { batchTimeInterval?: number; } +/** + * Special tokens used in Large Language Models (LLMs). + * + * @category Types + */ export const SPECIAL_TOKENS = { BOS_TOKEN: 'bos_token', EOS_TOKEN: 'eos_token', diff --git a/packages/react-native-executorch/src/types/objectDetection.ts b/packages/react-native-executorch/src/types/objectDetection.ts index 78aa324dc..88aec5cce 100644 --- a/packages/react-native-executorch/src/types/objectDetection.ts +++ b/packages/react-native-executorch/src/types/objectDetection.ts @@ -1,3 +1,15 @@ +import { RnExecutorchError } from "../errors/errorUtils"; +import { ResourceSource } from "./common"; + +/** + * Represents a bounding box for a detected object in an image. + * + * @category Types + * @property {number} x1 - The x-coordinate of the bottom-left corner of the bounding box. + * @property {number} y1 - The y-coordinate of the bottom-left corner of the bounding box. + * @property {number} x2 - The x-coordinate of the top-right corner of the bounding box. + * @property {number} y2 - The y-coordinate of the top-right corner of the bounding box. + */ export interface Bbox { x1: number; x2: number; @@ -5,13 +17,26 @@ export interface Bbox { y2: number; } +/** + * Represents a detected object within an image, including its bounding box, label, and confidence score. + * + * @category Types + * @property {Bbox} bbox - The bounding box of the detected object, defined by its top-left (x1, y1) and bottom-right (x2, y2) coordinates. + * @property {keyof typeof CocoLabel} label - The class label of the detected object, represented as a key from the `CocoLabel` enum. + * @property {number} score - The confidence score of the detection, typically ranging from 0 to 1. + */ export interface Detection { bbox: Bbox; label: keyof typeof CocoLabel; score: number; } -enum CocoLabel { +/** + * COCO dataset class labels used for object detection. + * + * @category Types + */ +export enum CocoLabel { PERSON = 1, BICYCLE = 2, CAR = 3, @@ -103,3 +128,56 @@ enum CocoLabel { TOOTHBRUSH = 90, HAIR_BRUSH = 91, } + +/** + * Props for the `useObjectDetection` hook. + * + * @category Types + * @property {Object} model - An object containing the model source. + * @property {ResourceSource} model.modelSource - The source of the object detection model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface ObjectDetectionProps { + model: { modelSource: ResourceSource }; + preventLoad?: boolean; +} + +/** + * Return type for the `useObjectDetection` hook. + * Manages the state and operations for Computer Vision object detection tasks. + * + * @category Types + */ +export interface ObjectDetectionType { + /** + * Contains the error object if the model failed to load, download, or encountered a runtime error during detection. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the object detection model is loaded and ready to process images. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an image. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model binary as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the model's forward pass to detect objects within the provided image. + * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + * @param detectionThreshold - An optional number between 0 and 1 representing the minimum confidence score required for an object to be included in the results. Dafault is 0.7. + * @returns A Promise that resolves to an array of `Detection` objects, where each object typically contains bounding box coordinates, a class label, and a confidence score. + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image. + */ + forward: ( + imageSource: string, + detectionThreshold?: number + ) => Promise; +} diff --git a/packages/react-native-executorch/src/types/ocr.ts b/packages/react-native-executorch/src/types/ocr.ts index 873703c63..e479a2dff 100644 --- a/packages/react-native-executorch/src/types/ocr.ts +++ b/packages/react-native-executorch/src/types/ocr.ts @@ -1,14 +1,119 @@ import { symbols } from '../constants/ocr/symbols'; +import { RnExecutorchError } from '../errors/errorUtils'; +import { ResourceSource } from './common'; +/** + * OCRDetection represents a single detected text instance in an image, + * including its bounding box, recognized text, and confidence score. + * + * @category Types + * @property {Point[]} bbox - An array of points defining the bounding box around the detected text. + * @property {string} text - The recognized text within the bounding box. + * @property {number} score - The confidence score of the OCR detection, ranging from 0 to 1. + */ export interface OCRDetection { - bbox: OCRBbox[]; + bbox: Point[]; text: string; score: number; } -export interface OCRBbox { +/** + * Point represents a coordinate in 2D space. + * + * @category Types + * @property {number} x - The x-coordinate of the point. + * @property {number} y - The y-coordinate of the point. + */ +export interface Point { x: number; y: number; } +/** + * Configuration properties for the `useOCR` hook. + * + * @category Types + */ +export interface OCRProps { + /** + * Object containing the necessary model sources and configuration for the OCR pipeline. + */ + model: { + /** + * `ResourceSource` that specifies the location of the text detector model binary. + */ + detectorSource: ResourceSource; + + /** + * `ResourceSource` that specifies the location of the text recognizer model binary. + */ + recognizerSource: ResourceSource; + + /** + * The language configuration enum for the OCR model (e.g., English, Polish, etc.). + */ + language: OCRLanguage; + }; + + /** + * Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. + * Defaults to `false`. + */ + preventLoad?: boolean; +} + +/** + * Configuration properties for the `useVerticalOCR` hook. + * + * @category Types + */ +export interface VerticalOCRProps extends OCRProps { + /** + * Boolean indicating whether to treat each character independently during recognition. + * Defaults to `false`. + */ + independentCharacters?: boolean; +}; + +/** + * Return type for the `useOCR` hook. + * Manages the state and operations for Optical Character Recognition (OCR). + * + * @category Types + */ +export interface OCRType { + /** + * Contains the error object if the models failed to load, download, or encountered a runtime error during recognition. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether both detector and recognizer models are loaded and ready to process images. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an image. + */ + isGenerating: boolean; + + /** + * Represents the total download progress of the model binaries as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the OCR pipeline (detection and recognition) on the provided image. + * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed. + * @returns A Promise that resolves to the OCR results (typically containing the recognized text strings and their bounding boxes). + * @throws {RnExecutorchError} If the models are not loaded or are currently processing another image. + */ + forward: (imageSource: string) => Promise; +} + +/** + * Enumeration of supported OCR languages based on available symbol sets. + * + * @category Types + */ export type OCRLanguage = keyof typeof symbols; diff --git a/packages/react-native-executorch/src/types/stt.ts b/packages/react-native-executorch/src/types/stt.ts index 20627ca11..974f779ad 100644 --- a/packages/react-native-executorch/src/types/stt.ts +++ b/packages/react-native-executorch/src/types/stt.ts @@ -1,6 +1,95 @@ import { ResourceSource } from './common'; +import { RnExecutorchError } from '../errors/errorUtils'; -// Languages supported by whisper (not whisper.en) +/** + * React hook for managing Speech to Text (STT) instance. + * + * @category Types + */ +export interface SpeechToTextType { + /** + * Contains the error message if the model failed to load. + */ + error: null | RnExecutorchError; + + /** + * Indicates whether the model has successfully loaded and is ready for inference. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an inference. + */ + isGenerating: boolean; + + /** + * Tracks the progress of the model download process. + */ + downloadProgress: number; + + /** + * Contains the part of the transcription that is finalized and will not change. + * Useful for displaying stable results during streaming. + */ + committedTranscription: string; + + /** + * Contains the part of the transcription that is still being processed and may change. + * Useful for displaying live, partial results during streaming. + */ + nonCommittedTranscription: string; + + /** + * Runs the encoding part of the model on the provided waveform. Passing `number[]` is deprecated. + * @param waveform - The input audio waveform array. + * @returns A promise resolving to the encoded data. + */ + encode(waveform: Float32Array | number[]): Promise; + + /** + * Runs the decoder of the model. Passing `number[]` is deprecated. + * @param tokens - The encoded audio data. + * @param encoderOutput - The output from the encoder. + * @returns A promise resolving to the decoded text. + */ + decode(tokens: number[] | Int32Array, encoderOutput: Float32Array | number[]): Promise; + + /** + * Starts a transcription process for a given input array, which should be a waveform at 16kHz. + * Passing `number[]` is deprecated. + * @param waveform - The input audio waveform. + * @param options - Decoding options, e.g. `{ language: 'es' }` for multilingual models. + * @returns Resolves a promise with the output transcription when the model is finished. + */ + transcribe(waveform: Float32Array | number[], options?: DecodingOptions | undefined): Promise; + + /** + * Starts a streaming transcription process. + * Use in combination with streamInsert to feed audio chunks and streamStop to end the stream. + * Updates `committedTranscription` and `nonCommittedTranscription` as transcription progresses. + * @param options - Decoding options including language. + * @returns The final transcription string. + */ + stream(options?: DecodingOptions | undefined): Promise; + + /** + * Inserts a chunk of audio data (sampled at 16kHz) into the ongoing streaming transcription. + * Passing `number[]` is deprecated. + * @param waveform - The audio chunk to insert. + */ + streamInsert(waveform: Float32Array | number[]): void; + + /** + * Stops the ongoing streaming transcription process. + */ + streamStop(): void; +} + +/** + * Languages supported by whisper (not whisper.en) + * + * @category Types + */ export type SpeechToTextLanguage = | 'af' | 'sq' @@ -78,13 +167,39 @@ export type SpeechToTextLanguage = | 'cy' | 'yi'; +/** + * Options for decoding speech to text. + * + * @category Types + * @property {SpeechToTextLanguage} [language] - Optional language code to guide the transcription. + */ export interface DecodingOptions { language?: SpeechToTextLanguage; } +/** + * Configuration for Speech to Text model. + * + * @category Types + */ export interface SpeechToTextModelConfig { + /** + * A boolean flag indicating whether the model supports multiple languages. + */ isMultilingual: boolean; + + /** + * A string that specifies the location of a `.pte` file for the encoder. + */ encoderSource: ResourceSource; + + /** + * A string that specifies the location of a `.pte` file for the decoder. + */ decoderSource: ResourceSource; + + /** + * A string that specifies the location to the tokenizer for the model. + */ tokenizerSource: ResourceSource; } diff --git a/packages/react-native-executorch/src/types/styleTransfer.ts b/packages/react-native-executorch/src/types/styleTransfer.ts new file mode 100644 index 000000000..49e11c91a --- /dev/null +++ b/packages/react-native-executorch/src/types/styleTransfer.ts @@ -0,0 +1,51 @@ +import { RnExecutorchError } from "../errors/errorUtils"; +import { ResourceSource } from "./common"; + +/** + * Configuration properties for the `useStyleTransfer` hook. + * + * @category Types + * @property {Object} model - Object containing the `modelSource` for the style transfer model. + * @property {ResourceSource} model.modelSource - `ResourceSource` that specifies the location of the style transfer model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. + */ +export interface StyleTransferProps { + model: { modelSource: ResourceSource }; + preventLoad?: boolean; +} + +/** + * Return type for the `useStyleTransfer` hook. + * Manages the state and operations for applying artistic style transfer to images. + * + * @category Types + */ +export interface StyleTransferType { + /** + * Contains the error object if the model failed to load, download, or encountered a runtime error during style transfer. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the style transfer model is loaded and ready to process images. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an image. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model binary as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Executes the model's forward pass to apply the specific artistic style to the provided image. + * @param imageSource - A string representing the input image source (e.g., a file path, URI, or base64 string) to be stylized. + * @returns A Promise that resolves to a string containing the stylized image (typically as a base64 string or a file URI). + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image. + */ + forward: (imageSource: string) => Promise; +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/textEmbeddings.ts b/packages/react-native-executorch/src/types/textEmbeddings.ts new file mode 100644 index 000000000..ff062cabc --- /dev/null +++ b/packages/react-native-executorch/src/types/textEmbeddings.ts @@ -0,0 +1,54 @@ +import { RnExecutorchError } from '../errors/errorUtils'; +import { ResourceSource } from '../types/common'; + +/** + * React hook state and methods for managing a Text Embeddings model instance. + * + * @category Types + */ +export interface TextEmbeddingsType { + /** + * Contains the error message if the model failed to load or during inference. + */ + error: null | RnExecutorchError; + + /** + * Indicates whether the embeddings model has successfully loaded and is ready for inference. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently generating embeddings. + */ + isGenerating: boolean; + + /** + * Tracks the progress of the model download process (value between 0 and 1). + */ + downloadProgress: number; + + /** + * Runs the text embeddings model on the provided input string. + * @param input - The text string to embed. + * @returns A promise resolving to a Float32Array containing the vector embeddings. + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another request. + */ + forward(input: string): Promise; +} + +/** + * Props for the useTextEmbeddings hook. + * + * @category Types + * @property {Object} model - An object containing the model and tokenizer sources. + * @property {ResourceSource} model.modelSource - The source of the text embeddings model binary. + * @property {ResourceSource} model.tokenizerSource - The source of the tokenizer JSON file. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface TextEmbeddingsProps { + model: { + modelSource: ResourceSource; + tokenizerSource: ResourceSource; + }; + preventLoad?: boolean; +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/tokenizer.ts b/packages/react-native-executorch/src/types/tokenizer.ts new file mode 100644 index 000000000..924cd9672 --- /dev/null +++ b/packages/react-native-executorch/src/types/tokenizer.ts @@ -0,0 +1,63 @@ +import { RnExecutorchError } from '../errors/errorUtils'; + +/** + * React hook state and methods for managing a Tokenizer instance. + * + * @category Types + */ +export interface TokenizerType { + /** + * Contains the error message if the tokenizer failed to load or during processing. + */ + error: null | RnExecutorchError; + + /** + * Indicates whether the tokenizer has successfully loaded and is ready for use. + */ + isReady: boolean; + + /** + * Indicates whether the tokenizer is currently processing data. + */ + isGenerating: boolean; + + /** + * Tracks the progress of the tokenizer download process (value between 0 and 1). + */ + downloadProgress: number; + + /** + * Converts an array of token IDs into a string. + * @param tokens - An array or `number[]` of token IDs to decode. + * @param skipSpecialTokens - Optional boolean to indicate whether special tokens should be skipped during decoding. + * @returns A promise resolving to the decoded text string. + */ + decode(tokens: number[], skipSpecialTokens: boolean | undefined): Promise; + + /** + * Converts a string into an array of token IDs. + * @param text - The input text string to tokenize. + * @returns A promise resolving to an array `number[]` containing the encoded token IDs. + */ + encode(text: string): Promise; + + /** + * Returns the size of the tokenizer's vocabulary. + * @returns A promise resolving to the vocabulary size. + */ + getVocabSize(): Promise; + + /** + * Returns the token associated to the ID. + * @param id - The numeric token ID. + * @returns A promise resolving to the token string representation. + */ + idToToken(id: number): Promise; + + /** + * Returns the ID associated to the token. + * @param token - The token string. + * @returns A promise resolving to the token ID. + */ + tokenToId(token: string): Promise; +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/tti.ts b/packages/react-native-executorch/src/types/tti.ts new file mode 100644 index 000000000..65ef827a1 --- /dev/null +++ b/packages/react-native-executorch/src/types/tti.ts @@ -0,0 +1,87 @@ +import { RnExecutorchError } from '../errors/errorUtils'; +import { ResourceSource } from '../types/common'; + +/** + * Configuration properties for the `useTextToImage` hook. + * + * @category Types + */ +export interface TextToImageParams { + /** + * Object containing the required model sources for the diffusion pipeline. + */ + model: { + /** Source for the text tokenizer binary/config. */ + tokenizerSource: ResourceSource; + /** Source for the diffusion scheduler binary/config. */ + schedulerSource: ResourceSource; + /** Source for the text encoder model binary. */ + encoderSource: ResourceSource; + /** Source for the UNet (noise predictor) model binary. */ + unetSource: ResourceSource; + /** Source for the VAE decoder model binary, used to decode the final image. */ + decoderSource: ResourceSource; + }; + + /** + * Optional callback function that is triggered after each diffusion inference step. + * Useful for updating a progress bar during image generation. + * @param stepIdx - The index of the current inference step. + */ + inferenceCallback?: (stepIdx: number) => void; + + /** + * Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook. + * Defaults to `false`. + */ + preventLoad?: boolean; +} + +/** + * Return type for the `useTextToImage` hook. + * Manages the state and operations for generating images from text prompts using a diffusion model pipeline. + * + * @category Types + */ +export interface TextToImageType { + /** + * Contains the error object if any of the pipeline models failed to load, download, or encountered a runtime error. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the entire diffusion pipeline is loaded into memory and ready for generation. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently generating an image. + */ + isGenerating: boolean; + + /** + * Represents the total download progress of all the model binaries combined, as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Runs the diffusion pipeline to generate an image from the provided text prompt. + * @param input - The text prompt describing the desired image. + * @param [imageSize] - Optional. The target width and height of the generated image (e.g., 512 for 512x512). Defaults to the model's standard size if omitted. + * @param [numSteps] - Optional. The number of denoising steps for the diffusion process. More steps generally yield higher quality at the cost of generation time. + * @param [seed] - Optional. A random seed for reproducible generation. + * @returns A Promise that resolves to a string representing the generated image (e.g., base64 string or file URI). + * @throws {RnExecutorchError} If the model is not loaded or is currently generating another image. + */ + generate: ( + input: string, + imageSize?: number, + numSteps?: number, + seed?: number + ) => Promise; + + /** + * Interrupts the currently active image generation process at the next available inference step. + */ + interrupt: () => void; +} \ No newline at end of file diff --git a/packages/react-native-executorch/src/types/tts.ts b/packages/react-native-executorch/src/types/tts.ts index 6d40c1655..e253c469f 100644 --- a/packages/react-native-executorch/src/types/tts.ts +++ b/packages/react-native-executorch/src/types/tts.ts @@ -1,6 +1,11 @@ import { ResourceSource } from './common'; +import { RnExecutorchError } from '../errors/errorUtils'; -// List all the languages available in TTS models (as lang shorthands) +/** + * List all the languages available in TTS models (as lang shorthands) + * + * @category Types + */ export type TextToSpeechLanguage = | 'en-us' // American English | 'en-gb'; // British English @@ -10,6 +15,7 @@ export type TextToSpeechLanguage = * * So far in Kokoro, each voice is directly associated with a language. * + * @category Types * @property {TextToSpeechLanguage} lang - speaker's language * @property {ResourceSource} voiceSource - a source to a binary file with voice embedding * @property {KokoroVoiceExtras} [extra] - an optional extra sources or properties related to specific voice @@ -20,7 +26,13 @@ export interface VoiceConfig { extra?: KokoroVoiceExtras; // ... add more possible types } -// Kokoro-specific voice extra props +/** + * Kokoro-specific voice extra props + * + * @category Types + * @property {ResourceSource} taggerSource - source to Kokoro's tagger model binary + * @property {ResourceSource} lexiconSource - source to Kokoro's lexicon binary + */ export interface KokoroVoiceExtras { taggerSource: ResourceSource; lexiconSource: ResourceSource; @@ -29,6 +41,11 @@ export interface KokoroVoiceExtras { /** * Kokoro model configuration. * Only the core Kokoro model sources, as phonemizer sources are included in voice configuration. + * + * @category Types + * @property {'kokoro'} type - model type identifier + * @property {ResourceSource} durationPredictorSource - source to Kokoro's duration predictor model binary + * @property {ResourceSource} synthesizerSource - source to Kokoro's synthesizer model binary */ export interface KokoroConfig { type: 'kokoro'; @@ -39,6 +56,7 @@ export interface KokoroConfig { /** * General Text to Speech module configuration * + * @category Types * @property {KokoroConfig} model - a selected T2S model * @property {VoiceConfig} voice - a selected speaker's voice * @property {KokoroOptions} [options] - a completely optional model-specific configuration @@ -48,9 +66,22 @@ export interface TextToSpeechConfig { voice: VoiceConfig; } +/** + * Props for the useTextToSpeech hook. + * + * @category Types + * @extends TextToSpeechConfig + * + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface TextToSpeechProps extends TextToSpeechConfig { + preventLoad?: boolean; +} + /** * Text to Speech module input definition * + * @category Types * @property {string} text - a text to be spoken * @property {number} [speed] - optional speed argument - the higher it is, the faster the speech becomes */ @@ -59,6 +90,56 @@ export interface TextToSpeechInput { speed?: number; } +/** + * Return type for the `useTextToSpeech` hook. + * Manages the state and operations for Text-to-Speech generation. + * + * @category Types + */ +export interface TextToSpeechType { + /** + * Contains the error object if the model failed to load or encountered an error during inference. + */ + error: RnExecutorchError | null; + + /** + * Indicates whether the Text-to-Speech model is loaded and ready to accept inputs. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently generating audio. + */ + isGenerating: boolean; + + /** + * Represents the download progress of the model and voice assets as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Runs the model to convert the provided text into speech audio in a single pass. + * * @param input - The `TextToSpeechInput` object containing the `text` to synthesize and optional `speed`. + * @returns A Promise that resolves with the generated audio data (typically a `Float32Array`). + * @throws {RnExecutorchError} If the model is not loaded or is currently generating. + */ + forward: (input: TextToSpeechInput) => Promise; + + /** + * Streams the generated audio data incrementally. + * This is optimal for real-time playback, allowing audio to start playing before the full text is synthesized. + * * @param input - The `TextToSpeechStreamingInput` object containing `text`, optional `speed`, and lifecycle callbacks (`onBegin`, `onNext`, `onEnd`). + * @returns A Promise that resolves when the streaming process is complete. + * @throws {RnExecutorchError} If the model is not loaded or is currently generating. + */ + stream: (input: TextToSpeechStreamingInput) => Promise; + + /** + * Interrupts and stops the currently active audio generation stream. + */ + streamStop: () => void; +} + /** * Text to Speech streaming input definition * @@ -66,6 +147,8 @@ export interface TextToSpeechInput { * executed at given moments of the streaming. * Actions such as playing the audio should happen within the onNext callback. * Callbacks can be both synchronous or asynchronous. + * + * @category Types * @property {() => void | Promise} [onBegin] - Called when streaming begins * @property {(audio: Float32Array) => void | Promise} [onNext] - Called after each audio chunk gets calculated. * @property {() => void | Promise} [onEnd] - Called when streaming ends diff --git a/packages/react-native-executorch/src/types/vad.ts b/packages/react-native-executorch/src/types/vad.ts index ca0dff920..68b1b5526 100644 --- a/packages/react-native-executorch/src/types/vad.ts +++ b/packages/react-native-executorch/src/types/vad.ts @@ -1,4 +1,62 @@ +import { ResourceSource } from '../types/common'; +import { RnExecutorchError } from '../errors/errorUtils'; + +/** + * Props for the useVAD hook. + * + * @category Types + * @property {Object} model - An object containing the model source. + * @property {ResourceSource} model.modelSource - The source of the VAD model binary. + * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook. + */ +export interface VADProps { + model: { modelSource: ResourceSource }; + preventLoad?: boolean; +} + +/** + * Represents a detected audio segment with start and end timestamps. + * + * @category Types + * @property {number} start - Start time of the segment in seconds. + * @property {number} end - End time of the segment in seconds. + */ export interface Segment { start: number; end: number; } + +/** + * React hook state and methods for managing a Voice Activity Detection (VAD) model instance. + * + * @category Types + */ +export interface VADType { + /** + * Contains the error message if the VAD model failed to load or during processing. + */ + error: null | RnExecutorchError; + + /** + * Indicates whether the VAD model has successfully loaded and is ready for inference. + */ + isReady: boolean; + + /** + * Indicates whether the model is currently processing an inference. + */ + isGenerating: boolean; + + /** + * Represents the download progress as a value between 0 and 1. + */ + downloadProgress: number; + + /** + * Runs the Voice Activity Detection model on the provided audio waveform. + * @param waveform - The input audio waveform array. + * @returns A promise resolving to an array of detected audio segments (e.g., timestamps for speech). + * @throws {RnExecutorchError} If the model is not loaded or is currently processing another request. + */ + forward(waveform: Float32Array): Promise; +} diff --git a/packages/react-native-executorch/src/utils/ResourceFetcher.ts b/packages/react-native-executorch/src/utils/ResourceFetcher.ts index 8e733e1ce..30f4e28e5 100644 --- a/packages/react-native-executorch/src/utils/ResourceFetcher.ts +++ b/packages/react-native-executorch/src/utils/ResourceFetcher.ts @@ -54,9 +54,23 @@ import { import { RnExecutorchErrorCode } from '../errors/ErrorCodes'; import { RnExecutorchError } from '../errors/errorUtils'; +/** + * This module provides functions to download and work with downloaded files stored in the application's document directory inside the `react-native-executorch/` directory. + * These utilities can help you manage your storage and clean up the downloaded files when they are no longer needed. + * + * @category Utilities - General + */ export class ResourceFetcher { static downloads = new Map(); //map of currently downloading (or paused) files, if the download was started by .fetch() method. + /** + * Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch. + * + * @param callback - Optional callback to track progress of all downloads, reported between 0 and 1. + * @param sources - Multiple resources that can be strings, asset references, or objects. + * @returns If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded/stored resources (without file:// prefix). + * If the fetch was interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`. + */ static async fetch( callback: (downloadProgress: number) => void = () => {}, ...sources: ResourceSource[] @@ -238,16 +252,35 @@ export class ResourceFetcher { this.downloads.delete(source); } + /** + * Pauses an ongoing download of files. + * + * @param sources - The resource identifiers used when calling `fetch`. + * @returns A promise that resolves once the download is paused. + */ static async pauseFetching(...sources: ResourceSource[]) { const source = this.findActive(sources); await this.pause(source); } + /** + * Resumes a paused download of files. + * + * @param sources - The resource identifiers used when calling fetch. + * @returns If the fetch was successful, it returns a promise which resolves to an array of local file paths for the downloaded resources (without file:// prefix). + * If the fetch was again interrupted by `pauseFetching` or `cancelFetching`, it returns a promise which resolves to `null`. + */ static async resumeFetching(...sources: ResourceSource[]) { const source = this.findActive(sources); await this.resume(source); } + /** + * Cancels an ongoing/paused download of files. + * + * @param sources - The resource identifiers used when calling `fetch()`. + * @returns A promise that resolves once the download is canceled. + */ static async cancelFetching(...sources: ResourceSource[]) { const source = this.findActive(sources); await this.cancel(source); @@ -265,16 +298,32 @@ export class ResourceFetcher { ); } + /** + * Lists all the downloaded files used by React Native ExecuTorch. + * + * @returns A promise, which resolves to an array of URIs for all the downloaded files. + */ static async listDownloadedFiles() { const files = await readDirectoryAsync(RNEDirectory); return files.map((file) => `${RNEDirectory}${file}`); } + /** + * Lists all the downloaded models used by React Native ExecuTorch. + * + * @returns A promise, which resolves to an array of URIs for all the downloaded models. + */ static async listDownloadedModels() { const files = await this.listDownloadedFiles(); return files.filter((file) => file.endsWith('.pte')); } + /** + * Deletes downloaded resources from the local filesystem. + * + * @param sources - The resource identifiers used when calling `fetch`. + * @returns A promise that resolves once all specified resources have been removed. + */ static async deleteResources(...sources: ResourceSource[]) { for (const source of sources) { const filename = ResourceFetcherUtils.getFilenameFromUri( @@ -287,6 +336,12 @@ export class ResourceFetcher { } } + /** + * Fetches the info about files size. Works only for remote files. + * + * @param sources - The resource identifiers (URLs). + * @returns A promise that resolves to combined size of files in bytes. + */ static async getFilesTotalSize(...sources: ResourceSource[]) { return (await ResourceFetcherUtils.getFilesSizes(sources)).totalLength; } diff --git a/packages/react-native-executorch/src/utils/llm.ts b/packages/react-native-executorch/src/utils/llm.ts index 05e09c45d..476f0edd1 100644 --- a/packages/react-native-executorch/src/utils/llm.ts +++ b/packages/react-native-executorch/src/utils/llm.ts @@ -6,6 +6,13 @@ import { DEFAULT_STRUCTURED_OUTPUT_PROMPT } from '../constants/llmDefaults'; import * as zCore from 'zod/v4/core'; import { Logger } from '../common/Logger'; +/** + * Parses tool calls from a given message string. + * + * @category Utilities - LLM + * @param message - The message string containing tool calls in JSON format. + * @returns An array of `ToolCall` objects extracted from the message. + */ export const parseToolCall: (message: string) => ToolCall[] = ( message: string ) => { @@ -47,6 +54,13 @@ const filterObjectKeys = (obj: object, keysToRemove: string[]) => { return Object.fromEntries(filteredEntries); }; +/** + * Generates a structured output prompt based on the provided schema. + * + * @category Utilities - LLM + * @param responseSchema - The schema (Zod or JSON Schema) defining the desired output format. + * @returns A prompt string instructing the model to format its output according to the given schema. + */ export const getStructuredOutputPrompt = ( responseSchema: T | Schema ) => { @@ -77,7 +91,14 @@ const extractBetweenBrackets = (text: string): string => { ); }; -// this is a bit hacky typing +/** + * Fixes and validates structured output from LLMs against a provided schema. + * + * @category Utilities - LLM + * @param output - The raw output string from the LLM. + * @param responseSchema - The schema (Zod or JSON Schema) to validate the output against. + * @returns The validated and parsed output. + */ export const fixAndValidateStructuredOutput = ( output: string, responseSchema: T | Schema diff --git a/packages/react-native-executorch/tsconfig.doc.json b/packages/react-native-executorch/tsconfig.doc.json new file mode 100644 index 000000000..6104102d0 --- /dev/null +++ b/packages/react-native-executorch/tsconfig.doc.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*"], + "compilerOptions": { + "noEmit": true, + "skipLibCheck": true, + "jsx": "react" + } +} diff --git a/scripts/errors.config.ts b/scripts/errors.config.ts index f272211ea..0458a103d 100644 --- a/scripts/errors.config.ts +++ b/scripts/errors.config.ts @@ -106,30 +106,85 @@ export const errorDefinitions = { // ExecuTorch mapped errors // Based on: https://github.com/pytorch/executorch/blob/main/runtime/core/error.h + // System errors + /** + * Status indicating a successful operation. + */ Ok: 0x00, + /** + * An internal error occurred. + */ Internal: 0x01, + /** + * Status indicating the executor is in an invalid state for a targeted operation. + */ InvalidState: 0x02, + /** + * Status indicating there are no more steps of execution to run + */ EndOfMethod: 0x03, // Logical errors + /** + * Operation is not supported in the current context. + */ NotSupported: 0x10, + /** + * Operation is not yet implemented. + */ NotImplemented: 0x11, + /** + * User provided an invalid argument. + */ InvalidArgument: 0x12, + /** + * Object is an invalid type for the operation. + */ InvalidType: 0x13, + /** + * Operator(s) missing in the operator registry. + */ OperatorMissing: 0x14, // Resource errors + /** + * Requested resource could not be found. + */ NotFound: 0x20, + /** + * Could not allocate the requested memory. + */ MemoryAllocationFailed: 0x21, + /** + * Could not access a resource. + */ AccessFailed: 0x22, + /** + * Error caused by the contents of a program. + */ InvalidProgram: 0x23, + /** + * Error caused by the contents of external data. + */ InvalidExternalData: 0x24, + /** + * Does not have enough resources to perform the requested operation. + */ OutOfResources: 0x25, // Delegate errors + /** + * Init stage: Backend receives an incompatible delegate version. + */ DelegateInvalidCompatibility: 0x30, + /** + * Init stage: Backend fails to allocate memory. + */ DelegateMemoryAllocationFailed: 0x31, + /** + * Execute stage: The handle is invalid. + */ DelegateInvalidHandle: 0x32, } as const;