langchain.embeddings.octoai_embeddings.OctoAIEmbeddings¶
class langchain.embeddings.octoai_embeddings.OctoAIEmbeddings[source]¶
Bases: BaseModel, Embeddings
OctoAI Compute Service embedding models.
The environment variable OCTOAI_API_TOKEN should be set
with your API token, or it can be passed
as a named parameter to the constructor.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param embed_instruction: str = 'Represent this input: '¶
Instruction to use for embedding documents.
param endpoint_url: Optional[str] = None¶
Endpoint URL to use.
param model_kwargs: Optional[dict] = None¶
Keyword arguments to pass to the model.
param octoai_api_token: Optional[str] = None¶
OCTOAI API Token
param query_instruction: str = 'Represent the question for retrieving similar documents: '¶
Instruction to use for embedding query.
async aembed_documents(texts: List[str]) → List[List[float]]¶
Asynchronous Embed search docs.
async aembed_query(text: str) → List[float]¶
Asynchronous Embed query text.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values