Skip to main content

Vantage Python SDK.

Project description


Vantage Discovery Python SDK

The Vantage Discovery Python SDK provides an easy-to-use interface to interact with the Vantage vector database, enabling developers to seamlessly integrate vector search and collection management capabilities into their Python applications.

Installation

To install the Vantage Python SDK, run the following command:

pip install vantage-sdk

Quickstart

To get started with the Vantage Python SDK, you'll need to set up your Vantage account and obtain your account ID and Vantage API key. Once you have your ID and key, you can initialize the VantageClient which you can then use to manage your account, collections and keys and perform searches.

from vantage_sdk import VantageClient

# Initialize the VantageClient with your Vantage API key and Account ID
vantage_client = VantageClient.using_vantage_api_key(
    vantage_api_key='YOUR_VANTAGE_API_KEY',
    account_id='YOUR_ACCOUNT_ID'
)

# Now you can use the client to manage collections, documents, and perform searches

Overview

The Vantage Discovery Python SDK is divided into several modules, allowing you to manage account, collections, and API keys, as well as perform various types of searches.

Key Features

  • Collection Management: Easily create, update, list, and delete collections.
  • Documents Upload: Upload your data easily to your collections.
  • Search: Perform semantic, embedding and "more like this/these" searches within your collections.
  • LLM Keys Management: Keep your LLM provider secrets safe and up-to-date.

🔍 Examples

Creating a Collection

To create a new collection for storing documents, specify the collection ID, the dimension of the embeddings, and the LLM (language learning model) details. Here, we use text-embedding-ada-002 from OpenAI with the necessary secret key.

📚 Visit management-api documentation for more details.

collection = OpenAICollection(
    collection_id="my-collection",
    embeddings_dimension=1536,
    llm="text-embedding-ada-002",
    llm_secret="YOUR_OPENAI_SECRET_KEY",
)

created_collection = vantage_client.create_collection(collection=collection)

print(f"Created collection: {created_collection.collection_name}")

Uploading Documents

To upload documents to your collection, provide a list of document IDs and corresponding text. Each document is wrapped in a VantageManagedEmbeddingsDocument object. This example demonstrates uploading a batch of documents.

📚 Visit management-api documentation for more details.

ids = [
    "1",
    "2",
    "3",
    "4",
]

texts = [
    "First text",
    "Second text",
    "Third text",
    "Fourth text",
]

documents = [
    VantageManagedEmbeddingsDocument(text=text, id=id)
    for id, text in zip(ids, texts)
]

instance.upsert_documents(
    collection_id="my-collection",
    documents=documents,
)

Performing a Search

To perform a semantic search within your collection, specify the text you want to find similar documents for. This example retrieves documents similar to the provided text, printing out each document's ID and its similarity score.

📚 Visit search-api documentation for more details.

search_result = vantage_client.semantic_search(
    text="Find documents similar to this text",
    collection_id="my-collection"
)
for result in search_result.results:
    print(result.id, result.score)

📚 Documentation

For detailed documentation on all methods and their parameters, please refer to the Vantage Discovery official documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vantage_sdk-0.8.7.tar.gz (153.4 kB view details)

Uploaded Source

Built Distribution

vantage_sdk-0.8.7-py3-none-any.whl (118.3 kB view details)

Uploaded Python 3

File details

Details for the file vantage_sdk-0.8.7.tar.gz.

File metadata

  • Download URL: vantage_sdk-0.8.7.tar.gz
  • Upload date:
  • Size: 153.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.14 Linux/6.5.0-1022-azure

File hashes

Hashes for vantage_sdk-0.8.7.tar.gz
Algorithm Hash digest
SHA256 3d5a67f5aec30b70dc70f7bbb754a358ff0096db54c27ab11f43cd090a44d455
MD5 95574eca1e55285c8439b8f358d2dd6a
BLAKE2b-256 a37283f173813b9020fc0d879d531c04decc5f6c485ae07ce1dd30ec8b23768f

See more details on using hashes here.

File details

Details for the file vantage_sdk-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: vantage_sdk-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 118.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.14 Linux/6.5.0-1022-azure

File hashes

Hashes for vantage_sdk-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 37af42c237bc506613199817f7527f6752454eaaecb65dd88740a9d61fccf499
MD5 f2d7361aba2e52a87521f11c36e44e9f
BLAKE2b-256 25b74c668abbd0d14d2ebea297d90a229dc25588ef6881e9ed9535f17dcd7350

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page