mixedbread.ai (https://www.mixedbread.ai)
Project description
mixedbread.ai Python SDK
Introduction to mixedbread.ai
mixedbread.ai is a cutting-edge research and development company specializing in Natural Language Processing (NLP). At our core, we focus on advancing the field of NLP through innovative research, offering powerful tools for embeddings, retrieval, and other NLP functionalities. Our mission is to make NLP accessible to everyone on every device. To learn more about mixedbread.ai, visit our website.
Requirements.
Please note that for now this SDK does not support synchronous requests. All requests are asynchronous and require Python 3.7+. If you need support for synchronous requests, please open an issue on GitHub.
Python 3.7+
asyncio
Installation & Usage
Installation
If the python package is hosted on a repository, you can install directly using:
pip install mixedbread_ai
Usage
from mixedbread_ai import MixedbreadAi
import os
os.environ["MIXEDBREADAI_API_KEY"] = "{YOUR_API_KEY}"
client = MixedbreadAi()
embeddings = await client.embeddings({
"texts": ["Hello world!", "How are you?"],
"model": "e5-large-v2"
})
print(embeddings)
Alternatively, you can set the api key via configuration:
from mixedbread_ai import MixedbreadAi
client = MixedbreadAi(
api_key="{YOUR_API_KEY}",
retries=3,
headers={"User-Agent": "mixedbread-ai-python-sdk"},
client_side_validation=False, # Speed up requests by disabling client side validation
)
embeddings = await client.embeddings({
"texts": "Hello world!",
"model": "e5-large-v2"
})
print(embeddings)
Don't forget to replace "{YOUR_API_KEY}"
with your actual API key. If you don't have an API key, you can get one for free by signing up for an account at mixedbread.ai.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mixedbread_ai-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e3b3ef2873fdc0e1834d8366ab88fe62fc8541699901445740a5b9d0d97e934 |
|
MD5 | f8ad13cac52aae628d389e86def6db56 |
|
BLAKE2b-256 | a4c7b5875b6ffa1a010e9fe2dd62f695069e41b713b30785d9bfe7895b8d7494 |