SolarEmbeddings#
- class langchain_community.embeddings.solar.SolarEmbeddings[source]#
Bases:
BaseModel
,Embeddings
Deprecated since version 0.0.34: Use
langchain_upstage.ChatUpstage
instead.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 if the input data cannot be parsed to form a valid model.
- 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.
- Constraints:
type = string
writeOnly = True
format = password
- 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(text: str) List[List[float]] [source]#
- Parameters:
text (str) β
- Return type:
List[List[float]]
Examples using SolarEmbeddings