UncountablePythonSDK 0.0.187__py3-none-any.whl → 0.0.188__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.
@@ -15,6 +15,7 @@ from .emit_typescript_util import (
15
15
  emit_type_ts,
16
16
  resolve_namespace_name,
17
17
  resolve_namespace_ref,
18
+ rewrite_ts_file,
18
19
  ts_type_name,
19
20
  )
20
21
 
@@ -89,7 +90,7 @@ def _emit_types(builder: builder.SpecBuilder, config: TypeScriptConfig) -> None:
89
90
 
90
91
  basename = "/".join(namespace.path)
91
92
  filename = f"{config.types_output}/{basename}.ts"
92
- util.rewrite_file(filename, full.getvalue())
93
+ rewrite_ts_file(filename, full.getvalue())
93
94
 
94
95
  if len(namespace.path) == 1:
95
96
  index_out.write(
@@ -1,4 +1,5 @@
1
1
  import io
2
+ import re
2
3
  import typing
3
4
  from dataclasses import dataclass, field
4
5
 
@@ -9,6 +10,18 @@ INDENT = " "
9
10
 
10
11
  MODIFY_NOTICE = "// DO NOT MODIFY -- This file is generated by type_spec\n"
11
12
 
13
+ _TS_UNICODE_ESCAPE_RE = re.compile(r"(?<!\\)((?:\\\\)*)\\u([0-9a-f]{4})")
14
+
15
+
16
+ def rewrite_ts_file(filename: str, content: str) -> bool:
17
+ return util.rewrite_file(
18
+ filename,
19
+ _TS_UNICODE_ESCAPE_RE.sub(
20
+ lambda match: f"{match.group(1)}\\u{match.group(2).upper()}", content
21
+ ),
22
+ )
23
+
24
+
12
25
  base_name_map = {
13
26
  builder.BaseTypeName.s_boolean: "boolean",
14
27
  builder.BaseTypeName.s_date: "string", # IMPROVE: Aliased DateStr
@@ -16,7 +16,7 @@ from pkgs.serialization_util import serialize_for_api, serialize_for_storage
16
16
 
17
17
  from .. import builder, util
18
18
  from ..emit_python import python_field_name
19
- from ..emit_typescript_util import MODIFY_NOTICE, ts_property_name
19
+ from ..emit_typescript_util import MODIFY_NOTICE, rewrite_ts_file, ts_property_name
20
20
  from ..value_spec import convert_to_value_spec_type
21
21
 
22
22
  ext_info_parser = CachedParser(type_info_t.ExtInfo, strict_property_parsing=True)
@@ -112,7 +112,7 @@ def emit_type_info(build: builder.SpecBuilder, output: str) -> None:
112
112
  type_map_out.write(MODIFY_NOTICE)
113
113
  type_map_out.write(f"export const TYPE_MAP = {serial}")
114
114
 
115
- util.rewrite_file(f"{output}/type_map.ts", type_map_out.getvalue())
115
+ rewrite_ts_file(f"{output}/type_map.ts", type_map_out.getvalue())
116
116
 
117
117
 
118
118
  def _convert_value_for_yaml_dump(value: Any) -> Any:
@@ -5,14 +5,24 @@ from dataclasses import dataclass
5
5
 
6
6
  from flask.wrappers import Response
7
7
 
8
+ from uncountable.integration.telemetry import LogSeverity
9
+
8
10
 
9
11
  class HttpException(Exception):
10
12
  error_code: int
11
13
  message: str
12
-
13
- def __init__(self, *, error_code: int, message: str) -> None:
14
+ severity: LogSeverity
15
+
16
+ def __init__(
17
+ self,
18
+ *,
19
+ error_code: int,
20
+ message: str,
21
+ severity: LogSeverity = LogSeverity.ERROR,
22
+ ) -> None:
14
23
  self.error_code = error_code
15
24
  self.message = message
25
+ self.severity = severity
16
26
 
17
27
  @staticmethod
18
28
  def payload_failed_signature() -> "HttpException":
@@ -95,6 +95,7 @@ def register_route(
95
95
  e,
96
96
  message=f"HTTP error on {method} {url}",
97
97
  attributes=request_attributes,
98
+ severity=e.severity,
98
99
  )
99
100
  return e.make_error_response()
100
101
  except Exception as e:
@@ -27,6 +27,7 @@ __all__: list[str] = [
27
27
  # DO NOT MODIFY -- This file is generated by type_spec
28
28
  @serial_string_enum(
29
29
  labels={
30
+ "agent": "Agent",
30
31
  "agent_memory": "Agent Memory",
31
32
  "agent_persona": "Agent Persona",
32
33
  "aggregated_data_view": "Aggregated Data View",
@@ -66,6 +67,7 @@ __all__: list[str] = [
66
67
  "default_permissions_new_project": "Default Permissions New Project",
67
68
  "document": "Document",
68
69
  "document_mapping": "Document Mapping",
70
+ "document_mapping_input": "Document Mapping Input",
69
71
  "document_version": "Document Version",
70
72
  "doe_run": "Suggest Experiments",
71
73
  "draft_entity": "Draft Entity",
@@ -312,6 +314,7 @@ __all__: list[str] = [
312
314
  },
313
315
  )
314
316
  class EntityType(StrEnum):
317
+ AGENT = "agent"
315
318
  AGENT_MEMORY = "agent_memory"
316
319
  AGENT_PERSONA = "agent_persona"
317
320
  AGGREGATED_DATA_VIEW = "aggregated_data_view"
@@ -351,6 +354,7 @@ class EntityType(StrEnum):
351
354
  DEFAULT_PERMISSIONS_NEW_PROJECT = "default_permissions_new_project"
352
355
  DOCUMENT = "document"
353
356
  DOCUMENT_MAPPING = "document_mapping"
357
+ DOCUMENT_MAPPING_INPUT = "document_mapping_input"
354
358
  DOCUMENT_VERSION = "document_version"
355
359
  DOE_RUN = "doe_run"
356
360
  DRAFT_ENTITY = "draft_entity"
@@ -91,7 +91,7 @@ class SocketEventType(StrEnum):
91
91
  )
92
92
  @dataclasses.dataclass(slots=True, kw_only=True)
93
93
  class BaseSocketEventData:
94
- pass
94
+ room_key: str | None = None
95
95
 
96
96
 
97
97
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.187
3
+ Version: 0.0.188
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -97,8 +97,8 @@ pkgs/type_spec/emit_open_api.py,sha256=C3PRRSQJpHUZkS4CeEMGywhbLYs_MD3t6u-DlVIe2
97
97
  pkgs/type_spec/emit_open_api_util.py,sha256=bTmRvrGP82-eB75hwf9ySI7pDEC87FNQTF18VKEWSXY,2367
98
98
  pkgs/type_spec/emit_python.py,sha256=dP0pD3x7_1u0BuZMk_DGA0GUtrWWR4U8H72Wd6FTOAI,60898
99
99
  pkgs/type_spec/emit_scss.py,sha256=6psmBAJyu7cvfQAIvIIMk2U6VFG_xeWy1Ea4afv0XyM,1497
100
- pkgs/type_spec/emit_typescript.py,sha256=Qu9f1Yv_wc449KHcBGO58hatbzvPvgMbZ11jferi3oY,11567
101
- pkgs/type_spec/emit_typescript_util.py,sha256=dRiOm38M4DR5NtvJyaEoGXE8Zzrfnae6yuDC76OzCeU,14915
100
+ pkgs/type_spec/emit_typescript.py,sha256=qwFVtrAvHhJuRkPP6RY_fH7RX7N9gdu9HdPxdztohdU,11586
101
+ pkgs/type_spec/emit_typescript_util.py,sha256=Tda5s2HdJ0wievQ8DK80ALDmf2SfzOKPB_6w80SlEIo,15243
102
102
  pkgs/type_spec/load_types.py,sha256=k5hWxFvhj8aT_9vAwtkjn9OdudQFK9IIUzZI7-Gpx2Y,5277
103
103
  pkgs/type_spec/non_discriminated_union_exceptions.py,sha256=jgQ4Naz8A6FbhgfR3c9SI4IMvkkft0MT6CyQXWu9RB0,559
104
104
  pkgs/type_spec/open_api_util.py,sha256=LX6ny4xNOWXQO3qWVM8elrSDTqWsj_7jFplax2POShE,7992
@@ -111,7 +111,7 @@ pkgs/type_spec/actions_registry/emit_typescript.py,sha256=XqmbX5OrgjdCGQf4-iNc_a
111
111
  pkgs/type_spec/parts/base.py.prepart,sha256=1BCL7DCPoot5CYR3O-IpcOvMVthe1cbTQkTiUeZvuk8,2316
112
112
  pkgs/type_spec/parts/base.ts.prepart,sha256=m5aM7AU_42w3Lpbm_s3GYnuFxH3EcUlnFq7zOIE1fDo,1820
113
113
  pkgs/type_spec/type_info/__main__.py,sha256=TLNvCHGcmaj_8Sj5bAQNpuNaaw2dpDzoFDWZds0V4Qo,1002
114
- pkgs/type_spec/type_info/emit_type_info.py,sha256=oCXW8ioVoIS_jMUjK-WFTnC5shy_yMQqPy195grHT2U,18039
114
+ pkgs/type_spec/type_info/emit_type_info.py,sha256=tGr6z6ni5TG4uF2Nupi2P1Xh5slyuRjTgISM86ruQo8,18054
115
115
  pkgs/type_spec/ui_entry_actions/__init__.py,sha256=WiHE_BexOEZWbkkbD7EnFau1aMLNmfgQywG9PTQNCkw,135
116
116
  pkgs/type_spec/ui_entry_actions/generate_ui_entry_actions.py,sha256=xccqh8hiHdXKiZTzhJr4I4SisRTQERPzXCYZh9pJE84,9621
117
117
  pkgs/type_spec/value_spec/__init__.py,sha256=yoTmK2MFVodtwvqMQMG9O3r5vVA7Pj7-ZShGC-i40Jg,175
@@ -155,7 +155,7 @@ uncountable/integration/executors/executors.py,sha256=E3a0_yrQesfigDzjhUAwD7-l-o
155
155
  uncountable/integration/executors/generic_upload_executor.py,sha256=MuNzrMnAaj6PBhrfTKX6e6vyQhwoDeBrYLz96ai653k,12149
156
156
  uncountable/integration/executors/script_executor.py,sha256=hKq09fOG89OAZ1Iq7wm2OgpUz1bh7DIYdZ2yn6ySr10,881
157
157
  uncountable/integration/http_server/__init__.py,sha256=ld7hD3wOGwAbnVRBrkTUCP5zNG-kptMd4wGJyQvUWVc,170
158
- uncountable/integration/http_server/types.py,sha256=yrpSEPz7mS8xfNHCsYtDD3OIgZpu1dsND4pRELxFI6A,2464
158
+ uncountable/integration/http_server/types.py,sha256=0J59HhEyntDjy0o37Qze0v0o-wC85QM5NQR8TuNrwV8,2672
159
159
  uncountable/integration/queue_runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  uncountable/integration/queue_runner/job_process.py,sha256=OONJ7aLsE80qIJ2ABLY3HYyKI7VdpBjI_pPQ3GCC13U,2586
161
161
  uncountable/integration/queue_runner/job_runner.py,sha256=Yh9hYfEYOya3BR6ypsal3LKPKrrEb4VQwfGuh4qyU2w,6115
@@ -184,7 +184,7 @@ uncountable/integration/queue_runner/datastore/model.py,sha256=06_fGS0QTALEA_381
184
184
  uncountable/integration/secret_retrieval/__init__.py,sha256=sisf8cxCYcJmCXCKjEPoT2xIxm1j-Ru9iTfMVxH6NM0,171
185
185
  uncountable/integration/secret_retrieval/basic_secret.py,sha256=PfpeaEDwdi8nFlHUJnzCob9GYgGG5O_3mmcaxPPY6zI,3272
186
186
  uncountable/integration/secret_retrieval/retrieve_secret.py,sha256=c0VkCvppWKXwgxdblQuj2WhRaEGBPa7vLDoS6mlNOAQ,3919
187
- uncountable/integration/webhook_server/entrypoint.py,sha256=e7aYLsp5ht8Bzmj522_-5xSEm9zyHw-NGvggYCWClDE,5399
187
+ uncountable/integration/webhook_server/entrypoint.py,sha256=_IgZ98Fpigmx3VxYgKFC1jv55tz8M-u2CGgB9_q_04E,5440
188
188
  uncountable/types/__init__.py,sha256=d1t7dHkmZ--ykXDKV_IDtWXD4MHCC0bWflT_yUjkRBw,14462
189
189
  uncountable/types/async_batch.py,sha256=yCCWrrLQfxXVqZp-KskxLBNkNmuELdz4PJjx8ULppgs,662
190
190
  uncountable/types/async_batch_processor.py,sha256=sDORgYud3qNZ9mYizHzoXu2TuYJc0KhW1BPC8LO3o9U,48976
@@ -211,7 +211,7 @@ uncountable/types/data_t.py,sha256=U_dIh5GcyaJlkrHEI4Qf4TOo1uJX07PYO70sYzzKtTo,2
211
211
  uncountable/types/dataset_measurements.py,sha256=CVwWePUC02B_R_UB86yfNBwnclR-5xpZaiCs2jWtu2A,512
212
212
  uncountable/types/dataset_measurements_t.py,sha256=iVwh-3Z23aXmPJcUJ3s9axPeOs627DElE_dhfj_PRlQ,1711
213
213
  uncountable/types/entity.py,sha256=Zclk1LYcRaYrMDhqyCjMSLEg0fE6_q8LHvV22Qvscgs,566
214
- uncountable/types/entity_t.py,sha256=c-3qBHq9-bWoo1g0ghcg8v6q5OXPwwEmE7iEH5oDif8,30934
214
+ uncountable/types/entity_t.py,sha256=mf9CxfFE0GgADFWNZP_jpVPeOuIq_SIluy5uXlXGdlo,31094
215
215
  uncountable/types/experiment_groups.py,sha256=qUpFOx1AKgzaT_4khCOv5Xs6jwiQGbvHH-GUh3v1nv4,288
216
216
  uncountable/types/experiment_groups_t.py,sha256=QjZBdjnbsD1D-VpPSSV6hBg-Q7mujjKvYtdMewtXNVU,712
217
217
  uncountable/types/exports.py,sha256=VMmxUO2PpV1Y63hZ2AnVor4H-B6aswJ7YpSru_u89lU,334
@@ -289,7 +289,7 @@ uncountable/types/runsheet_t.py,sha256=8h5BqmRxSmZsrQ1T0xe5G6jtgqraG5-FO_qG1Im04
289
289
  uncountable/types/secret_retrieval.py,sha256=xWAyjFgGbAtw9DPOhzLKF5sWtk15qbKmi03Ix5QLF9s,741
290
290
  uncountable/types/secret_retrieval_t.py,sha256=S0IdxggcOXuG740tSCg2GH3WPHtsBaWlA4dqBJW14hc,3298
291
291
  uncountable/types/sockets.py,sha256=OogyQ-pLyhJkV6JrBSLTOz9v6cDViYY5QM1ScSXPU3U,1208
292
- uncountable/types/sockets_t.py,sha256=ntYHzzmNJ5LGkst_vJsxbNYjAL4sAzkrEijlrRxHjns,5216
292
+ uncountable/types/sockets_t.py,sha256=-1Fkw7cQNQyhamqC8-MscNGHKx9ksHy8jtSHnPICmF8,5239
293
293
  uncountable/types/specs.py,sha256=RqRiYGXq5wo5lufgH9h9LPIbbdFAlOv1elAe_qTBK_c,484
294
294
  uncountable/types/specs_t.py,sha256=ibFkXRP0eEAq7uhsM-gmaSdn330W5hiSjD6Iz617lI4,1964
295
295
  uncountable/types/step_relationships.py,sha256=I6t7tj-VmHAhH8YpJPIUFBxPaRiXU_Zg-4Kf0g0pfHY,1073
@@ -438,7 +438,7 @@ uncountable/types/api/uploader/complete_async_parse.py,sha256=Os1HAubxTlbut6Gylj
438
438
  uncountable/types/api/uploader/invoke_uploader.py,sha256=cmy7zl3AMF_AH5PCAB67rBeTE6JIcaUqPzm2NS4k_AE,1907
439
439
  uncountable/types/api/user/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
440
440
  uncountable/types/api/user/get_current_user_info.py,sha256=BT7bGp5SOHz3XdKWhhdZ6acnInafT2PgdJ-H4YH3W7c,1181
441
- uncountablepythonsdk-0.0.187.dist-info/METADATA,sha256=9o2-KrSVgmr2N07XLPaYD7ucwbKJOCcp3iWowNMiIqk,2211
442
- uncountablepythonsdk-0.0.187.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
443
- uncountablepythonsdk-0.0.187.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
444
- uncountablepythonsdk-0.0.187.dist-info/RECORD,,
441
+ uncountablepythonsdk-0.0.188.dist-info/METADATA,sha256=b7sdPfIpCKJaQPdvrA2770ZJIP7pe1rA6x2GBFBJvr4,2211
442
+ uncountablepythonsdk-0.0.188.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
443
+ uncountablepythonsdk-0.0.188.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
444
+ uncountablepythonsdk-0.0.188.dist-info/RECORD,,