AI-based assistance module plugin for ViUR
Project description
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
- Install viur-assistant as editable in your project.
cd my-project pip install -e path/to/viur-assistant[testing] cd path/to/viur-assistant
- Launch the local development server
- 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. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37a068a6848e8b5906be64fac0c799bfd7119303d38ece13d23e99f233b2de89
|
|
| MD5 |
b5ec950e3c15aaddf2e5f445fb6344c5
|
|
| BLAKE2b-256 |
d095a5b091aec39938da8d5c6be4ace3e7f7e26ee908f09a55e05719c929c114
|
Provenance
The following attestation bundles were made for viur_assistant-1.0.0.tar.gz:
Publisher:
python-publish.yml on viur-framework/viur-assistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viur_assistant-1.0.0.tar.gz -
Subject digest:
37a068a6848e8b5906be64fac0c799bfd7119303d38ece13d23e99f233b2de89 - Sigstore transparency entry: 229028084
- Sigstore integration time:
-
Permalink:
viur-framework/viur-assistant@153ead5b31e25afc36888736bb8a4aed940ee810 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/viur-framework
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@153ead5b31e25afc36888736bb8a4aed940ee810 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d02dd1662626228dc1c499c11739e4d3447ed9d883d3f6dd2676307b7dc6ba7
|
|
| MD5 |
3aa81dfa34c1b6aee8b74a5f11d2727a
|
|
| BLAKE2b-256 |
87e0a3997a100ccbf14929a8a78a952fbfee304aebfba23efc02586a0800f36c
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viur_assistant-1.0.0-py3-none-any.whl -
Subject digest:
4d02dd1662626228dc1c499c11739e4d3447ed9d883d3f6dd2676307b7dc6ba7 - Sigstore transparency entry: 229028093
- Sigstore integration time:
-
Permalink:
viur-framework/viur-assistant@153ead5b31e25afc36888736bb8a4aed940ee810 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/viur-framework
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@153ead5b31e25afc36888736bb8a4aed940ee810 -
Trigger Event:
push
-
Statement type: