vermillio-sdk 0.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vermillio_sdk-0.0.6/.editorconfig +23 -0
- vermillio_sdk-0.0.6/.gitignore +179 -0
- vermillio_sdk-0.0.6/.gitlab-ci.yml +121 -0
- vermillio_sdk-0.0.6/.python-version +1 -0
- vermillio_sdk-0.0.6/PKG-INFO +76 -0
- vermillio_sdk-0.0.6/README.md +57 -0
- vermillio_sdk-0.0.6/config.yml +10 -0
- vermillio_sdk-0.0.6/docs/.pages +6 -0
- vermillio_sdk-0.0.6/docs/README.md +45 -0
- vermillio_sdk-0.0.6/docs/assets/scalar.html +21 -0
- vermillio_sdk-0.0.6/docs/guardrails/.pages +5 -0
- vermillio_sdk-0.0.6/docs/guardrails/api.md +13 -0
- vermillio_sdk-0.0.6/docs/guardrails/getting-started.md +65 -0
- vermillio_sdk-0.0.6/docs/guardrails/guardrails.json +1717 -0
- vermillio_sdk-0.0.6/docs/guardrails/reference.md +21 -0
- vermillio_sdk-0.0.6/docs/index.md +38 -0
- vermillio_sdk-0.0.6/docs/music/.pages +5 -0
- vermillio_sdk-0.0.6/docs/music/ai_detect.json +1078 -0
- vermillio_sdk-0.0.6/docs/music/api.md +14 -0
- vermillio_sdk-0.0.6/docs/music/getting-started.md +69 -0
- vermillio_sdk-0.0.6/docs/music/reference.md +27 -0
- vermillio_sdk-0.0.6/docs/pyproject.toml +33 -0
- vermillio_sdk-0.0.6/docs/sdk/.pages +7 -0
- vermillio_sdk-0.0.6/docs/sdk/asset-uploader.md +46 -0
- vermillio_sdk-0.0.6/docs/sdk/authentication.md +65 -0
- vermillio_sdk-0.0.6/docs/sdk/core-endpoints.md +93 -0
- vermillio_sdk-0.0.6/docs/sdk/getting-started.md +149 -0
- vermillio_sdk-0.0.6/docs/sdk/reference.md +10 -0
- vermillio_sdk-0.0.6/docs/uv.lock +1044 -0
- vermillio_sdk-0.0.6/mise.toml +5 -0
- vermillio_sdk-0.0.6/mkdocs.yml +101 -0
- vermillio_sdk-0.0.6/packages/core/.python-version +1 -0
- vermillio_sdk-0.0.6/packages/core/README.md +17 -0
- vermillio_sdk-0.0.6/packages/core/pyproject.toml +28 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/py.typed +0 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/__init__.py +2 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/__version__.py +2 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/clients/__init__.py +3 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/clients/assets.py +117 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/clients/base.py +255 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/clients/licensing.py +14 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/__init__.py +58 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/application.py +31 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/assets.py +146 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/auth.py +41 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/base.py +17 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/config.py +86 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/download.py +17 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/licensing.py +12 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/pipelines.py +46 -0
- vermillio_sdk-0.0.6/packages/core/src/vermillio/sdk/core/models/tracking.py +0 -0
- vermillio_sdk-0.0.6/packages/guardrails/README.md +38 -0
- vermillio_sdk-0.0.6/packages/guardrails/pyproject.toml +28 -0
- vermillio_sdk-0.0.6/packages/guardrails/src/vermillio/py.typed +0 -0
- vermillio_sdk-0.0.6/packages/guardrails/src/vermillio/sdk/guardrails/__init__.py +19 -0
- vermillio_sdk-0.0.6/packages/guardrails/src/vermillio/sdk/guardrails/client.py +119 -0
- vermillio_sdk-0.0.6/packages/guardrails/src/vermillio/sdk/guardrails/models.py +165 -0
- vermillio_sdk-0.0.6/packages/ml/.python-version +1 -0
- vermillio_sdk-0.0.6/packages/ml/README.md +3 -0
- vermillio_sdk-0.0.6/packages/ml/pyproject.toml +28 -0
- vermillio_sdk-0.0.6/packages/ml/src/vermillio/py.typed +0 -0
- vermillio_sdk-0.0.6/packages/ml/src/vermillio/sdk/ml/harness/__init__.py +2 -0
- vermillio_sdk-0.0.6/packages/music/README.md +39 -0
- vermillio_sdk-0.0.6/packages/music/pyproject.toml +28 -0
- vermillio_sdk-0.0.6/packages/music/src/vermillio/sdk/music/__init__.py +4 -0
- vermillio_sdk-0.0.6/packages/music/src/vermillio/sdk/music/ai_detect/__init__.py +11 -0
- vermillio_sdk-0.0.6/packages/music/src/vermillio/sdk/music/ai_detect/client.py +119 -0
- vermillio_sdk-0.0.6/packages/music/src/vermillio/sdk/music/ai_detect/models.py +29 -0
- vermillio_sdk-0.0.6/packages/music/src/vermillio/sdk/music/models.py +6 -0
- vermillio_sdk-0.0.6/publish.py +128 -0
- vermillio_sdk-0.0.6/pyproject.toml +65 -0
- vermillio_sdk-0.0.6/sync-openapi-specs.py +108 -0
- vermillio_sdk-0.0.6/tests/ai_detect-test.py +13 -0
- vermillio_sdk-0.0.6/tests/client-test.py +12 -0
- vermillio_sdk-0.0.6/tests/download_test.py +31 -0
- vermillio_sdk-0.0.6/tests/guardrails-test.py +10 -0
- vermillio_sdk-0.0.6/uv.lock +1842 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Check http://editorconfig.org for more information
|
|
2
|
+
# This is the main config file for this project:
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
charset = utf-8
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
indent_style = space
|
|
10
|
+
insert_final_newline = true
|
|
11
|
+
indent_size = 2
|
|
12
|
+
|
|
13
|
+
[*.{py,pyi}]
|
|
14
|
+
indent_size = 4
|
|
15
|
+
|
|
16
|
+
[*.snap]
|
|
17
|
+
trim_trailing_whitespace = false
|
|
18
|
+
|
|
19
|
+
[*.md]
|
|
20
|
+
max_line_length = 100
|
|
21
|
+
|
|
22
|
+
[*.toml]
|
|
23
|
+
indent_size = 4
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Created by https://www.toptal.com/developers/gitignore/api/python
|
|
2
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
|
3
|
+
|
|
4
|
+
### Python ###
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
|
|
10
|
+
# C extensions
|
|
11
|
+
*.so
|
|
12
|
+
|
|
13
|
+
# Distribution / packaging
|
|
14
|
+
.Python
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
.eggs/
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
sdist/
|
|
25
|
+
var/
|
|
26
|
+
wheels/
|
|
27
|
+
share/python-wheels/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
MANIFEST
|
|
32
|
+
|
|
33
|
+
# PyInstaller
|
|
34
|
+
# Usually these files are written by a python script from a template
|
|
35
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# Installer logs
|
|
40
|
+
pip-log.txt
|
|
41
|
+
pip-delete-this-directory.txt
|
|
42
|
+
|
|
43
|
+
# Unit test / coverage reports
|
|
44
|
+
htmlcov/
|
|
45
|
+
.tox/
|
|
46
|
+
.nox/
|
|
47
|
+
.coverage
|
|
48
|
+
.coverage.*
|
|
49
|
+
.cache
|
|
50
|
+
nosetests.xml
|
|
51
|
+
coverage.xml
|
|
52
|
+
*.cover
|
|
53
|
+
*.py,cover
|
|
54
|
+
.hypothesis/
|
|
55
|
+
.pytest_cache/
|
|
56
|
+
cover/
|
|
57
|
+
|
|
58
|
+
# Translations
|
|
59
|
+
*.mo
|
|
60
|
+
*.pot
|
|
61
|
+
|
|
62
|
+
# Django stuff:
|
|
63
|
+
*.log
|
|
64
|
+
local_settings.py
|
|
65
|
+
db.sqlite3
|
|
66
|
+
db.sqlite3-journal
|
|
67
|
+
|
|
68
|
+
# Flask stuff:
|
|
69
|
+
instance/
|
|
70
|
+
.webassets-cache
|
|
71
|
+
|
|
72
|
+
# Scrapy stuff:
|
|
73
|
+
.scrapy
|
|
74
|
+
|
|
75
|
+
# Sphinx documentation
|
|
76
|
+
docs/_build/
|
|
77
|
+
|
|
78
|
+
# PyBuilder
|
|
79
|
+
.pybuilder/
|
|
80
|
+
target/
|
|
81
|
+
|
|
82
|
+
# Jupyter Notebook
|
|
83
|
+
.ipynb_checkpoints
|
|
84
|
+
|
|
85
|
+
# IPython
|
|
86
|
+
profile_default/
|
|
87
|
+
ipython_config.py
|
|
88
|
+
|
|
89
|
+
# pyenv
|
|
90
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
91
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
92
|
+
# .python-version
|
|
93
|
+
|
|
94
|
+
# pipenv
|
|
95
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
96
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
97
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
98
|
+
# install all needed dependencies.
|
|
99
|
+
#Pipfile.lock
|
|
100
|
+
|
|
101
|
+
# poetry
|
|
102
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
103
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
104
|
+
# commonly ignored for libraries.
|
|
105
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
106
|
+
#poetry.lock
|
|
107
|
+
|
|
108
|
+
# pdm
|
|
109
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
110
|
+
#pdm.lock
|
|
111
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
112
|
+
# in version control.
|
|
113
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
114
|
+
.pdm.toml
|
|
115
|
+
|
|
116
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
117
|
+
__pypackages__/
|
|
118
|
+
|
|
119
|
+
# Celery stuff
|
|
120
|
+
celerybeat-schedule
|
|
121
|
+
celerybeat.pid
|
|
122
|
+
|
|
123
|
+
# SageMath parsed files
|
|
124
|
+
*.sage.py
|
|
125
|
+
|
|
126
|
+
# Environments
|
|
127
|
+
.env
|
|
128
|
+
.venv
|
|
129
|
+
env/
|
|
130
|
+
venv/
|
|
131
|
+
ENV/
|
|
132
|
+
env.bak/
|
|
133
|
+
venv.bak/
|
|
134
|
+
|
|
135
|
+
# Spyder project settings
|
|
136
|
+
.spyderproject
|
|
137
|
+
.spyproject
|
|
138
|
+
|
|
139
|
+
# Rope project settings
|
|
140
|
+
.ropeproject
|
|
141
|
+
|
|
142
|
+
# mkdocs documentation
|
|
143
|
+
/site
|
|
144
|
+
|
|
145
|
+
# mypy
|
|
146
|
+
.mypy_cache/
|
|
147
|
+
.dmypy.json
|
|
148
|
+
dmypy.json
|
|
149
|
+
|
|
150
|
+
# Pyre type checker
|
|
151
|
+
.pyre/
|
|
152
|
+
|
|
153
|
+
# pytype static type analyzer
|
|
154
|
+
.pytype/
|
|
155
|
+
|
|
156
|
+
# Cython debug symbols
|
|
157
|
+
cython_debug/
|
|
158
|
+
|
|
159
|
+
# PyCharm
|
|
160
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
161
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
162
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
163
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
164
|
+
#.idea/
|
|
165
|
+
|
|
166
|
+
### Python Patch ###
|
|
167
|
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
168
|
+
poetry.toml
|
|
169
|
+
|
|
170
|
+
# ruff
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# LSP config files
|
|
174
|
+
pyrightconfig.json
|
|
175
|
+
|
|
176
|
+
# End of https://www.toptal.com/developers/gitignore/api/python
|
|
177
|
+
|
|
178
|
+
.uv-cache
|
|
179
|
+
public/
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- build
|
|
3
|
+
- deploy
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
default:
|
|
7
|
+
image: python:3.9
|
|
8
|
+
before_script:
|
|
9
|
+
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
10
|
+
- export PATH="$HOME/.local/bin:$PATH"
|
|
11
|
+
|
|
12
|
+
variables:
|
|
13
|
+
UV_CACHE_DIR: ".uv-cache"
|
|
14
|
+
UV_SYSTEM_PYTHON: 1
|
|
15
|
+
GIT_DEPTH: 0
|
|
16
|
+
|
|
17
|
+
cache:
|
|
18
|
+
paths:
|
|
19
|
+
- .uv-cache
|
|
20
|
+
|
|
21
|
+
build:
|
|
22
|
+
stage: build
|
|
23
|
+
script:
|
|
24
|
+
- uv run publish.py --no-publish
|
|
25
|
+
- uv sync --group docs
|
|
26
|
+
- export BUILD_DATE=$(date -u +"%Y-%m-%d %H:%M UTC")
|
|
27
|
+
- export SITE_VERSION=${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}
|
|
28
|
+
- BUILD_DATE="$BUILD_DATE" VERSION="$SITE_VERSION" uv run mkdocs build --site-dir public
|
|
29
|
+
- echo "Review docs at https://vermillio-public.gitlab.io/-/vermillio-sdk/-/jobs/${CI_JOB_ID}/artifacts/public/index.html"
|
|
30
|
+
artifacts:
|
|
31
|
+
expire_in: 1 week
|
|
32
|
+
paths:
|
|
33
|
+
- dist
|
|
34
|
+
- public
|
|
35
|
+
environment:
|
|
36
|
+
name: docs/$CI_COMMIT_REF_SLUG
|
|
37
|
+
url: https://vermillio-public.gitlab.io/-/vermillio-sdk/-/jobs/${CI_JOB_ID}/artifacts/public/index.html
|
|
38
|
+
|
|
39
|
+
deploy:pages:
|
|
40
|
+
stage: deploy
|
|
41
|
+
dependencies: [build]
|
|
42
|
+
rules:
|
|
43
|
+
- if: $CI_COMMIT_REF_PROTECTED == "true"
|
|
44
|
+
when: manual
|
|
45
|
+
- when: never
|
|
46
|
+
script:
|
|
47
|
+
- echo "Docs available at https://docs.vermill.io"
|
|
48
|
+
pages: true
|
|
49
|
+
environment:
|
|
50
|
+
name: docs
|
|
51
|
+
url: https://docs.vermill.io
|
|
52
|
+
|
|
53
|
+
deploy:gitlab:
|
|
54
|
+
stage: deploy
|
|
55
|
+
dependencies: [build]
|
|
56
|
+
variables:
|
|
57
|
+
UV_PUBLISH_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi"
|
|
58
|
+
UV_PUBLISH_USERNAME: "gitlab-ci-token"
|
|
59
|
+
UV_PUBLISH_PASSWORD: "${CI_JOB_TOKEN}"
|
|
60
|
+
script:
|
|
61
|
+
- uv run publish.py --publish --no-build --no-version
|
|
62
|
+
- echo "Deployed to https://gitlab.com/vermillio-public/vermillio-sdk/-/packages"
|
|
63
|
+
rules:
|
|
64
|
+
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
|
|
65
|
+
when: manual
|
|
66
|
+
- when: never
|
|
67
|
+
environment:
|
|
68
|
+
name: gitlab
|
|
69
|
+
url: https://gitlab.com/vermillio-public/vermillio-sdk/-/packages
|
|
70
|
+
|
|
71
|
+
deploy:pypi:
|
|
72
|
+
stage: deploy
|
|
73
|
+
dependencies: [build]
|
|
74
|
+
variables:
|
|
75
|
+
UV_PUBLISH_TOKEN: $PYPI_TOKEN
|
|
76
|
+
script:
|
|
77
|
+
- uv run publish.py --publish --no-build --no-version
|
|
78
|
+
- echo "Deployed to https://pypi.org/org/vermillio/"
|
|
79
|
+
rules:
|
|
80
|
+
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
|
|
81
|
+
when: manual
|
|
82
|
+
- when: never
|
|
83
|
+
environment:
|
|
84
|
+
name: pypi
|
|
85
|
+
url: https://pypi.org/org/vermillio/
|
|
86
|
+
|
|
87
|
+
deploy:dry-run:
|
|
88
|
+
stage: deploy
|
|
89
|
+
dependencies: [build]
|
|
90
|
+
script:
|
|
91
|
+
- uv run publish.py --publish --no-build --no-version --dry-run --verbose
|
|
92
|
+
rules:
|
|
93
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
94
|
+
when: never
|
|
95
|
+
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"
|
|
96
|
+
when: never
|
|
97
|
+
- when: manual
|
|
98
|
+
|
|
99
|
+
# Given sdk lives in vermillio-public and not included in our gitlab plan we can't use parallel deployments
|
|
100
|
+
# create-pages:
|
|
101
|
+
# variables:
|
|
102
|
+
# PAGES_PREFIX: "" # no prefix by default (run on the default branch)
|
|
103
|
+
# before_script:
|
|
104
|
+
# - curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
105
|
+
# - export PATH="$HOME/.local/bin:$PATH"
|
|
106
|
+
# script:
|
|
107
|
+
# - uv sync --group docs
|
|
108
|
+
# - uv run mkdocs build --site-dir public
|
|
109
|
+
# pages: # specifies that this is a Pages job and publishes the default public directory
|
|
110
|
+
# path_prefix: "$PAGES_PREFIX"
|
|
111
|
+
# environment:
|
|
112
|
+
# name: "Pages ${PAGES_PREFIX}"
|
|
113
|
+
# url: $CI_PAGES_URL
|
|
114
|
+
# rules:
|
|
115
|
+
# - if: $CI_COMMIT_BRANCH != "main" # ensure to run on the default branch (with default PAGES_PREFIX)
|
|
116
|
+
# variables:
|
|
117
|
+
# PAGES_PREFIX: "$CI_COMMIT_BRANCH"
|
|
118
|
+
# - if: $CI_PIPELINE_SOURCE == "merge_request_event" # conditionally change the prefix on Merge Requests
|
|
119
|
+
# when: manual # run pages manually on Merge Requests
|
|
120
|
+
# variables:
|
|
121
|
+
# PAGES_PREFIX: 'mr-$CI_MERGE_REQUEST_IID' # prefix with the mr-<iid>, like `mr-123`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.9
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vermillio-sdk
|
|
3
|
+
Version: 0.0.6
|
|
4
|
+
Summary: SDKs for interacting with Vermillio's various APIs.
|
|
5
|
+
Project-URL: Homepage, https://vermill.io
|
|
6
|
+
Project-URL: Documentation, https://docs.vermill.io
|
|
7
|
+
Project-URL: Repository, https://gitlab.com/vermillio-public/vermillio-sdk.git
|
|
8
|
+
Project-URL: Issues, https://gitlab.com/vermillio-public/vermillio-sdk/-/issues
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Requires-Dist: tqdm>=4.67.1
|
|
11
|
+
Requires-Dist: vermillio-core-sdk==0.0.6
|
|
12
|
+
Provides-Extra: guardrails
|
|
13
|
+
Requires-Dist: vermillio-guardrails-sdk==0.0.6; extra == 'guardrails'
|
|
14
|
+
Provides-Extra: ml
|
|
15
|
+
Requires-Dist: vermillio-ml-sdk==0.0.6; extra == 'ml'
|
|
16
|
+
Provides-Extra: music
|
|
17
|
+
Requires-Dist: vermillio-music-sdk==0.0.6; extra == 'music'
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Vermillio SDK
|
|
21
|
+
|
|
22
|
+
Entrypoint for Vermillio's various SDK's for interacting with Vermillio API's.
|
|
23
|
+
|
|
24
|
+
## Guardrails SDK
|
|
25
|
+
|
|
26
|
+
### Installing
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install vermillio-sdk[guardrails]
|
|
30
|
+
uv add vermillio-sdk[guardrails]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Getting Started
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from vermillio.sdk.guardrails import VermillioGuardrails, GuardrailsExternalSource
|
|
38
|
+
|
|
39
|
+
client = VermillioGuardrails()
|
|
40
|
+
|
|
41
|
+
sources = [
|
|
42
|
+
GuardrailsExternalSource(
|
|
43
|
+
prompt="Write a song about a flying hero from Krypton.",
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
results = client.run_results(sources)
|
|
48
|
+
if results:
|
|
49
|
+
first = results[0]
|
|
50
|
+
print(first.summary)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Music SDK
|
|
54
|
+
|
|
55
|
+
### Installing
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install vermillio-sdk[music]
|
|
59
|
+
uv add vermillio-sdk[music]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Getting Started
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from vermillio.sdk.music import VermillioMusicAIDetect, AIDetectExternalSource
|
|
66
|
+
|
|
67
|
+
ai_detect = VermillioMusicAIDetect()
|
|
68
|
+
result = next(iter(ai_detect.run_results([
|
|
69
|
+
AIDetectExternalSource(path="https://example.com/track.wav"),
|
|
70
|
+
] or [])), None)
|
|
71
|
+
|
|
72
|
+
if result and result.status == 'Succeeded':
|
|
73
|
+
for detection in result.results.detections:
|
|
74
|
+
confidence = f"({detection.confidence:0.2f})" if detection.confidence else "--"
|
|
75
|
+
print(f"[{detection.query_segment.start:0.2f}-{detection.query_segment.end:0.2f}] {segment.label} {confidence}")
|
|
76
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Vermillio SDK
|
|
2
|
+
|
|
3
|
+
Entrypoint for Vermillio's various SDK's for interacting with Vermillio API's.
|
|
4
|
+
|
|
5
|
+
## Guardrails SDK
|
|
6
|
+
|
|
7
|
+
### Installing
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install vermillio-sdk[guardrails]
|
|
11
|
+
uv add vermillio-sdk[guardrails]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Getting Started
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from vermillio.sdk.guardrails import VermillioGuardrails, GuardrailsExternalSource
|
|
19
|
+
|
|
20
|
+
client = VermillioGuardrails()
|
|
21
|
+
|
|
22
|
+
sources = [
|
|
23
|
+
GuardrailsExternalSource(
|
|
24
|
+
prompt="Write a song about a flying hero from Krypton.",
|
|
25
|
+
)
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
results = client.run_results(sources)
|
|
29
|
+
if results:
|
|
30
|
+
first = results[0]
|
|
31
|
+
print(first.summary)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Music SDK
|
|
35
|
+
|
|
36
|
+
### Installing
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install vermillio-sdk[music]
|
|
40
|
+
uv add vermillio-sdk[music]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Getting Started
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from vermillio.sdk.music import VermillioMusicAIDetect, AIDetectExternalSource
|
|
47
|
+
|
|
48
|
+
ai_detect = VermillioMusicAIDetect()
|
|
49
|
+
result = next(iter(ai_detect.run_results([
|
|
50
|
+
AIDetectExternalSource(path="https://example.com/track.wav"),
|
|
51
|
+
] or [])), None)
|
|
52
|
+
|
|
53
|
+
if result and result.status == 'Succeeded':
|
|
54
|
+
for detection in result.results.detections:
|
|
55
|
+
confidence = f"({detection.confidence:0.2f})" if detection.confidence else "--"
|
|
56
|
+
print(f"[{detection.query_segment.start:0.2f}-{detection.query_segment.end:0.2f}] {segment.label} {confidence}")
|
|
57
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Docs
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Ref: https://vermillio.atlassian.net/wiki/spaces/~486166302/pages/1320353828/Vermillio+SDK+Documentation
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
https://www.mkdocs.org/getting-started/
|
|
8
|
+
|
|
9
|
+
uv sync --group docs
|
|
10
|
+
|
|
11
|
+
uv run mkdocs build
|
|
12
|
+
uv run mkdocs serve
|
|
13
|
+
mkdocs serve
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
mkdocs build
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
- Ray: https://docs.ray.io/
|
|
22
|
+
- DVC (Data Version Control): https://dvc.org/doc
|
|
23
|
+
- Poetry: https://python-poetry.org/docs/
|
|
24
|
+
- MkDocs Awesome Pages Plugin: https://lukasgeiter.github.io/mkdocs-awesome-pages-plugin/
|
|
25
|
+
- Home Assistant Developer Docs: https://developers.home-assistant.io/
|
|
26
|
+
- OpenFaaS: https://docs.openfaas.com/
|
|
27
|
+
- FastAPI: https://fastapi.tiangolo.com/
|
|
28
|
+
- Pydantic: https://docs.pydantic.dev/
|
|
29
|
+
- MKDocs Material: https://squidfunk.github.io/mkdocs-material/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Investigate
|
|
33
|
+
|
|
34
|
+
- https://zensical.org/
|
|
35
|
+
- OpenAPI spec integration for interactive API
|
|
36
|
+
- Docusaurus
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## OpenAPI integration
|
|
40
|
+
|
|
41
|
+
Using Scalar
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx @redocly/cli@latest join ./docs/openapi_specs/external-api.yaml ./docs/openapi_specs/petstore.yaml -o ./docs/openapi_specs/combined.yaml
|
|
45
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>API Reference</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<style>
|
|
8
|
+
body { margin: 0; padding: 0; }
|
|
9
|
+
</style>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<script
|
|
13
|
+
id="api-reference"
|
|
14
|
+
data-url="../openapi_specs/guardrails.json"
|
|
15
|
+
|
|
16
|
+
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"
|
|
17
|
+
></script>
|
|
18
|
+
</body>
|
|
19
|
+
<!-- data-proxy-url="https://proxy.scalar.com" -->
|
|
20
|
+
</html>
|
|
21
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
hide:
|
|
3
|
+
- toc
|
|
4
|
+
title: API Reference
|
|
5
|
+
---
|
|
6
|
+
# Guardrails API Reference
|
|
7
|
+
|
|
8
|
+
<!-- <iframe
|
|
9
|
+
src="../assets/scalar.html"
|
|
10
|
+
style="width:100%; height:800px; border:none; overflow:hidden;" scrolling="no"
|
|
11
|
+
></iframe> -->
|
|
12
|
+
|
|
13
|
+
<swagger-ui src="./guardrails.json"/>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Guardrails SDK
|
|
6
|
+
<!-- [](https://gitlab.com/vermillio-public/vermillio-sdk/-/commits/main)
|
|
7
|
+
[](https://pypi.python.org/pypi/vermillio-sdk) -->
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Vermillio Guardrails SDK is published as a Python package and can be installed ideally within a virtual environment. Vermillio Guardrails SDK requires __Python 3.9+__.
|
|
12
|
+
|
|
13
|
+
<!-- === "pip"
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install vermillio-sdk[guardrails]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
=== "uv"
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv add vermillio-sdk[guardrails]
|
|
23
|
+
``` -->
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/// tab | pip
|
|
27
|
+
```bash
|
|
28
|
+
pip install vermillio-sdk[guardrails]
|
|
29
|
+
```
|
|
30
|
+
///
|
|
31
|
+
|
|
32
|
+
/// tab | uv
|
|
33
|
+
```bash
|
|
34
|
+
uv add vermillio-sdk[guardrails]
|
|
35
|
+
```
|
|
36
|
+
///
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
The client loads credentials from environment variables by default:
|
|
41
|
+
|
|
42
|
+
- `VERMILLIO_SDK_CLIENT_ID` : Client id provided by Vermillio
|
|
43
|
+
- `VERMILLIO_SDK_CLIENT_SECRET` : Client secret provided by Vermillio
|
|
44
|
+
|
|
45
|
+
For full documentation, see [Authentication](../sdk/authentication.md#sdk-authentication) for a more detailed description.
|
|
46
|
+
|
|
47
|
+
## Initialization
|
|
48
|
+
|
|
49
|
+
All of the classes for Guardrails SDK live under `vermillio.sdk.guardrails`. Here is an example usage:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from vermillio.sdk.guardrails import VermillioGuardrails, GuardrailsExternalSource
|
|
53
|
+
|
|
54
|
+
guardrails = VermillioGuardrails() # The default behavior is to pull from env
|
|
55
|
+
# alternatively a VermillioConfig class can be provided
|
|
56
|
+
# guardrails = VermillioGuardrails(VermillioConfig.credentials(client_id, client_secret))
|
|
57
|
+
|
|
58
|
+
result = next(iter(guardrails.run_results([
|
|
59
|
+
GuardrailsExternalSource(prompt="Write a song about a flying hero from Krypton.", lyrics="Hit me baby one more time.")
|
|
60
|
+
] or []), None)
|
|
61
|
+
|
|
62
|
+
if result and result.status == 'Succeeded':
|
|
63
|
+
print(f"Recommended action: {result.action}")
|
|
64
|
+
print(f"Identified profiles: {result.summary.profiles}")
|
|
65
|
+
```
|