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-0.0.0.dev6.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-0.0.0.dev6-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file viur_assistant-0.0.0.dev6.tar.gz.

File metadata

  • Download URL: viur_assistant-0.0.0.dev6.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-0.0.0.dev6.tar.gz
Algorithm Hash digest
SHA256 fbb95c616b24cc70e9be8306e859ccffc56755f800d1346cdd761683067b554f
MD5 1c3bc80196b213967f523de930ae56d4
BLAKE2b-256 ddb22f51173ec83656546cd5dcf7e714f517144836bf184782f3bf0c23b3b7f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for viur_assistant-0.0.0.dev6-py3-none-any.whl
Algorithm Hash digest
SHA256 dad5b46e282a1cd8a1c652eef02e30ee7c6689c23e7e346857ddf7d40d818308
MD5 6a0e2ed56099d23f477f8628a73c3f82
BLAKE2b-256 fa8d25ed9bd24faf07a78e3af70ebe32c9d49dc081de4c76b6f75929a20fdc88

See more details on using hashes here.

Provenance

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