Introduction

FastVecAI provides an efficient and straightforward Vectors as a Service (VaaS) solution. Our Python SDK allows users to convert text into high-dimensional vectors with ease. This book will guide you through the various functionalities provided by the FastVecAI Python SDK.

Installation

FastVecAI Python SDK can be installed through pip:

pip install fastvec

After installation, you can import the SDK in your Python scripts as follows:

from fastvec import FastVecAPI

Authentication

To use the FastVecAI service, you'll first need to authenticate your application. You can do this using the API key provided when you signed up for our service:

import jwt
from fastvec_api import FastVecAPI

api_key = "your-api-key"
api = FastVecAPI(api_key)

Remember to replace "your-api-key" with your actual API key.

Writing to the API

The write method allows you to send text to be vectorized by the FastVecAPI:

words = [
    "I like to eat apples",
    "I like to eat pears",
    "I like to eat bananas",
    "I like to eat oranges",
]

# write them to the API
for word in words:
    resp = api.write(word)
    print(resp)

The write method returns a response object which contains the status and message of the operation.

Reading from the API

The read method allows you to retrieve the vector representation of the text previously written to the FastVecAPI:

# read them back
for word in words:
    resp = api.read(word)
    print(resp)

The read method returns a response object which contains the status and the vector representation of the text.

Conclusion

The FastVecAI Python SDK provides a simple and efficient way to convert your text into high-dimensional vectors. With just a few lines of code, you can leverage the power of vector representations for your data. Explore further to unlock its full potential. This markdown book aims to offer a basic understanding of the FastVecAI Python SDK. For more detailed information, refer to the full API documentation.