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.2.0.tar.gz (16.6 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.2.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viur_assistant-1.2.0.tar.gz
  • Upload date:
  • Size: 16.6 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.2.0.tar.gz
Algorithm Hash digest
SHA256 4fb243178a6512bc47d0c521f6c54ad6588f57f3c4e95b9a8940438f55d22bdf
MD5 13ed06b4da9a5052c002ec1cafbd8cd9
BLAKE2b-256 998cdf90caa19602287861ef130da88fbde2f4242197adbd61a40856416b62e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for viur_assistant-1.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: viur_assistant-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24c7c87338a1617b259bdd5fc1fc979a1bf3038dd69391c7164b360c2d3c8f1a
MD5 8adcaac7a41ed3ba18854baf23af7a8c
BLAKE2b-256 7a8c38afbddb240be729d043dc2c1dd22eb4a0a96710655cbbb2312fbd838e36

See more details on using hashes here.

Provenance

The following attestation bundles were made for viur_assistant-1.2.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