This is a python wrapper client for FaVe
Fave-Client is a Python-based client library designed to interact with the FaVe API. This project aims to simplify the process of making API calls to FaVe, providing a seamless and efficient way to manage collections and documents.
- Easy-to-use API client for FaVe
- Supports all CRUD operations for collections and documents
- Built-in error handling
- Configurable settings
- Python 3.x
requests
library- FaVe instance
Clone the repository and navigate to the project directory:
git clone https://github.com/fairDataSociety/fave-client.git
cd fave-client
Install the required dependencies:
pip install -r requirements.txt
from fave_api import APIClient
client = APIClient()
client.create_collection("my_collection")
from fave import FaVe
_fave = FaVe(url)
try:
_fave.create_collection(collection, [])
except ApiException as e:
raise Exception("%s\n" % e)
from fave import FaVe
_fave = FaVe(url)
embeddings: Optional[List[List[float]]] = None
properties_to_vectorize = ["text"]
documents = []
for i, text in enumerate(texts):
data_properties = {"text": text}
data_properties["vector"] = embeddings[i] if embeddings else None
_id = str(uuid.uuid4())
document = fave_api.Document()
document.properties = data_properties
document.id = _id
documents.append(document)
try:
_fave.add_documents(collection, documents, properties_to_vectorize)
except ApiException as e:
raise Exception("%s\n" % e)
from fave import FaVe
_fave = FaVe(url)
try:
_fave.get_nearest_documents(collection, query, number_of_docs, max_distance)
except ApiException as e:
raise Exception("%s\n" % e)
For a detailed API reference, please visit FaVe API Documentation.
You can configure the API client using the configuration.py
file. Here you can set API endpoints, authentication details, and other settings.
If you encounter issues, please check the following:
- Make sure all prerequisites are installed.
- Ensure you have the correct API endpoint in
configuration.py
.
To report bugs or issues, please open an issue on GitHub.
We welcome contributions!
# Clone and navigate
git clone https://github.com/fairDataSociety/fave-client.git
cd fave-client
# Install dependencies
pip install -r dev-requirements.txt
No tests yet.
This is first release.
This project is licensed under the AGPL License.
- Thanks to @asabya @fairdatasociety @datafund and @ethswarm.
For more information or for contributions, please contact us at.