Skip to main content

A package for handling GPT, embeddings, and data for an AI Assistant.

Project description

python version >= 3.10

Heroes AI Handler

Description

This package will handle all elements for an AI assistant, from ingesting data to using the GPT models.

Development

python3.10 -m venv .venv
pip install -r requirements.txt

Usage of the package

For using this package, a few environment variables are necessary to use certain functionalities of the package. For example, place them all in a .env file, and load them in using package python-dotenv:

from dotenv import load_dotenv
load_dotenv()

Full list of necessary variables:

Varibale name description
AZURE_OPENAI_ENDPOINT Endpoint to the Azure Open AI resource.
AZURE_OPENAI_API_KEY API-key to access the Azure Open AI resource.
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME Name of the deployment of the chat completion model.
AZURE_OPENAI_API_VERSION API-versie azure Open AI resource.
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME Name of the deployment of the embedding model.
WEVIATE_CLUSTER_ENDPOINT Endpoint to the Weaviate cluster.
WEVIATE_CLUSTER_API_KEY API-key to access the Weaviate cluster.
STORAGE_ACCOUNT_NAME Name of the Azure Storage Account.
STORAGE_ACCOUNT_KEY Key to the Azure Storage Account
STORAGE_ACCOUNT_CONTAINER_NAME Container name within the Azure Storage Account
SQL_SERVER_NAME SQL Server name.
SQL_DATABASE_NAME Database name within SQL Server.
SQL_USERNAME Username for accessing Database.
SQL_PASSWORD Password for accessing Database.
SQL_DRIVER Formulate SQL driver.

Manual actions

Create the following resources:

Azure

  • Azure OpenAI
    • Deploy chat completion model: gpt-3.5-turbo / gpt4
    • Deploy text embedding model: text-embedding-ada-002
  • Storage account
    • Create container
  • SQL server
    • Make sure you can access the SQL Server from the network configurations.
  • SQL database
    • To create tables in database, run: setup/1__create_database_tables.ipynb

Weaviate

  • Weaviate account with a cluster
    • To create collection in Weaviate cluster, run: setup/2__create_weaviate_collection.ipynb

Manual deployment of package

Only run this when automatical deployment through azure devops doesn't suit the purpose.

python3.10 -m venv .venv_publish
source .venv_publish/bin/activate
pip install wheel twine
rm -rf build dist *.egg-info
python setup.py sdist bdist_wheel
twine upload -u $(twineUsername) -p $(twinePassword) dist/*
rm -rf build dist *.egg-info

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

heroes_ai_handler-0.2.12.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heroes_ai_handler-0.2.12-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file heroes_ai_handler-0.2.12.tar.gz.

File metadata

  • Download URL: heroes_ai_handler-0.2.12.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for heroes_ai_handler-0.2.12.tar.gz
Algorithm Hash digest
SHA256 cb3653551f35979cbb19be9fbe11600b0a4b55e6106631efdd3b15d27422129c
MD5 0b92f1c4995934fba4e7ef2a0635aa36
BLAKE2b-256 211e524d84a6dfb6c72bd95adcc4399e466d9d221020e613554767298f0fa510

See more details on using hashes here.

File details

Details for the file heroes_ai_handler-0.2.12-py3-none-any.whl.

File metadata

File hashes

Hashes for heroes_ai_handler-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 95b2fbfd3cb24d1371bfe05e83fa5846413d78cf294757f737219b24c88317b0
MD5 55ee5a98aa53e212e626f3583432a61a
BLAKE2b-256 8a5c40cd0c0e5359f8266b6579e91b568e0d79820f92f51759776363806a8690

See more details on using hashes here.

Supported by

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