sunholo 0.79.0__tar.gz → 0.79.2__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.79.0 → sunholo-0.79.2}/PKG-INFO +2 -2
- {sunholo-0.79.0 → sunholo-0.79.2}/setup.py +1 -2
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/chat_history.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/dispatch_to_qa.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/fastapi/base.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/fastapi/qna_routes.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/flask/qna_routes.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/flask/vac_routes.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/langserve.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/pubsub.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/route.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/special_commands.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/swagger.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/archive/archive.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/auth/refresh.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/auth/run.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/azure/auth.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/azure/blobs.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/azure/event_grid.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/bots/discord.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/azure.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/doc_handling.py +2 -2
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/encode_metadata.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/images.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/loaders.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/message_data.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/pdfs.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/process_chunker_data.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/publish.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/pubsub.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/splitter.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/chat_vac.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/cli.py +4 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/components/llm.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/components/retriever.py +19 -13
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/components/vectorstore.py +13 -2
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/alloydb.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/alloydb_client.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/database.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/lancedb.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/static_dbs.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/discovery_engine/chunker_handler.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/discovery_engine/discovery_engine_client.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/embedder/embed_chunk.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/gcs/add_file.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/gcs/download_folder.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/gcs/download_url.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/gcs/metadata.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/invoke/direct_vac_func.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/invoke/invoke_vac_utils.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/langfuse/callback.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/langfuse/prompts.py +1 -1
- sunholo-0.79.2/sunholo/llamaindex/__init__.py +1 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/llamaindex/import_files.py +24 -17
- sunholo-0.79.2/sunholo/llamaindex/llamaindex_class.py +274 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/pubsub/process_pubsub.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/pubsub/pubsub_manager.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/qna/parsers.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/qna/retry.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/streaming/content_buffer.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/streaming/langserve.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/streaming/stream_lookup.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/streaming/streaming.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/summarise/summarise.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/tools/web_browser.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/config.py +5 -5
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/config_class.py +4 -4
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/extensions_call.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/extensions_class.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/genai_functions.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/init.py +1 -1
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/memory_tools.py +29 -14
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo.egg-info/SOURCES.txt +2 -2
- sunholo-0.79.0/sunholo/llamaindex/generate.py +0 -22
- sunholo-0.79.0/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/LICENSE.txt +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/MANIFEST.in +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/README.md +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/setup.cfg +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/auth/gcloud.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/azure/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/configs.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/embedder.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/swagger.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/cli/vertex.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/components/__init__.py +0 -0
- /sunholo-0.79.0/sunholo/logging.py → /sunholo-0.79.2/sunholo/custom_logging.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/database/uuid.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/discovery_engine/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/discovery_engine/create_new.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/invoke/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.79.0/sunholo/llamaindex → sunholo-0.79.2/sunholo/lookup}/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.79.0/sunholo/lookup → sunholo-0.79.2/sunholo/patches}/__init__.py +0 -0
- {sunholo-0.79.0/sunholo/patches → sunholo-0.79.2/sunholo/patches/langchain}/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/tools/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/api_key.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/big_context.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/utils/version.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/safety.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo/vertex/type_dict_to_json.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/tests/test_chat_history.py +0 -0
- {sunholo-0.79.0 → sunholo-0.79.2}/tests/test_config.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.79.
|
|
3
|
+
Version: 0.79.2
|
|
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.79.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.79.2.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
2
|
|
|
3
3
|
# Define your base version
|
|
4
|
-
version = '0.79.
|
|
4
|
+
version = '0.79.2'
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name='sunholo',
|
|
@@ -34,7 +34,6 @@ setup(
|
|
|
34
34
|
"langchain>=0.2.5",
|
|
35
35
|
"langchain_experimental>0.0.60",
|
|
36
36
|
"langchain-community",
|
|
37
|
-
# Add the minimal dependencies that your package requires here
|
|
38
37
|
],
|
|
39
38
|
extras_require={
|
|
40
39
|
# Define optional dependencies with feature names
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
from ..utils import ConfigManager
|
|
16
16
|
from ..auth import get_header
|
|
17
17
|
import requests
|
|
@@ -15,7 +15,7 @@ from ...agents import extract_chat_history, handle_special_commands
|
|
|
15
15
|
from ...qna.parsers import parse_output
|
|
16
16
|
from ...streaming import start_streaming_chat_async
|
|
17
17
|
from ...archive import archive_qa
|
|
18
|
-
from ...
|
|
18
|
+
from ...custom_logging import log
|
|
19
19
|
|
|
20
20
|
class VACRequest(BaseModel):
|
|
21
21
|
user_input: str
|
|
@@ -21,7 +21,7 @@ from ...agents import extract_chat_history, handle_special_commands
|
|
|
21
21
|
from ...qna.parsers import parse_output
|
|
22
22
|
from ...streaming import start_streaming_chat
|
|
23
23
|
from ...archive import archive_qa
|
|
24
|
-
from ...
|
|
24
|
+
from ...custom_logging import log
|
|
25
25
|
from ...utils.config import load_config
|
|
26
26
|
from ...utils.version import sunholo_version
|
|
27
27
|
import os
|
|
@@ -7,7 +7,7 @@ from ...agents import extract_chat_history, handle_special_commands
|
|
|
7
7
|
from ...qna.parsers import parse_output
|
|
8
8
|
from ...streaming import start_streaming_chat
|
|
9
9
|
from ...archive import archive_qa
|
|
10
|
-
from ...
|
|
10
|
+
from ...custom_logging import log
|
|
11
11
|
from ...utils.config import load_config
|
|
12
12
|
from ...utils.version import sunholo_version
|
|
13
13
|
import os
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
import base64
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
from ..utils import load_config, ConfigManager
|
|
16
16
|
|
|
17
17
|
def read_cloud_run_url(agent, cloud_run_urls_file='config/cloud_run_urls.json'):
|
|
@@ -26,7 +26,7 @@ from ..utils.parsers import contains_url, extract_urls
|
|
|
26
26
|
from ..chunker.publish import publish_text
|
|
27
27
|
from ..gcs.add_file import add_file_to_gcs
|
|
28
28
|
from ..utils.config import load_config_key
|
|
29
|
-
from ..
|
|
29
|
+
from ..custom_logging import log
|
|
30
30
|
|
|
31
31
|
# config file?
|
|
32
32
|
command_descriptions = {
|
|
@@ -6,7 +6,7 @@ from ..utils.config import load_config
|
|
|
6
6
|
from ..utils import ConfigManager
|
|
7
7
|
from ..utils.gcp import is_running_on_cloudrun
|
|
8
8
|
from ..utils.api_key import has_multivac_api_key, get_multivac_api_key
|
|
9
|
-
from ..
|
|
9
|
+
from ..custom_logging import log
|
|
10
10
|
from ..agents.route import route_vac
|
|
11
11
|
from .gcloud import get_local_gcloud_token
|
|
12
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from ..utils import load_config_key
|
|
2
|
-
from ..
|
|
2
|
+
from ..custom_logging import log
|
|
3
3
|
from ..database.alloydb import add_document_if_not_exists
|
|
4
4
|
from ..database.uuid import generate_uuid_from_object_id
|
|
5
5
|
from ..components.llm import llm_str_to_llm
|
|
@@ -178,7 +178,7 @@ Be careful not to add any speculation or any details that are not covered in the
|
|
|
178
178
|
|
|
179
179
|
if bucket_name.startswith("gs://"):
|
|
180
180
|
bucket_name = bucket_name[len("gs://"):]
|
|
181
|
-
|
|
181
|
+
|
|
182
182
|
with tempfile.NamedTemporaryFile(mode='w+', delete=False) as temp_file:
|
|
183
183
|
temp_file.write(summary)
|
|
184
184
|
temp_file.flush()
|
|
@@ -18,7 +18,7 @@ from langchain_community.document_loaders import UnstructuredURLLoader
|
|
|
18
18
|
from langchain_community.document_loaders import GitLoader
|
|
19
19
|
from langchain_community.document_loaders import GoogleDriveLoader
|
|
20
20
|
|
|
21
|
-
from ..
|
|
21
|
+
from ..custom_logging import log
|
|
22
22
|
from .pdfs import read_pdf_file
|
|
23
23
|
from ..utils.config import load_config
|
|
24
24
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
|
|
16
16
|
import pathlib
|
|
17
17
|
import tempfile
|
|
@@ -16,7 +16,7 @@ from .publish import process_docs_chunks_vector_name
|
|
|
16
16
|
from .splitter import chunk_doc_to_docs
|
|
17
17
|
from ..azure.blobs import is_azure_blob
|
|
18
18
|
|
|
19
|
-
from ..
|
|
19
|
+
from ..custom_logging import log
|
|
20
20
|
|
|
21
21
|
def process_chunker_data(message_data, metadata, vector_name):
|
|
22
22
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from ..
|
|
15
|
+
from ..custom_logging import log
|
|
16
16
|
from ..pubsub import process_pubsub_message
|
|
17
17
|
from .process_chunker_data import process_chunker_data
|
|
18
18
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
from ..utils.parsers import remove_whitespace
|
|
16
16
|
from langchain.schema import Document
|
|
17
17
|
import langchain.text_splitter as text_splitter
|
|
@@ -3,7 +3,7 @@ from ..streaming import generate_proxy_stream, can_agent_stream
|
|
|
3
3
|
from ..utils.user_ids import generate_user_id
|
|
4
4
|
from ..utils import ConfigManager
|
|
5
5
|
from ..utils.api_key import has_multivac_api_key
|
|
6
|
-
from ..
|
|
6
|
+
from ..custom_logging import log
|
|
7
7
|
from ..qna.parsers import parse_output
|
|
8
8
|
from ..gcs.add_file import add_file_to_gcs
|
|
9
9
|
from .run_proxy import clean_proxy_list, start_proxy, stop_proxy
|
|
@@ -10,10 +10,11 @@ from .chat_vac import setup_vac_subparser
|
|
|
10
10
|
from .embedder import setup_embedder_subparser
|
|
11
11
|
from .swagger import setup_swagger_subparser
|
|
12
12
|
from .vertex import setup_vertex_subparser
|
|
13
|
+
from ..llamaindex import setup_llamaindex_subparser
|
|
13
14
|
|
|
14
15
|
from ..utils import ConfigManager
|
|
15
16
|
|
|
16
|
-
from ..
|
|
17
|
+
from ..custom_logging import log
|
|
17
18
|
|
|
18
19
|
from .sun_rich import console
|
|
19
20
|
import sys
|
|
@@ -87,6 +88,8 @@ def main(args=None):
|
|
|
87
88
|
setup_swagger_subparser(subparsers)
|
|
88
89
|
# vertex
|
|
89
90
|
setup_vertex_subparser(subparsers)
|
|
91
|
+
# llamaindex
|
|
92
|
+
setup_llamaindex_subparser(subparsers)
|
|
90
93
|
|
|
91
94
|
#TODO: add database setup commands: alloydb and supabase
|
|
92
95
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
from ..utils import load_config_key, ConfigManager
|
|
16
16
|
|
|
17
17
|
import os
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from ..
|
|
14
|
+
from ..custom_logging import log
|
|
15
15
|
from .vectorstore import pick_vectorstore
|
|
16
|
-
from ..utils import
|
|
16
|
+
from ..utils import ConfigManager
|
|
17
17
|
from .llm import get_embeddings
|
|
18
18
|
from ..utils.gcp_project import get_gcp_project
|
|
19
19
|
|
|
@@ -41,9 +41,14 @@ def load_memories(vector_name:str=None, config:ConfigManager=None):
|
|
|
41
41
|
|
|
42
42
|
return memories
|
|
43
43
|
|
|
44
|
-
def pick_retriever(vector_name, embeddings=None):
|
|
44
|
+
def pick_retriever(vector_name:str=None, config:ConfigManager=None, embeddings=None):
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
if config is None:
|
|
47
|
+
if vector_name is None:
|
|
48
|
+
raise ValueError("vector_name and config were none")
|
|
49
|
+
config = ConfigManager(vector_name)
|
|
50
|
+
|
|
51
|
+
memories = load_memories(config=config)
|
|
47
52
|
|
|
48
53
|
retriever_list = []
|
|
49
54
|
for memory in memories: # Iterate over the list
|
|
@@ -58,7 +63,7 @@ def pick_retriever(vector_name, embeddings=None):
|
|
|
58
63
|
log.info(f"Skipped from_metadata_id for {vectorstore}")
|
|
59
64
|
continue
|
|
60
65
|
|
|
61
|
-
embeddings = embeddings or get_embeddings(
|
|
66
|
+
embeddings = embeddings or get_embeddings(config=config)
|
|
62
67
|
read_only = value.get('read_only')
|
|
63
68
|
try:
|
|
64
69
|
vectorstore = pick_vectorstore(vectorstore,
|
|
@@ -93,15 +98,15 @@ def pick_retriever(vector_name, embeddings=None):
|
|
|
93
98
|
log.info(f"No retrievers were created for {memories}")
|
|
94
99
|
return None
|
|
95
100
|
|
|
96
|
-
retriever = process_retrieval(retriever_list,
|
|
101
|
+
retriever = process_retrieval(retriever_list, config=config)
|
|
97
102
|
|
|
98
103
|
return retriever
|
|
99
104
|
|
|
100
|
-
def metadata_retriever(metadata: dict, key: str,
|
|
105
|
+
def metadata_retriever(metadata: dict, key: str, config:ConfigManager, embeddings=None):
|
|
101
106
|
"""
|
|
102
107
|
Decides which vector_name to retrieve from metadata passed
|
|
103
108
|
"""
|
|
104
|
-
memories = load_memories(
|
|
109
|
+
memories = load_memories(config=config)
|
|
105
110
|
|
|
106
111
|
retriever_list = []
|
|
107
112
|
for memory in memories: # Iterate over the list
|
|
@@ -118,7 +123,7 @@ def metadata_retriever(metadata: dict, key: str, vector_name:str, embeddings=Non
|
|
|
118
123
|
raise ValueError(f"Missing {key} in {metadata}")
|
|
119
124
|
the_id = metadata[key]
|
|
120
125
|
read_only = value.get('read_only')
|
|
121
|
-
embeddings = embeddings or get_embeddings(
|
|
126
|
+
embeddings = embeddings or get_embeddings(config=config)
|
|
122
127
|
vectorstore = pick_vectorstore(vectorstore,
|
|
123
128
|
vector_name=the_id,
|
|
124
129
|
embeddings=embeddings,
|
|
@@ -133,17 +138,18 @@ def metadata_retriever(metadata: dict, key: str, vector_name:str, embeddings=Non
|
|
|
133
138
|
log.info(f"No retrievers were created for {memories}")
|
|
134
139
|
return None
|
|
135
140
|
|
|
136
|
-
retriever = process_retrieval(retriever_list,
|
|
141
|
+
retriever = process_retrieval(retriever_list, config=config)
|
|
137
142
|
|
|
138
143
|
return retriever
|
|
139
144
|
|
|
140
145
|
|
|
141
146
|
|
|
142
|
-
def process_retrieval(retriever_list: list,
|
|
143
|
-
k_override =
|
|
147
|
+
def process_retrieval(retriever_list: list, config: ConfigManager):
|
|
148
|
+
k_override = config.vacConfig('memory_k')
|
|
144
149
|
lotr = MergerRetriever(retrievers=retriever_list)
|
|
145
150
|
|
|
146
|
-
filter_embeddings = get_embeddings(
|
|
151
|
+
filter_embeddings = get_embeddings(config=config)
|
|
152
|
+
|
|
147
153
|
filter = EmbeddingsRedundantFilter(embeddings=filter_embeddings)
|
|
148
154
|
pipeline = DocumentCompressorPipeline(transformers=[filter])
|
|
149
155
|
retriever = ContextualCompressionRetriever(
|
|
@@ -12,10 +12,21 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
import os
|
|
15
|
-
from ..
|
|
15
|
+
from ..custom_logging import log
|
|
16
|
+
from ..utils import ConfigManager
|
|
16
17
|
|
|
17
|
-
def pick_vectorstore(vs_str: str, vector_name: str, embeddings, read_only=None):
|
|
18
|
+
def pick_vectorstore(vs_str: str, vector_name: str=None, embeddings=None, config:ConfigManager=None, read_only=None):
|
|
18
19
|
log.debug('Picking vectorstore')
|
|
20
|
+
|
|
21
|
+
if not embeddings:
|
|
22
|
+
raise ValueError("Requires embeddings")
|
|
23
|
+
|
|
24
|
+
if config is None:
|
|
25
|
+
if vector_name is None:
|
|
26
|
+
raise ValueError("vector_name and config were none")
|
|
27
|
+
config = ConfigManager(vector_name)
|
|
28
|
+
|
|
29
|
+
vector_name = config.vector_name
|
|
19
30
|
|
|
20
31
|
if vs_str == 'supabase':
|
|
21
32
|
from supabase import Client, create_client
|
|
@@ -20,7 +20,7 @@ import uuid
|
|
|
20
20
|
from langchain.schema import Document
|
|
21
21
|
|
|
22
22
|
from ..components import get_embeddings, pick_vectorstore, load_memories, pick_embedding
|
|
23
|
-
from ..
|
|
23
|
+
from ..custom_logging import log
|
|
24
24
|
from ..database.uuid import generate_uuid_from_object_id
|
|
25
25
|
from ..utils import ConfigManager
|
|
26
26
|
|
|
@@ -10,7 +10,7 @@ try:
|
|
|
10
10
|
except ImportError:
|
|
11
11
|
storage = None
|
|
12
12
|
|
|
13
|
-
from ..
|
|
13
|
+
from ..custom_logging import log
|
|
14
14
|
from ..utils.gcp import is_running_on_gcp
|
|
15
15
|
from ..auth.refresh import refresh_credentials, get_default_creds, get_default_email
|
|
16
16
|
from io import BytesIO
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .llamaindex_class import setup_llamaindex_subparser, LlamaIndexVertexCorpusManager
|