Skip to content

Commit 37ae235

Browse files
added text ai wrapper interface
1 parent 1e8c742 commit 37ae235

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

doc/changes/unreleased.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Changes
44

5+
## Features
6+
7+
* #146: Add interface for text_ai_extension_wrapper
8+
59
## Security Issues
610

711
* #101: Updated bucketfs-python dependency to the version 1.0.0+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
from exasol.nb_connector.secret_store import Secrets
2+
from pathlib import Path
3+
4+
LANGUAGE_ALIAS = "PYTHON3_TXAIE"
5+
6+
LATEST_KNOWN_VERSION = "???"
7+
8+
def deploy_licence(conf: Secrets,
9+
licence_file: Path = None,
10+
licence_content: str = None) -> None:
11+
"""
12+
Deploys the given license and saves its identifier to the secret store. The licence can either be
13+
defined by a path pointing to a licence file, or by the licence content given as a string.
14+
Parameters:
15+
conf:
16+
The secret store.
17+
licence_file:
18+
Path of a licence file.
19+
licence_content:
20+
Content of a licence given as a string.
21+
22+
"""
23+
pass
24+
25+
def initialize_text_ai_extension(conf: Secrets,
26+
container_file: Path,
27+
version: str = LATEST_KNOWN_VERSION,
28+
language_alias: str = LANGUAGE_ALIAS,
29+
run_deploy_container: bool = True,
30+
run_deploy_scripts: bool = True,
31+
run_upload_models: bool = True,
32+
allow_override: bool = True) -> None:
33+
"""
34+
Depending on which flags are set, runs different steps to install Text-AI Extension in the DB.
35+
Possible steps:
36+
37+
* Call the Text-AI Extension's language container deployment API.
38+
Downloads the specified released version of the extension from ???
39+
and uploads it to the BucketFS.
40+
41+
This function doesn't activate the language container. Instead, it gets the
42+
activation SQL using the same API and writes it to the secret store. The name
43+
of the key is defined in the ACTIVATION_KEY constant.
44+
45+
* Install default transformers models into
46+
the Bucketfs using Transformers Extensions upload model functionality.
47+
48+
* Install Text-AI specific scripts.
49+
50+
Parameters:
51+
conf:
52+
The secret store. The store must contain the DB connection parameters
53+
and the parameters of the BucketFS service.
54+
container_file:
55+
Path pointing to the locally stored Script Language Container file for the Text-AI Extension.
56+
version:
57+
Text-AI extension version.
58+
language_alias:
59+
The language alias of the extension's language container.
60+
run_deploy_container:
61+
If True runs deployment of the locally stored Script Language Container file for the Text-AI Extension.
62+
run_deploy_scripts:
63+
If True runs deployment of Text-AI Extension scripts.
64+
run_upload_models:
65+
If True uploads default Transformers models to the BucketFS.
66+
allow_override:
67+
If True allows overriding the language definition.
68+
"""
69+
pass

0 commit comments

Comments
 (0)