Skip to main content

AI-based assistance module plugin for ViUR

Project description

viur-assistant

Badge showing current PyPI version 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.0.0.tar.gz (14.9 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.0.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viur_assistant-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 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.0.0.tar.gz
Algorithm Hash digest
SHA256 37a068a6848e8b5906be64fac0c799bfd7119303d38ece13d23e99f233b2de89
MD5 b5ec950e3c15aaddf2e5f445fb6344c5
BLAKE2b-256 d095a5b091aec39938da8d5c6be4ace3e7f7e26ee908f09a55e05719c929c114

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: viur_assistant-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d02dd1662626228dc1c499c11739e4d3447ed9d883d3f6dd2676307b7dc6ba7
MD5 3aa81dfa34c1b6aee8b74a5f11d2727a
BLAKE2b-256 87e0a3997a100ccbf14929a8a78a952fbfee304aebfba23efc02586a0800f36c

See more details on using hashes here.

Provenance

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