sunholo 0.76.5__tar.gz → 0.76.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.
- {sunholo-0.76.5 → sunholo-0.76.6}/PKG-INFO +2 -2
- {sunholo-0.76.5 → sunholo-0.76.6}/setup.py +1 -1
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/auth/run.py +3 -3
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/vertex.py +3 -4
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/vertex/extensions_class.py +46 -30
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.76.5 → sunholo-0.76.6}/LICENSE.txt +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/MANIFEST.in +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/README.md +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/setup.cfg +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/flask/vac_routes.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/langserve.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/route.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/agents/swagger.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/archive/archive.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/auth/gcloud.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/auth/refresh.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/azure/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/azure/event_grid.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/bots/discord.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/azure.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/images.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/process_chunker_data.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/publish.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/pubsub.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/chat_vac.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/cli.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/configs.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/embedder.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/cli/swagger.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/components/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/components/llm.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/components/retriever.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/alloydb.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/alloydb_client.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/database.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/lancedb.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/database/uuid.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/discovery_engine/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/discovery_engine/chunker_handler.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/discovery_engine/create_new.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/discovery_engine/discovery_engine_client.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/invoke/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/invoke/invoke_vac_utils.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/llamaindex/generate.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/logging.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/patches/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/qna/parsers.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/qna/retry.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/streaming/stream_lookup.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/tools/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/tools/web_browser.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/api_key.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/big_context.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/config.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/config_class.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/utils/version.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/vertex/init.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/vertex/memory_tools.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo/vertex/safety.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo.egg-info/SOURCES.txt +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/tests/test_chat_history.py +0 -0
- {sunholo-0.76.5 → sunholo-0.76.6}/tests/test_config.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.76.
|
|
3
|
+
Version: 0.76.6
|
|
4
4
|
Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
|
|
5
5
|
Home-page: https://github.com/sunholo-data/sunholo-py
|
|
6
|
-
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.76.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.76.6.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -66,12 +66,12 @@ def get_cloud_run_token(vector_name):
|
|
|
66
66
|
}
|
|
67
67
|
log.info(f"Authenticating for run_url {run_url} from {caller_frame.f_code.co_name}")
|
|
68
68
|
id_token = get_id_token(run_url)
|
|
69
|
-
|
|
69
|
+
log.info(f"id_token {id_token}")
|
|
70
70
|
return id_token
|
|
71
71
|
|
|
72
72
|
def get_header(vector_name) -> Optional[dict]:
|
|
73
73
|
id_token = get_cloud_run_token(vector_name)
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
headers = {"Authorization": f"Bearer {id_token}"}
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
return headers
|
|
@@ -12,15 +12,14 @@ def deploy_extension(args):
|
|
|
12
12
|
tool_example_file=args.tool_example_file,
|
|
13
13
|
open_api_file=args.open_api_file,
|
|
14
14
|
service_account=args.service_account,
|
|
15
|
-
project_id=args.project,
|
|
16
15
|
bucket_name=args.bucket_name
|
|
17
16
|
)
|
|
18
|
-
extensions = vex.list_extensions(
|
|
17
|
+
extensions = vex.list_extensions()
|
|
19
18
|
console.print(extensions)
|
|
20
19
|
|
|
21
20
|
def list_extensions(args):
|
|
22
|
-
vex = VertexAIExtensions()
|
|
23
|
-
extensions = vex.list_extensions(
|
|
21
|
+
vex = VertexAIExtensions(args.project)
|
|
22
|
+
extensions = vex.list_extensions()
|
|
24
23
|
console.print(extensions)
|
|
25
24
|
|
|
26
25
|
def setup_vertex_subparser(subparsers):
|
|
@@ -19,7 +19,7 @@ class VertexAIExtensions:
|
|
|
19
19
|
|
|
20
20
|
```python
|
|
21
21
|
from sunholo.vertex import VertexAIExtensions
|
|
22
|
-
vex = VertexAIExtensions()
|
|
22
|
+
vex = VertexAIExtensions(project_id='your-project')
|
|
23
23
|
vex.list_extensions()
|
|
24
24
|
# [{'resource_name': 'projects/374404277595/locations/us-central1/extensions/770924776838397952',
|
|
25
25
|
# 'display_name': 'Code Interpreter',
|
|
@@ -53,7 +53,7 @@ class VertexAIExtensions:
|
|
|
53
53
|
"""
|
|
54
54
|
def __init__(self, project_id=None):
|
|
55
55
|
if extensions is None:
|
|
56
|
-
raise ImportError("VertexAIExtensions needs vertexai.
|
|
56
|
+
raise ImportError("VertexAIExtensions needs vertexai.preview extensions to be installed. Install via `pip install sunholo'[gcp]'`")
|
|
57
57
|
|
|
58
58
|
self.CODE_INTERPRETER_WRITTEN_FILES = []
|
|
59
59
|
self.css_styles = """
|
|
@@ -71,12 +71,13 @@ class VertexAIExtensions:
|
|
|
71
71
|
self.manifest = {}
|
|
72
72
|
self.created_extensions = []
|
|
73
73
|
self.bucket_name = os.getenv('EXTENSIONS_BUCKET')
|
|
74
|
-
|
|
74
|
+
self.project_id = project_id or get_gcp_project()
|
|
75
|
+
self.access_token = None
|
|
76
|
+
init_vertex(location=self.location, project_id=self.project_id)
|
|
75
77
|
|
|
76
|
-
def list_extensions(self
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
the_list = extensions.Extension.list(project=project_id)
|
|
78
|
+
def list_extensions(self):
|
|
79
|
+
log.info(f"Creating extension within {self.project_id=}")
|
|
80
|
+
the_list = extensions.Extension.list(project=self.project_id)
|
|
80
81
|
|
|
81
82
|
extensions_list = []
|
|
82
83
|
for ext in the_list:
|
|
@@ -109,12 +110,25 @@ class VertexAIExtensions:
|
|
|
109
110
|
|
|
110
111
|
return self_uri
|
|
111
112
|
|
|
112
|
-
def upload_openapi_file(self, filename: str):
|
|
113
|
+
def upload_openapi_file(self, filename: str, vac:str=None):
|
|
114
|
+
if vac:
|
|
115
|
+
from ..agents.route import route_vac
|
|
116
|
+
import yaml
|
|
117
|
+
|
|
118
|
+
new_url = route_vac(vac)
|
|
119
|
+
|
|
120
|
+
log.info(f'Overwriting extension URL with VAC url for {vac=} - {new_url=}')
|
|
121
|
+
|
|
122
|
+
openapi = yaml.safe_load(filename)
|
|
123
|
+
|
|
124
|
+
openapi['servers'][0]['url'] = new_url
|
|
125
|
+
with open(filename, 'w') as file:
|
|
126
|
+
yaml.dump(openapi, file, sort_keys=False)
|
|
127
|
+
|
|
113
128
|
self.validate_openapi(filename)
|
|
114
129
|
if not self.bucket_name:
|
|
115
130
|
raise ValueError('Please specify env var EXTENSIONS_BUCKET for location to upload openapi spec')
|
|
116
131
|
|
|
117
|
-
|
|
118
132
|
self.openapi_file_gcs = self.upload_to_gcs(filename)
|
|
119
133
|
|
|
120
134
|
def load_tool_use_examples(self, filename: str):
|
|
@@ -126,21 +140,25 @@ class VertexAIExtensions:
|
|
|
126
140
|
# google.cloud.aiplatform_v1beta1.types.ToolUseExample
|
|
127
141
|
return self.tool_use_examples
|
|
128
142
|
|
|
143
|
+
def get_auth_token(self):
|
|
144
|
+
from google.auth import default
|
|
145
|
+
from google.auth.transport.requests import Request
|
|
146
|
+
|
|
147
|
+
credentials, project_id = default()
|
|
148
|
+
credentials.refresh(Request())
|
|
149
|
+
self.access_token = credentials.token
|
|
150
|
+
|
|
151
|
+
return self.access_token
|
|
129
152
|
|
|
130
153
|
def update_tool_use_examples_via_patch(self):
|
|
131
154
|
import requests
|
|
132
155
|
import json
|
|
133
|
-
from google.auth import default
|
|
134
|
-
from google.auth.transport.requests import Request
|
|
135
156
|
|
|
136
157
|
extension = self.created_extension
|
|
137
158
|
if extension is None:
|
|
138
159
|
raise ValueError("Need to create the extension first")
|
|
139
160
|
|
|
140
|
-
|
|
141
|
-
credentials, project_id = default()
|
|
142
|
-
credentials.refresh(Request())
|
|
143
|
-
access_token = credentials.token
|
|
161
|
+
self.get_auth_token()
|
|
144
162
|
|
|
145
163
|
ENDPOINT=f"{self.location}-aiplatform.googleapis.com"
|
|
146
164
|
URL=f"https://{ENDPOINT}/v1beta1"
|
|
@@ -151,7 +169,7 @@ class VertexAIExtensions:
|
|
|
151
169
|
url = f"{URL}/{extension_id}"
|
|
152
170
|
log.info(f"PATCH {url}")
|
|
153
171
|
headers = {
|
|
154
|
-
"Authorization": f"Bearer {access_token}",
|
|
172
|
+
"Authorization": f"Bearer {self.access_token}",
|
|
155
173
|
"Content-Type": "application/json"
|
|
156
174
|
}
|
|
157
175
|
|
|
@@ -202,25 +220,24 @@ class VertexAIExtensions:
|
|
|
202
220
|
tool_example_file: str = None,
|
|
203
221
|
runtime_config: dict = None,
|
|
204
222
|
service_account: str = None,
|
|
205
|
-
|
|
206
|
-
|
|
223
|
+
bucket_name: str = None,
|
|
224
|
+
vac: str = None):
|
|
207
225
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
extension_name = f"projects/{project_id}/locations/us-central1/extensions/{validate_extension_id(display_name)}"
|
|
226
|
+
log.info(f"Creating extension within {self.project_id=}")
|
|
227
|
+
extension_name = f"projects/{self.project_id}/locations/us-central1/extensions/{validate_extension_id(display_name)}"
|
|
211
228
|
|
|
212
229
|
if bucket_name:
|
|
213
230
|
log.info(f"Setting extension bucket name to {bucket_name}")
|
|
214
231
|
self.bucket_name = bucket_name
|
|
215
232
|
|
|
216
|
-
listed_extensions = self.list_extensions(
|
|
233
|
+
listed_extensions = self.list_extensions()
|
|
217
234
|
log.info(f"Listing extensions:\n {listed_extensions}")
|
|
218
235
|
for ext in listed_extensions:
|
|
219
236
|
if ext.get('display_name') == display_name:
|
|
220
237
|
raise NameError(f"display_name {display_name} already exists. Delete it or rename your new extension")
|
|
221
238
|
|
|
222
239
|
if open_api_file:
|
|
223
|
-
self.upload_openapi_file(open_api_file)
|
|
240
|
+
self.upload_openapi_file(open_api_file, vac)
|
|
224
241
|
|
|
225
242
|
manifest = self.create_extension_manifest(
|
|
226
243
|
display_name,
|
|
@@ -254,10 +271,7 @@ class VertexAIExtensions:
|
|
|
254
271
|
operation_id: str,
|
|
255
272
|
operation_params: dict,
|
|
256
273
|
extension_id: str=None,
|
|
257
|
-
project_id: str=None,
|
|
258
274
|
vac: str=None):
|
|
259
|
-
|
|
260
|
-
init_vertex(location=self.location, project_id=project_id)
|
|
261
275
|
|
|
262
276
|
if not extension_id:
|
|
263
277
|
extension_name = self.created_extension.resource_name
|
|
@@ -266,8 +280,7 @@ class VertexAIExtensions:
|
|
|
266
280
|
else:
|
|
267
281
|
extension_id = str(extension_id)
|
|
268
282
|
if not extension_id.startswith("projects/"):
|
|
269
|
-
|
|
270
|
-
extension_name = f"projects/{project_id}/locations/{self.location}/extensions/{extension_id}"
|
|
283
|
+
extension_name = f"projects/{self.project_id}/locations/{self.location}/extensions/{extension_id}"
|
|
271
284
|
else:
|
|
272
285
|
extension_name = extension_id
|
|
273
286
|
|
|
@@ -284,17 +297,20 @@ class VertexAIExtensions:
|
|
|
284
297
|
log.warning("Using local authentication via gcloud")
|
|
285
298
|
auth_config = {
|
|
286
299
|
"authType": "OAUTH",
|
|
287
|
-
"oauth_config": {"access_token": f"
|
|
300
|
+
"oauth_config": {"access_token": f"{get_local_gcloud_token()}"}
|
|
288
301
|
}
|
|
289
302
|
elif vac:
|
|
290
303
|
log.info(f"Using authentication via Cloud Run via {vac=}")
|
|
291
304
|
|
|
292
305
|
auth_config = {
|
|
293
306
|
"authType": "OAUTH",
|
|
294
|
-
"oauth_config": {"access_token": f"
|
|
307
|
+
"oauth_config": {"access_token": f"{get_cloud_run_token(vac)}"}
|
|
295
308
|
}
|
|
296
309
|
else:
|
|
297
310
|
log.warning("No vac configuration and not running locally so no authentication being set for this extension API call")
|
|
311
|
+
|
|
312
|
+
if auth_config:
|
|
313
|
+
log.info(f"{auth_config=}")
|
|
298
314
|
|
|
299
315
|
response = extension.execute(
|
|
300
316
|
operation_id=operation_id,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.76.
|
|
3
|
+
Version: 0.76.6
|
|
4
4
|
Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
|
|
5
5
|
Home-page: https://github.com/sunholo-data/sunholo-py
|
|
6
|
-
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.76.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.76.6.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|