if (FALSE) {
text_input <- c("Political science is a useful subject",
"We love sociology",
"German elections are different",
"A student was always curious.")
# Configure the embedding API provider (example with Voyage API)
voyage_config <- llm_config(
provider = "voyage",
model = "voyage-large-2",
api_key = Sys.getenv("VOYAGE_API_KEY")
)
embedding_response <- call_llm(voyage_config, text_input)
embeddings <- parse_embeddings(embedding_response)
# Additional processing:
embeddings |> cor() |> print()
}
Run the code above in your browser using DataLab