sunholo 0.64.13__py3-none-any.whl → 0.64.16__py3-none-any.whl

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/agents/swagger.py CHANGED
@@ -1,10 +1,9 @@
1
- import yaml
2
1
  import copy
3
-
4
2
  from ..utils.config import load_all_configs
5
3
  from .route import route_vac
6
4
  from ..logging import log
7
- from ..utils.parsers import format_long_yaml
5
+ from ruamel.yaml import YAML
6
+ from io import StringIO
8
7
 
9
8
  def config_to_swagger():
10
9
  """
@@ -161,7 +160,7 @@ def generate_swagger(vac_config, agent_config):
161
160
  'summary': f"{method.capitalize()} {vector_name}",
162
161
  'operationId': f"{method}_{agent_type}_{endpoint_key}",
163
162
  'x-google-backend': {
164
- 'address': format_long_yaml(endpoint_address),
163
+ 'address': endpoint_address,
165
164
  'protocol': 'h2'
166
165
  },
167
166
  'responses': copy.deepcopy(agent_config_paths.get('response', {}).get(endpoint_key, {
@@ -203,7 +202,7 @@ def generate_swagger(vac_config, agent_config):
203
202
  'summary': f"{method.capitalize()} {agent_type}",
204
203
  'operationId': f"{method}_{agent_type}_{endpoint_key}",
205
204
  'x-google-backend': {
206
- 'address': format_long_yaml(endpoint_address),
205
+ 'address': endpoint_address,
207
206
  'protocol': 'h2'
208
207
  },
209
208
  'responses': copy.deepcopy(default_agent_config.get('response', {}).get(endpoint_key, {
@@ -215,5 +214,14 @@ def generate_swagger(vac_config, agent_config):
215
214
  }
216
215
  }))
217
216
  }
218
-
219
- return yaml.dump(swagger_template, default_flow_style=False, width=999999)
217
+
218
+ yaml = YAML()
219
+ yaml.width = 4096 # to avoid breaking urls
220
+
221
+ # Capture YAML output in a string buffer
222
+ string_stream = StringIO()
223
+ yaml.dump(swagger_template, string_stream)
224
+ yaml_string = string_stream.getvalue()
225
+
226
+ return yaml_string
227
+
sunholo/cli/swagger.py CHANGED
@@ -16,7 +16,7 @@ def cli_swagger(args):
16
16
 
17
17
  swag = generate_swagger(vac_config, agent_config)
18
18
 
19
- console.print(swag)
19
+ console.print(swag, width=8000)
20
20
 
21
21
  return swag
22
22
 
@@ -35,4 +35,3 @@ def setup_swagger_subparser(subparsers):
35
35
  deploy_parser.add_argument('--vac_config_path', help='Path to the vacConfig file. Set _CONFIG_FOLDER env var and place file in there to change default config location.')
36
36
  deploy_parser.add_argument('--agent_config_path', help='Path to agentConfig file. Set _CONFIG_FOLDER env var and place file in there to change default config location.')
37
37
  deploy_parser.set_defaults(func=cli_swagger)
38
-
sunholo/utils/parsers.py CHANGED
@@ -13,29 +13,6 @@
13
13
  # limitations under the License.
14
14
  import re
15
15
  import hashlib
16
- import textwrap # For wrapping text
17
-
18
- def format_long_yaml(x, max_width=70):
19
- """Formats the endpoint address, adding >- and line breaks if necessary.
20
- # Example usage:
21
- endpoint_template = "https://edmonbrain-blqtqfexwa-ew.a.run.app/openai/v1/chat/completions/{stem}/{vector_name}"
22
-
23
- formatted_address = format_long_yaml(x)
24
- print(formatted_address)
25
-
26
- """
27
- if len(x) < max_width:
28
- return x
29
-
30
- # Wrap the URL if it's too long
31
- wrapped_x = textwrap.wrap(x, width=max_width)
32
- output = ">-\n " + "\n ".join(wrapped_x)
33
-
34
- return output
35
-
36
-
37
-
38
-
39
16
 
40
17
  def contains_url(message_data):
41
18
  """
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.64.13
3
+ Version: 0.64.16
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.64.13.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.64.16.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -20,6 +20,7 @@ Description-Content-Type: text/markdown
20
20
  License-File: LICENSE.txt
21
21
  Requires-Dist: google-auth
22
22
  Requires-Dist: tenacity ==8.3.0
23
+ Requires-Dist: ruamel.yaml
23
24
  Requires-Dist: langchain
24
25
  Requires-Dist: langchain-experimental
25
26
  Requires-Dist: langchain-community
@@ -7,7 +7,7 @@ sunholo/agents/langserve.py,sha256=FdhQjorAY2bMn2rpuabNT6bU3uqSKWrl8DjpH3L_V7k,4
7
7
  sunholo/agents/pubsub.py,sha256=5hbbhbBGyVWRpt2sAGC5FEheYH1mCCwVUhZEB1S7vGg,1337
8
8
  sunholo/agents/route.py,sha256=V1HKXTvaNuYgjmT5_QgIQum4O7O0Mw497m6YiMpEzX0,2383
9
9
  sunholo/agents/special_commands.py,sha256=ecD5jrBVXo170sdgPILi0m_m_4nRFEv6qKn5zYEvEK8,6494
10
- sunholo/agents/swagger.py,sha256=zaBuN9kCvgMzzSPSl-zoD4y0j8ze_GDLuQHX1xpD4j4,9217
10
+ sunholo/agents/swagger.py,sha256=jxQ-NeKJ5BGQS29SiIbFhS_drb4_R5ahdR3m8-jDzWk,9354
11
11
  sunholo/agents/fastapi/__init__.py,sha256=S_pj4_bTUmDGoq_exaREHlOKThi0zTuGT0VZY0YfODQ,88
12
12
  sunholo/agents/fastapi/base.py,sha256=clk76cHbUAvU0OYJrRfCWX_5f0ACbhDsIzYBhI3wyoE,2514
13
13
  sunholo/agents/fastapi/qna_routes.py,sha256=DgK4Btu5XriOC1JaRQ4G_nWEjJfnQ0J5pyLanF6eF1g,3857
@@ -41,7 +41,7 @@ sunholo/cli/embedder.py,sha256=w7LT1CANSoQbOz8xAP3Zt4C_hP4lzGJOf8XD2jY5jBQ,7291
41
41
  sunholo/cli/merge_texts.py,sha256=U9vdMwKmcPoc6iPOWX5MKSxn49dNGbNzVLw8ui5PhEU,1823
42
42
  sunholo/cli/run_proxy.py,sha256=8mrZj0GPYO1q5e6cxej-PHdns5pGguWoDrX7RFg0FWo,11581
43
43
  sunholo/cli/sun_rich.py,sha256=UpMqeJ0C8i0pkue1AHnnyyX0bFJ9zZeJ7HBR6yhuA8A,54
44
- sunholo/cli/swagger.py,sha256=Sa4FuWifyoPow_3DrqvfVIbmaZwGnPmLY1XQjOs7M1g,1397
44
+ sunholo/cli/swagger.py,sha256=mvgk7UK2AYeWSJ5EbxtRxjAJ4Qnny-z6xxY8G6UrbPU,1405
45
45
  sunholo/components/__init__.py,sha256=IDoylb74zFKo6NIS3RQqUl0PDFBGVxM1dfUmO7OJ44U,176
46
46
  sunholo/components/llm.py,sha256=T4we3tGmqUj4tPwxQr9M6AXv_BALqZV_dRSvINan-oU,10374
47
47
  sunholo/components/retriever.py,sha256=jAgcmEM_D2Qfb3hYqHVZMZMLUEUqUbqmhD6G5czmEas,3820
@@ -96,7 +96,7 @@ sunholo/utils/config.py,sha256=xwI-3Ire8vGzvUydokfNz4Ubolxy4tA_4DNGcyGPO90,8951
96
96
  sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
97
97
  sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
98
98
  sunholo/utils/gcp_project.py,sha256=0ozs6tzI4qEvEeXb8MxLnCdEVoWKxlM6OH05htj7_tc,1325
99
- sunholo/utils/parsers.py,sha256=vLLIZ__rooA-QwM5pRFggt9tQ4hsuPW5lpz-kdq9uqo,4410
99
+ sunholo/utils/parsers.py,sha256=OrHmASqIbI45atVOhiGodgLvnfrzkvVzyHnSvAXD89I,3841
100
100
  sunholo/utils/timedelta.py,sha256=BbLabEx7_rbErj_YbNM0MBcaFN76DC4PTe4zD2ucezg,493
101
101
  sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
102
102
  sunholo/utils/version.py,sha256=jjU_4anXBikJxPg0Wur0X-B7-ec1tC7jToykAnAG9Dg,108
@@ -104,9 +104,9 @@ sunholo/vertex/__init__.py,sha256=JvHcGFuv6R_nAhY2AdoqqhMpJ5ugeWPZ_svGhWrObBk,13
104
104
  sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
105
105
  sunholo/vertex/memory_tools.py,sha256=8F1iTWnqEK9mX4W5RzCVKIjydIcNp6OFxjn_dtQ3GXo,5379
106
106
  sunholo/vertex/safety.py,sha256=3meAX0HyGZYrH7rXPUAHxtI_3w_zoy_RX7Shtkoa660,1275
107
- sunholo-0.64.13.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
108
- sunholo-0.64.13.dist-info/METADATA,sha256=51XxuyA4IFJwuW7gUXrcJRI1pYRAbjq7NAKXbd934Y8,5973
109
- sunholo-0.64.13.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
110
- sunholo-0.64.13.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
111
- sunholo-0.64.13.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
112
- sunholo-0.64.13.dist-info/RECORD,,
107
+ sunholo-0.64.16.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
108
+ sunholo-0.64.16.dist-info/METADATA,sha256=evzJvbRliMZ7e4Wh0_8R2cisKvQRnE6pYxT_KBFhw6I,6000
109
+ sunholo-0.64.16.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
110
+ sunholo-0.64.16.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
111
+ sunholo-0.64.16.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
112
+ sunholo-0.64.16.dist-info/RECORD,,