Skip to content

Instantly share code, notes, and snippets.

View ptorru's full-sized avatar
🚀
Making it happen!

Pedro Torruella ptorru

🚀
Making it happen!
View GitHub Profile
@ptorru
ptorru / unstructured_octoai_example.py
Last active March 20, 2024 19:20
Using OctoAI's Embedding Encoder in Unstructured.io
import os
from unstructured.documents.elements import Text
from unstructured.embed.octoai import OctoAiEmbeddingConfig, OctoAIEmbeddingEncoder
embedding_encoder = OctoAIEmbeddingEncoder(
config=OctoAiEmbeddingConfig(api_key=os.environ["OCTOAI_API_KEY"])
)
elements = embedding_encoder.embed_documents(
elements=[Text("This is sentence 1"), Text("This is sentence 2")],