Documentation Index
Fetch the complete documentation index at: https://dev.docs.inworld.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview > Inworld Text Embedder
Class: UInworldTextEmbedder | Inherits from: UObject
Provides functionality to embed text as vector embeddings using Inworld AI’s Text Embedding services. This class offers both synchronous and asynchronous methods for embedding text inputs into high-dimensional vector representations. Delegates can be used to handle asynchronous results, which include success indicators and the resulting embeddings. Text embeddings are useful for semantic similarity comparisons, intent matching, and knowledge retrieval operations.
Methods
Reference
CreateInworldTextEmbedder
Creates an instance of UInworldTextEmbedder with the given configuration ID.
Examples
UInworldTextEmbedder* CreateInworldTextEmbedder(const FString& ConfigId)
Parameters
| Parameter | Type | Description |
|---|
| ConfigId | const FString& | Identifier for the configuration to use for creating the text embedder. |
Returns
Type: UInworldTextEmbedder*
Description: A pointer to the instance of UInworldTextEmbedder.
Embed
Embeds the input text into embeddings synchronously.
Examples
bool Embed(
const TArray<FString>& Text,
TArray<FInworldTextEmbedding>& OutTextEmbeddings
)
Parameters
| Parameter | Type | Description |
|---|
| Text | const TArray<FString>& | An array of text strings to embed. |
| OutTextEmbeddings | TArray<FInworldTextEmbedding>& | Outputs the resulting embeddings if embedding succeeds. |
Returns
Type: bool
Description: True if the embedding operation is successful, false otherwise.
EmbedAsync
Embeds the input text into embeddings asynchronously.
Examples
void EmbedAsync(
const TArray<FString>& Text,
FOnTextEmbedded Callback
)
Parameters
| Parameter | Type | Description |
|---|
| Text | const TArray<FString>& | An array of text strings to embed. |
| Callback | FOnTextEmbedded | A delegate to handle the embedding result asynchronously. |
EmbedAsync
Examples