sunholo 0.69.3__tar.gz → 0.69.5__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.69.3 → sunholo-0.69.5}/PKG-INFO +2 -2
- {sunholo-0.69.3 → sunholo-0.69.5}/setup.py +1 -1
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/discovery_engine/chunker_handler.py +20 -9
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/discovery_engine/discovery_engine_client.py +37 -27
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.69.3 → sunholo-0.69.5}/LICENSE.txt +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/MANIFEST.in +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/README.md +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/setup.cfg +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/flask/vac_routes.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/langserve.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/route.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/agents/swagger.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/archive/archive.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/auth/run.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/bots/discord.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/images.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/publish.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/chat_vac.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/cli.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/configs.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/embedder.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/cli/swagger.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/components/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/components/llm.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/components/retriever.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/alloydb.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/alloydb_client.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/database.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/lancedb.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/database/uuid.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/discovery_engine/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/discovery_engine/create_new.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/llamaindex/generate.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/logging.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/patches/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/qna/parsers.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/qna/retry.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/streaming/stream_lookup.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/api_key.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/big_context.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/config.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/utils/version.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/vertex/init.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/vertex/memory_tools.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo/vertex/safety.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo.egg-info/SOURCES.txt +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/tests/test_chat_history.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/tests/test_chunker.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/tests/test_config.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/tests/test_dispatch_to_qa.py +0 -0
- {sunholo-0.69.3 → sunholo-0.69.5}/tests/test_swagger.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.69.
|
|
3
|
+
Version: 0.69.5
|
|
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.69.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.69.5.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -3,6 +3,7 @@ from ..utils.config import load_config_key
|
|
|
3
3
|
from ..components import load_memories
|
|
4
4
|
|
|
5
5
|
from .discovery_engine_client import DiscoveryEngineClient
|
|
6
|
+
from .create_new import create_new_discovery_engine
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def do_discovery_engine(message_data, metadata, vector_name):
|
|
@@ -19,14 +20,11 @@ def do_discovery_engine(message_data, metadata, vector_name):
|
|
|
19
20
|
```
|
|
20
21
|
"""
|
|
21
22
|
|
|
23
|
+
global_gcp_config = load_config_key("gcp_config", vector_name="global", kind="vacConfig")
|
|
22
24
|
gcp_config = load_config_key("gcp_config", vector_name=vector_name, kind="vacConfig")
|
|
23
|
-
if not gcp_config:
|
|
25
|
+
if not gcp_config and not global_gcp_config:
|
|
24
26
|
raise ValueError(f"Need config.{vector_name}.gcp_config to configure discovery engine")
|
|
25
27
|
|
|
26
|
-
global_project_id = gcp_config.get('project_id')
|
|
27
|
-
#global_location = gcp_config.get('location')
|
|
28
|
-
global_data_store_id = gcp_config.get('data_store_id')
|
|
29
|
-
|
|
30
28
|
memories = load_memories(vector_name)
|
|
31
29
|
tools = []
|
|
32
30
|
|
|
@@ -40,12 +38,11 @@ def do_discovery_engine(message_data, metadata, vector_name):
|
|
|
40
38
|
vectorstore = value.get('vectorstore')
|
|
41
39
|
if vectorstore == "discovery_engine" or vectorstore == "vertex_ai_search":
|
|
42
40
|
log.info(f"Found vectorstore {vectorstore}")
|
|
43
|
-
|
|
44
|
-
project_id = gcp_config.get('project_id')
|
|
41
|
+
project_id = gcp_config.get('project_id') or global_gcp_config['project_id']
|
|
45
42
|
#location = gcp_config.get('location')
|
|
46
43
|
corpus = DiscoveryEngineClient(
|
|
47
|
-
data_store_id=
|
|
48
|
-
project_id=project_id
|
|
44
|
+
data_store_id=vector_name,
|
|
45
|
+
project_id=project_id,
|
|
49
46
|
# location needs to be 'eu' or 'us' which doesn't work with other configurations
|
|
50
47
|
#location=location or global_location
|
|
51
48
|
)
|
|
@@ -67,6 +64,20 @@ def do_discovery_engine(message_data, metadata, vector_name):
|
|
|
67
64
|
log.info(f"Imported file to corpus: {response} with metadata: {metadata}")
|
|
68
65
|
except Exception as err:
|
|
69
66
|
log.error(f"Error importing {message_data} - {corp=} - {str(err)}")
|
|
67
|
+
|
|
68
|
+
if str(err).startswith("404"):
|
|
69
|
+
log.info(f"Attempting to create a new DiscoveryEngine corpus: {vector_name}")
|
|
70
|
+
try:
|
|
71
|
+
new_corp = create_new_discovery_engine(vector_name)
|
|
72
|
+
except Exception as err:
|
|
73
|
+
log.error(f"Failed to create new DiscoveryEngine {vector_name} - {str(err)}")
|
|
74
|
+
continue
|
|
75
|
+
if new_corp:
|
|
76
|
+
log.info(f"Found new DiscoveryEngine {vector_name=} - {new_corp=}")
|
|
77
|
+
response = corp.import_documents(
|
|
78
|
+
gcs_uri=message_data
|
|
79
|
+
)
|
|
80
|
+
|
|
70
81
|
continue
|
|
71
82
|
|
|
72
83
|
metadata["source"] = message_data
|
|
@@ -61,16 +61,13 @@ class DiscoveryEngineClient:
|
|
|
61
61
|
if location != "global"
|
|
62
62
|
else None
|
|
63
63
|
)
|
|
64
|
-
self.
|
|
65
|
-
self.
|
|
66
|
-
|
|
67
|
-
location=location,
|
|
68
|
-
data_store=data_store_id,
|
|
69
|
-
branch="default_branch",
|
|
70
|
-
)
|
|
64
|
+
self.store_client = discoveryengine.DataStoreServiceClient(client_options=client_options)
|
|
65
|
+
self.doc_client = discoveryengine.DocumentServiceClient(client_options=client_options)
|
|
66
|
+
self.search_client = discoveryengine.SearchServiceClient(client_options=client_options)
|
|
71
67
|
|
|
72
68
|
def create_data_store(
|
|
73
|
-
self, chunk_size: int = 500
|
|
69
|
+
self, chunk_size: int = 500,
|
|
70
|
+
collection: str = "default_collection"
|
|
74
71
|
) -> str:
|
|
75
72
|
"""
|
|
76
73
|
Creates a new data store with default configuration.
|
|
@@ -109,9 +106,15 @@ class DiscoveryEngineClient:
|
|
|
109
106
|
document_processing_config=doc_config
|
|
110
107
|
)
|
|
111
108
|
|
|
109
|
+
parent = self.store_client.collection_path(
|
|
110
|
+
project=self.project_id,
|
|
111
|
+
location=self.location,
|
|
112
|
+
collection=collection,
|
|
113
|
+
)
|
|
114
|
+
|
|
112
115
|
# https://cloud.google.com/python/docs/reference/discoveryengine/0.11.4/google.cloud.discoveryengine_v1alpha.types.CreateDataStoreRequest
|
|
113
116
|
request = discoveryengine.CreateDataStoreRequest(
|
|
114
|
-
parent=
|
|
117
|
+
parent=parent,
|
|
115
118
|
data_store_id=self.data_store_id,
|
|
116
119
|
data_store=data_store,
|
|
117
120
|
# Optional: For Advanced Site Search Only
|
|
@@ -119,10 +122,11 @@ class DiscoveryEngineClient:
|
|
|
119
122
|
)
|
|
120
123
|
|
|
121
124
|
# Make the request
|
|
122
|
-
operation = self.
|
|
125
|
+
operation = self.store_client.create_data_store(request=request)
|
|
123
126
|
|
|
124
|
-
log.info(f"Waiting for operation to complete: {operation.operation.name}")
|
|
127
|
+
log.info(f"Waiting for datastore operation to complete: {operation.operation.name}")
|
|
125
128
|
response = operation.result()
|
|
129
|
+
log.info(f"Datastore operation creation complete: {response=}")
|
|
126
130
|
|
|
127
131
|
# Once the operation is complete,
|
|
128
132
|
# get information from operation metadata
|
|
@@ -140,6 +144,7 @@ class DiscoveryEngineClient:
|
|
|
140
144
|
num_next_chunks: int = 3,
|
|
141
145
|
page_size: int = 10,
|
|
142
146
|
doc_or_chunks: str = "CHUNKS", # or DOCUMENTS
|
|
147
|
+
serving_config: str = "default_serving_config",
|
|
143
148
|
):
|
|
144
149
|
"""Retrieves chunks or documents based on a query.
|
|
145
150
|
|
|
@@ -161,22 +166,19 @@ class DiscoveryEngineClient:
|
|
|
161
166
|
print(f"Chunk: {chunk.snippet}, document name: {chunk.document_name}")
|
|
162
167
|
```
|
|
163
168
|
"""
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
|
|
170
|
+
serving_config_path = self.search_client.serving_config_path(
|
|
171
|
+
self.project_id,
|
|
172
|
+
self.location,
|
|
173
|
+
self.data_store_id,
|
|
174
|
+
serving_config
|
|
175
|
+
)
|
|
176
|
+
|
|
172
177
|
search_request = discoveryengine.SearchRequest(
|
|
173
|
-
serving_config=
|
|
178
|
+
serving_config=serving_config_path,
|
|
174
179
|
query=query,
|
|
175
180
|
page_size=page_size,
|
|
176
181
|
content_search_spec=discoveryengine.SearchRequest.ContentSearchSpec(
|
|
177
|
-
#snippet_spec=discoveryengine.SearchRequest.ContentSearchSpec.SnippetSpec(
|
|
178
|
-
# return_snippet=True
|
|
179
|
-
#),
|
|
180
182
|
search_result_mode=doc_or_chunks, # CHUNKS or DOCUMENTS
|
|
181
183
|
chunk_spec=discoveryengine.SearchRequest.ContentSearchSpec.ChunkSpec(
|
|
182
184
|
num_previous_chunks=num_previous_chunks,
|
|
@@ -185,13 +187,14 @@ class DiscoveryEngineClient:
|
|
|
185
187
|
),
|
|
186
188
|
)
|
|
187
189
|
|
|
188
|
-
search_response = self.
|
|
190
|
+
search_response = self.search_client.search(search_request)
|
|
189
191
|
|
|
190
192
|
return search_response
|
|
191
193
|
|
|
192
194
|
def import_documents(self,
|
|
193
195
|
gcs_uri: Optional[str] = None,
|
|
194
196
|
data_schema="content",
|
|
197
|
+
branch="default_branch",
|
|
195
198
|
bigquery_dataset: Optional[str] = None,
|
|
196
199
|
bigquery_table: Optional[str] = None,
|
|
197
200
|
bigquery_project_id: Optional[str] = None,
|
|
@@ -203,9 +206,16 @@ class DiscoveryEngineClient:
|
|
|
203
206
|
|
|
204
207
|
"""
|
|
205
208
|
|
|
209
|
+
parent = self.doc_client.branch_path(
|
|
210
|
+
self.project_id,
|
|
211
|
+
self.location,
|
|
212
|
+
self.data_store_id,
|
|
213
|
+
branch
|
|
214
|
+
)
|
|
215
|
+
|
|
206
216
|
if gcs_uri:
|
|
207
217
|
request = discoveryengine.ImportDocumentsRequest(
|
|
208
|
-
parent=
|
|
218
|
+
parent=parent,
|
|
209
219
|
# https://cloud.google.com/python/docs/reference/discoveryengine/latest/google.cloud.discoveryengine_v1alpha.types.GcsSource
|
|
210
220
|
gcs_source=discoveryengine.GcsSource(
|
|
211
221
|
input_uris=[gcs_uri], data_schema=data_schema,
|
|
@@ -215,7 +225,7 @@ class DiscoveryEngineClient:
|
|
|
215
225
|
)
|
|
216
226
|
else:
|
|
217
227
|
request = discoveryengine.ImportDocumentsRequest(
|
|
218
|
-
parent=
|
|
228
|
+
parent=parent,
|
|
219
229
|
bigquery_source=discoveryengine.BigQuerySource(
|
|
220
230
|
project_id=bigquery_project_id or self.project_id,
|
|
221
231
|
dataset_id=bigquery_dataset,
|
|
@@ -227,7 +237,7 @@ class DiscoveryEngineClient:
|
|
|
227
237
|
)
|
|
228
238
|
|
|
229
239
|
# Make the request
|
|
230
|
-
operation = self.
|
|
240
|
+
operation = self.doc_client.import_documents(request=request)
|
|
231
241
|
|
|
232
242
|
log.info(f"Waiting for operation to complete: {operation.operation.name}")
|
|
233
243
|
response = operation.result()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.69.
|
|
3
|
+
Version: 0.69.5
|
|
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.69.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.69.5.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
|