SolarEmbeddings#
- class langchain_community.embeddings.solar.SolarEmbeddings[source]#
Bases:
BaseModel
,Embeddings
Deprecated since version 0.0.34: Use
:class:`~langchain_upstage.ChatUpstage`
instead. It will be removed in None==1.0.Solarβs embedding service.
To use, you should have the environment variable``SOLAR_API_KEY`` set with your API token, or pass it as a named parameter to the constructor.
Example
from langchain_community.embeddings import SolarEmbeddings embeddings = SolarEmbeddings() query_text = "This is a test query." query_result = embeddings.embed_query(query_text) document_text = "This is a test document." document_result = embeddings.embed_documents([document_text])
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- param endpoint_url: str = 'https://api.upstage.ai/v1/solar/embeddings'#
Endpoint URL to use.
- param model: str = 'solar-1-mini-embedding-query'#
Embeddings model name to use.
- param solar_api_key: SecretStr | None = None#
API Key for Solar API.
- async aembed_documents(texts: list[str]) list[list[float]] #
Asynchronous Embed search docs.
- Parameters:
texts (list[str]) β List of text to embed.
- Returns:
List of embeddings.
- Return type:
list[list[float]]
- async aembed_query(text: str) list[float] #
Asynchronous Embed query text.
- Parameters:
text (str) β Text to embed.
- Returns:
Embedding.
- Return type:
list[float]
- embed_documents(texts: List[str]) List[List[float]] [source]#
Embed documents using a Solar embedding endpoint.
- Parameters:
texts (List[str]) β The list of texts to embed.
- Returns:
List of embeddings, one for each text.
- Return type:
List[List[float]]
Examples using SolarEmbeddings