pip install viur-assistant
pipenv install viur-assistant
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).
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.
Create a fork and clone it
- 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
This is necessary because the Assistant API is only accessible to admins.
export SESSION_COOKIE="viur_cookie_$project=abc***xyz"
- Run the tests with pytest
pytest tests -s
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.