Skip to main content

AI-based assistance module plugin for ViUR

Project description

viur-assistant

Badge showing current PyPI version Documentation Status Badge displaying the license

AI-based ViUR assistant plugin.

Usage

Install with pip

pip install viur-assistant

Install with pipenv

pipenv install viur-assistant

Register module

Import the Assistant module in the module loader in your project.

# deploy/modules/__init__.py
from viur.assistant import Assistant as assistant  # noqa

Note: the # noqa prevents your IDE from removing the import for refactorings, as this is considered unnecessary (in this file).

Configuration

Import the assistant CONFIG in your project and set up the API keys.

# deploy/main.py
from viur.core import secret
from viur.assistant import CONFIG as ASSISTANT_CONFIG

ASSISTANT_CONFIG.api_openai_key = "..."
ASSISTANT_CONFIG.api_anthropic_key = secret.get("api-anthropic-key")

Note: Using the Google Secret Manager is the more secure way. But of course the value can also be loaded from the env — as long as the value is provided as a string.

Development / Contributing

Create a fork and clone it

Setup & Run tests

  1. Install viur-assistant as editable in your project.
    cd my-project
    pip install -e path/to/viur-assistant[testing]
    cd path/to/viur-assistant
    
  2. Launch the local development server
  3. Get a valid session cookie and store it in the environment
    export SESSION_COOKIE="viur_cookie_$project=abc***xyz"
    
    This is necessary because the Assistant API is only accessible to admins.
  4. Run the tests with pytest
    pytest tests -s
    

Branches

Depending on what kind of change your Pull Request contains, please submit your PR against the following branches:

  • main: fixes/patches that fix a problem with existing code go into this branch.
  • develop: new features, refactorings, or adjustments for new versions of dependencies are added to this branch.

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

viur_assistant-1.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

viur_assistant-1.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file viur_assistant-1.1.0.tar.gz.

File metadata

  • Download URL: viur_assistant-1.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for viur_assistant-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b640ea1c1fd3e7c86e78eb6438432c7219e02882fa851d7a36614a64a10ec9a6
MD5 ed89c33aa0fdce54a854758ff29acb37
BLAKE2b-256 ff3b290353a953088d1bd32af597b74bcacff1333cbdb9cacd3d2a79ea05c1c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for viur_assistant-1.1.0.tar.gz:

Publisher: python-publish.yml on viur-framework/viur-assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file viur_assistant-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: viur_assistant-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for viur_assistant-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8b7fddf0f9b0f5a0f734784950bebfe7fd1709d37dfea512ef3bf0df308696
MD5 e3b7c2991be8697480f50d99cc63b138
BLAKE2b-256 12ba06b0ad24081ecc1d5f983db611f7eb9e84df02ac379e64c65128c409755b

See more details on using hashes here.

Provenance

The following attestation bundles were made for viur_assistant-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on viur-framework/viur-assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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