AsyncOpenAITextEmbedEmbeddingClient#
- class langchain_community.embeddings.textembed.AsyncOpenAITextEmbedEmbeddingClient(host: str = 'http://localhost:8000/v1', api_key: str | None = None, aiosession: ClientSession | None = None)[source]#
A client to handle synchronous and asynchronous requests to the TextEmbed API.
- Parameters:
host (str) –
api_key (str | None) –
aiosession (ClientSession | None) –
- host#
The base URL for the TextEmbed API.
- Type:
str
- api_key#
The API key for authenticating with the TextEmbed API.
- Type:
str
- aiosession#
The aiohttp session for async requests.
- Type:
Optional[aiohttp.ClientSession]
- _batch_size#
Maximum batch size for a single request.
- Type:
int
Methods
__init__
([host, api_key, aiosession])aembed
(model, texts)Embeds a list of texts asynchronously.
embed
(model, texts)Embeds a list of texts synchronously.
- __init__(host: str = 'http://localhost:8000/v1', api_key: str | None = None, aiosession: ClientSession | None = None) None [source]#
- Parameters:
host (str) –
api_key (str | None) –
aiosession (ClientSession | None) –
- Return type:
None