sunholo 0.64.12__py3-none-any.whl → 0.64.13__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
@@ -4,6 +4,7 @@ import copy
4
4
  from ..utils.config import load_all_configs
5
5
  from .route import route_vac
6
6
  from ..logging import log
7
+ from ..utils.parsers import format_long_yaml
7
8
 
8
9
  def config_to_swagger():
9
10
  """
@@ -160,7 +161,7 @@ def generate_swagger(vac_config, agent_config):
160
161
  'summary': f"{method.capitalize()} {vector_name}",
161
162
  'operationId': f"{method}_{agent_type}_{endpoint_key}",
162
163
  'x-google-backend': {
163
- 'address': endpoint_address,
164
+ 'address': format_long_yaml(endpoint_address),
164
165
  'protocol': 'h2'
165
166
  },
166
167
  'responses': copy.deepcopy(agent_config_paths.get('response', {}).get(endpoint_key, {
@@ -202,7 +203,7 @@ def generate_swagger(vac_config, agent_config):
202
203
  'summary': f"{method.capitalize()} {agent_type}",
203
204
  'operationId': f"{method}_{agent_type}_{endpoint_key}",
204
205
  'x-google-backend': {
205
- 'address': endpoint_address,
206
+ 'address': format_long_yaml(endpoint_address),
206
207
  'protocol': 'h2'
207
208
  },
208
209
  'responses': copy.deepcopy(default_agent_config.get('response', {}).get(endpoint_key, {
sunholo/utils/parsers.py CHANGED
@@ -13,6 +13,29 @@
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
+
16
39
 
17
40
  def contains_url(message_data):
18
41
  """
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.64.12
3
+ Version: 0.64.13
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.12.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.64.13.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -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=Nubx2Uc-STC8x_eg71e4kpjvGNN5ZFmve06TLhqRT3E,9136
10
+ sunholo/agents/swagger.py,sha256=zaBuN9kCvgMzzSPSl-zoD4y0j8ze_GDLuQHX1xpD4j4,9217
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
@@ -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=OrHmASqIbI45atVOhiGodgLvnfrzkvVzyHnSvAXD89I,3841
99
+ sunholo/utils/parsers.py,sha256=vLLIZ__rooA-QwM5pRFggt9tQ4hsuPW5lpz-kdq9uqo,4410
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.12.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
108
- sunholo-0.64.12.dist-info/METADATA,sha256=EOdoaGXPanez9yS01v30kLtKshzJScXbDabPgMv0RNg,5973
109
- sunholo-0.64.12.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
110
- sunholo-0.64.12.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
111
- sunholo-0.64.12.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
112
- sunholo-0.64.12.dist-info/RECORD,,
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,,