| create_embeddings | R Documentation |
Generate embeddings for text using an embedding model.
create_embeddings(model, value, registry = NULL)
model |
Either an EmbeddingModelV1 object, or a string ID like "openai:text-embedding-3-small". |
value |
A character string or vector to embed. |
registry |
Optional ProviderRegistry to use. |
A list with embeddings and usage information.
if (interactive()) {
model <- create_openai()$embedding_model("text-embedding-3-small")
result <- create_embeddings(model, "Hello, world!")
print(length(result$embeddings[[1]]))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.