cognee 0.3.4.dev4__py3-none-any.whl → 0.3.5__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.
Files changed (183) hide show
  1. cognee/api/client.py +16 -7
  2. cognee/api/health.py +5 -9
  3. cognee/api/v1/add/add.py +3 -1
  4. cognee/api/v1/cognify/cognify.py +44 -7
  5. cognee/api/v1/permissions/routers/get_permissions_router.py +8 -4
  6. cognee/api/v1/search/search.py +3 -0
  7. cognee/api/v1/ui/__init__.py +1 -1
  8. cognee/api/v1/ui/ui.py +215 -150
  9. cognee/api/v1/update/__init__.py +1 -0
  10. cognee/api/v1/update/routers/__init__.py +1 -0
  11. cognee/api/v1/update/routers/get_update_router.py +90 -0
  12. cognee/api/v1/update/update.py +100 -0
  13. cognee/base_config.py +5 -2
  14. cognee/cli/_cognee.py +28 -10
  15. cognee/cli/commands/delete_command.py +34 -2
  16. cognee/eval_framework/corpus_builder/task_getters/get_default_tasks_by_indices.py +2 -2
  17. cognee/eval_framework/evaluation/direct_llm_eval_adapter.py +3 -2
  18. cognee/eval_framework/modal_eval_dashboard.py +9 -1
  19. cognee/infrastructure/databases/graph/config.py +9 -9
  20. cognee/infrastructure/databases/graph/get_graph_engine.py +4 -21
  21. cognee/infrastructure/databases/graph/kuzu/adapter.py +60 -9
  22. cognee/infrastructure/databases/hybrid/neptune_analytics/NeptuneAnalyticsAdapter.py +3 -3
  23. cognee/infrastructure/databases/relational/config.py +4 -4
  24. cognee/infrastructure/databases/relational/create_relational_engine.py +11 -3
  25. cognee/infrastructure/databases/vector/chromadb/ChromaDBAdapter.py +7 -3
  26. cognee/infrastructure/databases/vector/config.py +7 -7
  27. cognee/infrastructure/databases/vector/create_vector_engine.py +7 -15
  28. cognee/infrastructure/databases/vector/embeddings/EmbeddingEngine.py +9 -0
  29. cognee/infrastructure/databases/vector/embeddings/FastembedEmbeddingEngine.py +11 -0
  30. cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py +19 -2
  31. cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py +11 -0
  32. cognee/infrastructure/databases/vector/embeddings/config.py +8 -0
  33. cognee/infrastructure/databases/vector/embeddings/get_embedding_engine.py +5 -0
  34. cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py +11 -10
  35. cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py +48 -38
  36. cognee/infrastructure/databases/vector/vector_db_interface.py +8 -4
  37. cognee/infrastructure/files/storage/S3FileStorage.py +15 -5
  38. cognee/infrastructure/files/storage/s3_config.py +1 -0
  39. cognee/infrastructure/files/utils/open_data_file.py +7 -14
  40. cognee/infrastructure/llm/LLMGateway.py +19 -117
  41. cognee/infrastructure/llm/config.py +28 -13
  42. cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/extract_categories.py +2 -1
  43. cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/extract_event_entities.py +3 -2
  44. cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/extract_summary.py +3 -2
  45. cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/knowledge_graph/extract_content_graph.py +2 -1
  46. cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/knowledge_graph/extract_event_graph.py +3 -2
  47. cognee/infrastructure/llm/prompts/read_query_prompt.py +3 -2
  48. cognee/infrastructure/llm/prompts/show_prompt.py +35 -0
  49. cognee/infrastructure/llm/prompts/test.txt +1 -0
  50. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/__init__.py +2 -2
  51. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/async_client.py +50 -397
  52. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/inlinedbaml.py +2 -3
  53. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/parser.py +8 -88
  54. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/runtime.py +78 -0
  55. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/stream_types.py +2 -99
  56. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/sync_client.py +49 -401
  57. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/type_builder.py +19 -882
  58. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/type_map.py +2 -34
  59. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/types.py +2 -107
  60. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/acreate_structured_output.baml +26 -0
  61. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/__init__.py +1 -2
  62. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/acreate_structured_output.py +76 -0
  63. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/create_dynamic_baml_type.py +122 -0
  64. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/generators.baml +3 -3
  65. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/anthropic/adapter.py +0 -32
  66. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/gemini/adapter.py +107 -98
  67. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/adapter.py +5 -6
  68. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/get_llm_client.py +5 -6
  69. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/llm_interface.py +0 -26
  70. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/adapter.py +17 -67
  71. cognee/infrastructure/llm/tokenizer/Gemini/adapter.py +8 -7
  72. cognee/infrastructure/llm/utils.py +4 -4
  73. cognee/infrastructure/loaders/LoaderEngine.py +5 -2
  74. cognee/infrastructure/loaders/external/__init__.py +7 -0
  75. cognee/infrastructure/loaders/external/advanced_pdf_loader.py +244 -0
  76. cognee/infrastructure/loaders/supported_loaders.py +7 -0
  77. cognee/modules/data/methods/create_authorized_dataset.py +9 -0
  78. cognee/modules/data/methods/get_authorized_dataset.py +1 -1
  79. cognee/modules/data/methods/get_authorized_dataset_by_name.py +11 -0
  80. cognee/modules/data/methods/get_deletion_counts.py +92 -0
  81. cognee/modules/graph/cognee_graph/CogneeGraph.py +1 -1
  82. cognee/modules/graph/utils/expand_with_nodes_and_edges.py +22 -8
  83. cognee/modules/graph/utils/retrieve_existing_edges.py +0 -2
  84. cognee/modules/ingestion/data_types/TextData.py +0 -1
  85. cognee/modules/observability/get_observe.py +14 -0
  86. cognee/modules/observability/observers.py +1 -0
  87. cognee/modules/ontology/base_ontology_resolver.py +42 -0
  88. cognee/modules/ontology/get_default_ontology_resolver.py +41 -0
  89. cognee/modules/ontology/matching_strategies.py +53 -0
  90. cognee/modules/ontology/models.py +20 -0
  91. cognee/modules/ontology/ontology_config.py +24 -0
  92. cognee/modules/ontology/ontology_env_config.py +45 -0
  93. cognee/modules/ontology/rdf_xml/{OntologyResolver.py → RDFLibOntologyResolver.py} +20 -28
  94. cognee/modules/pipelines/layers/resolve_authorized_user_dataset.py +21 -24
  95. cognee/modules/pipelines/layers/resolve_authorized_user_datasets.py +3 -3
  96. cognee/modules/retrieval/code_retriever.py +2 -1
  97. cognee/modules/retrieval/context_providers/TripletSearchContextProvider.py +1 -4
  98. cognee/modules/retrieval/graph_completion_cot_retriever.py +6 -5
  99. cognee/modules/retrieval/graph_completion_retriever.py +0 -3
  100. cognee/modules/retrieval/insights_retriever.py +1 -1
  101. cognee/modules/retrieval/jaccard_retrival.py +60 -0
  102. cognee/modules/retrieval/lexical_retriever.py +123 -0
  103. cognee/modules/retrieval/natural_language_retriever.py +2 -1
  104. cognee/modules/retrieval/temporal_retriever.py +3 -2
  105. cognee/modules/retrieval/utils/brute_force_triplet_search.py +2 -12
  106. cognee/modules/retrieval/utils/completion.py +4 -7
  107. cognee/modules/search/methods/get_search_type_tools.py +7 -0
  108. cognee/modules/search/methods/no_access_control_search.py +1 -1
  109. cognee/modules/search/methods/search.py +32 -13
  110. cognee/modules/search/types/SearchType.py +1 -0
  111. cognee/modules/users/permissions/methods/authorized_give_permission_on_datasets.py +12 -0
  112. cognee/modules/users/permissions/methods/check_permission_on_dataset.py +11 -0
  113. cognee/modules/users/permissions/methods/get_all_user_permission_datasets.py +10 -0
  114. cognee/modules/users/permissions/methods/get_document_ids_for_user.py +10 -0
  115. cognee/modules/users/permissions/methods/get_principal.py +9 -0
  116. cognee/modules/users/permissions/methods/get_principal_datasets.py +11 -0
  117. cognee/modules/users/permissions/methods/get_role.py +10 -0
  118. cognee/modules/users/permissions/methods/get_specific_user_permission_datasets.py +3 -3
  119. cognee/modules/users/permissions/methods/get_tenant.py +9 -0
  120. cognee/modules/users/permissions/methods/give_default_permission_to_role.py +9 -0
  121. cognee/modules/users/permissions/methods/give_default_permission_to_tenant.py +9 -0
  122. cognee/modules/users/permissions/methods/give_default_permission_to_user.py +9 -0
  123. cognee/modules/users/permissions/methods/give_permission_on_dataset.py +10 -0
  124. cognee/modules/users/roles/methods/add_user_to_role.py +11 -0
  125. cognee/modules/users/roles/methods/create_role.py +12 -1
  126. cognee/modules/users/tenants/methods/add_user_to_tenant.py +12 -0
  127. cognee/modules/users/tenants/methods/create_tenant.py +12 -1
  128. cognee/modules/visualization/cognee_network_visualization.py +13 -9
  129. cognee/shared/data_models.py +0 -1
  130. cognee/shared/utils.py +0 -32
  131. cognee/tasks/chunk_naive_llm_classifier/chunk_naive_llm_classifier.py +2 -2
  132. cognee/tasks/codingagents/coding_rule_associations.py +3 -2
  133. cognee/tasks/entity_completion/entity_extractors/llm_entity_extractor.py +3 -2
  134. cognee/tasks/graph/cascade_extract/utils/extract_content_nodes_and_relationship_names.py +3 -2
  135. cognee/tasks/graph/cascade_extract/utils/extract_edge_triplets.py +3 -2
  136. cognee/tasks/graph/cascade_extract/utils/extract_nodes.py +3 -2
  137. cognee/tasks/graph/extract_graph_from_code.py +2 -2
  138. cognee/tasks/graph/extract_graph_from_data.py +55 -12
  139. cognee/tasks/graph/extract_graph_from_data_v2.py +16 -4
  140. cognee/tasks/ingestion/migrate_relational_database.py +132 -41
  141. cognee/tasks/ingestion/resolve_data_directories.py +4 -1
  142. cognee/tasks/schema/ingest_database_schema.py +134 -0
  143. cognee/tasks/schema/models.py +40 -0
  144. cognee/tasks/storage/index_data_points.py +1 -1
  145. cognee/tasks/storage/index_graph_edges.py +3 -1
  146. cognee/tasks/summarization/summarize_code.py +2 -2
  147. cognee/tasks/summarization/summarize_text.py +2 -2
  148. cognee/tasks/temporal_graph/enrich_events.py +2 -2
  149. cognee/tasks/temporal_graph/extract_events_and_entities.py +2 -2
  150. cognee/tests/cli_tests/cli_unit_tests/test_cli_commands.py +13 -4
  151. cognee/tests/cli_tests/cli_unit_tests/test_cli_edge_cases.py +13 -3
  152. cognee/tests/test_advanced_pdf_loader.py +141 -0
  153. cognee/tests/test_chromadb.py +40 -0
  154. cognee/tests/test_cognee_server_start.py +6 -1
  155. cognee/tests/test_data/Quantum_computers.txt +9 -0
  156. cognee/tests/test_lancedb.py +211 -0
  157. cognee/tests/test_pgvector.py +40 -0
  158. cognee/tests/test_relational_db_migration.py +76 -0
  159. cognee/tests/unit/infrastructure/databases/test_index_graph_edges.py +2 -1
  160. cognee/tests/unit/modules/ontology/test_ontology_adapter.py +330 -13
  161. cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py +0 -4
  162. cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py +0 -4
  163. cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py +0 -4
  164. {cognee-0.3.4.dev4.dist-info → cognee-0.3.5.dist-info}/METADATA +92 -96
  165. {cognee-0.3.4.dev4.dist-info → cognee-0.3.5.dist-info}/RECORD +173 -159
  166. distributed/pyproject.toml +0 -1
  167. cognee/infrastructure/data/utils/extract_keywords.py +0 -48
  168. cognee/infrastructure/databases/hybrid/falkordb/FalkorDBAdapter.py +0 -1227
  169. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extract_categories.baml +0 -109
  170. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extract_content_graph.baml +0 -343
  171. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/extract_categories.py +0 -0
  172. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/extract_summary.py +0 -89
  173. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/knowledge_graph/__init__.py +0 -0
  174. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/knowledge_graph/extract_content_graph.py +0 -44
  175. cognee/tasks/graph/infer_data_ontology.py +0 -309
  176. cognee/tests/test_falkordb.py +0 -174
  177. /cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/__init__.py +0 -0
  178. /cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/knowledge_graph/__init__.py +0 -0
  179. /cognee/infrastructure/llm/{structured_output_framework/litellm_instructor/extraction → extraction}/texts.json +0 -0
  180. {cognee-0.3.4.dev4.dist-info → cognee-0.3.5.dist-info}/WHEEL +0 -0
  181. {cognee-0.3.4.dev4.dist-info → cognee-0.3.5.dist-info}/entry_points.txt +0 -0
  182. {cognee-0.3.4.dev4.dist-info → cognee-0.3.5.dist-info}/licenses/LICENSE +0 -0
  183. {cognee-0.3.4.dev4.dist-info → cognee-0.3.5.dist-info}/licenses/NOTICE.md +0 -0
@@ -13,6 +13,9 @@
13
13
  import typing
14
14
  from baml_py import type_builder
15
15
  from baml_py import baml_py
16
+
17
+ # These are exports, not used here, hence the linter is disabled
18
+ from baml_py.baml_py import FieldType, EnumValueBuilder, EnumBuilder, ClassBuilder # noqa: F401 # pylint: disable=unused-import
16
19
  from .globals import DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME
17
20
 
18
21
 
@@ -21,23 +24,7 @@ class TypeBuilder(type_builder.TypeBuilder):
21
24
  super().__init__(
22
25
  classes=set(
23
26
  [
24
- "AudioContent",
25
- "ContentLabel",
26
- "DefaultContentPrediction",
27
- "DynamicKnowledgeGraph",
28
- "Edge",
29
- "ImageContent",
30
- "KnowledgeGraph",
31
- "Model3DContent",
32
- "MultimediaContent",
33
- "Node",
34
- "ProceduralContent",
35
- "SummarizedClass",
36
- "SummarizedCode",
37
- "SummarizedContent",
38
- "SummarizedFunction",
39
- "TextContent",
40
- "VideoContent",
27
+ "ResponseModel",
41
28
  ]
42
29
  ),
43
30
  enums=set([]),
@@ -49,76 +36,12 @@ class TypeBuilder(type_builder.TypeBuilder):
49
36
  # #########################################################################
50
37
 
51
38
  # #########################################################################
52
- # Generated classes 17
39
+ # Generated classes 1
53
40
  # #########################################################################
54
41
 
55
42
  @property
56
- def AudioContent(self) -> "AudioContentViewer":
57
- return AudioContentViewer(self)
58
-
59
- @property
60
- def ContentLabel(self) -> "ContentLabelViewer":
61
- return ContentLabelViewer(self)
62
-
63
- @property
64
- def DefaultContentPrediction(self) -> "DefaultContentPredictionViewer":
65
- return DefaultContentPredictionViewer(self)
66
-
67
- @property
68
- def DynamicKnowledgeGraph(self) -> "DynamicKnowledgeGraphBuilder":
69
- return DynamicKnowledgeGraphBuilder(self)
70
-
71
- @property
72
- def Edge(self) -> "EdgeViewer":
73
- return EdgeViewer(self)
74
-
75
- @property
76
- def ImageContent(self) -> "ImageContentViewer":
77
- return ImageContentViewer(self)
78
-
79
- @property
80
- def KnowledgeGraph(self) -> "KnowledgeGraphViewer":
81
- return KnowledgeGraphViewer(self)
82
-
83
- @property
84
- def Model3DContent(self) -> "Model3DContentViewer":
85
- return Model3DContentViewer(self)
86
-
87
- @property
88
- def MultimediaContent(self) -> "MultimediaContentViewer":
89
- return MultimediaContentViewer(self)
90
-
91
- @property
92
- def Node(self) -> "NodeBuilder":
93
- return NodeBuilder(self)
94
-
95
- @property
96
- def ProceduralContent(self) -> "ProceduralContentViewer":
97
- return ProceduralContentViewer(self)
98
-
99
- @property
100
- def SummarizedClass(self) -> "SummarizedClassViewer":
101
- return SummarizedClassViewer(self)
102
-
103
- @property
104
- def SummarizedCode(self) -> "SummarizedCodeViewer":
105
- return SummarizedCodeViewer(self)
106
-
107
- @property
108
- def SummarizedContent(self) -> "SummarizedContentViewer":
109
- return SummarizedContentViewer(self)
110
-
111
- @property
112
- def SummarizedFunction(self) -> "SummarizedFunctionViewer":
113
- return SummarizedFunctionViewer(self)
114
-
115
- @property
116
- def TextContent(self) -> "TextContentViewer":
117
- return TextContentViewer(self)
118
-
119
- @property
120
- def VideoContent(self) -> "VideoContentViewer":
121
- return VideoContentViewer(self)
43
+ def ResponseModel(self) -> "ResponseModelBuilder":
44
+ return ResponseModelBuilder(self)
122
45
 
123
46
 
124
47
  # #########################################################################
@@ -127,161 +50,26 @@ class TypeBuilder(type_builder.TypeBuilder):
127
50
 
128
51
 
129
52
  # #########################################################################
130
- # Generated classes 17
53
+ # Generated classes 1
131
54
  # #########################################################################
132
55
 
133
56
 
134
- class AudioContentAst:
57
+ class ResponseModelAst:
135
58
  def __init__(self, tb: type_builder.TypeBuilder):
136
59
  _tb = tb._tb # type: ignore (we know how to use this private attribute)
137
- self._bldr = _tb.class_("AudioContent")
138
- self._properties: typing.Set[str] = set(
139
- [
140
- "type",
141
- "subclass",
142
- ]
143
- )
144
- self._props = AudioContentProperties(self._bldr, self._properties)
145
-
146
- def type(self) -> baml_py.FieldType:
147
- return self._bldr.field()
148
-
149
- @property
150
- def props(self) -> "AudioContentProperties":
151
- return self._props
152
-
153
-
154
- class AudioContentViewer(AudioContentAst):
155
- def __init__(self, tb: type_builder.TypeBuilder):
156
- super().__init__(tb)
157
-
158
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
159
- return [
160
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
161
- for name in self._properties
162
- ]
163
-
164
-
165
- class AudioContentProperties:
166
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
167
- self.__bldr = bldr
168
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
169
-
170
- @property
171
- def type(self) -> type_builder.ClassPropertyViewer:
172
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
173
-
174
- @property
175
- def subclass(self) -> type_builder.ClassPropertyViewer:
176
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
177
-
178
-
179
- class ContentLabelAst:
180
- def __init__(self, tb: type_builder.TypeBuilder):
181
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
182
- self._bldr = _tb.class_("ContentLabel")
183
- self._properties: typing.Set[str] = set(
184
- [
185
- "content_type",
186
- "type",
187
- "subclass",
188
- ]
189
- )
190
- self._props = ContentLabelProperties(self._bldr, self._properties)
191
-
192
- def type(self) -> baml_py.FieldType:
193
- return self._bldr.field()
194
-
195
- @property
196
- def props(self) -> "ContentLabelProperties":
197
- return self._props
198
-
199
-
200
- class ContentLabelViewer(ContentLabelAst):
201
- def __init__(self, tb: type_builder.TypeBuilder):
202
- super().__init__(tb)
203
-
204
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
205
- return [
206
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
207
- for name in self._properties
208
- ]
209
-
210
-
211
- class ContentLabelProperties:
212
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
213
- self.__bldr = bldr
214
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
215
-
216
- @property
217
- def content_type(self) -> type_builder.ClassPropertyViewer:
218
- return type_builder.ClassPropertyViewer(self.__bldr.property("content_type"))
219
-
220
- @property
221
- def type(self) -> type_builder.ClassPropertyViewer:
222
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
223
-
224
- @property
225
- def subclass(self) -> type_builder.ClassPropertyViewer:
226
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
227
-
228
-
229
- class DefaultContentPredictionAst:
230
- def __init__(self, tb: type_builder.TypeBuilder):
231
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
232
- self._bldr = _tb.class_("DefaultContentPrediction")
233
- self._properties: typing.Set[str] = set(
234
- [
235
- "label",
236
- ]
237
- )
238
- self._props = DefaultContentPredictionProperties(self._bldr, self._properties)
239
-
240
- def type(self) -> baml_py.FieldType:
241
- return self._bldr.field()
242
-
243
- @property
244
- def props(self) -> "DefaultContentPredictionProperties":
245
- return self._props
246
-
247
-
248
- class DefaultContentPredictionViewer(DefaultContentPredictionAst):
249
- def __init__(self, tb: type_builder.TypeBuilder):
250
- super().__init__(tb)
251
-
252
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
253
- return [
254
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
255
- for name in self._properties
256
- ]
257
-
258
-
259
- class DefaultContentPredictionProperties:
260
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
261
- self.__bldr = bldr
262
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
263
-
264
- @property
265
- def label(self) -> type_builder.ClassPropertyViewer:
266
- return type_builder.ClassPropertyViewer(self.__bldr.property("label"))
267
-
268
-
269
- class DynamicKnowledgeGraphAst:
270
- def __init__(self, tb: type_builder.TypeBuilder):
271
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
272
- self._bldr = _tb.class_("DynamicKnowledgeGraph")
60
+ self._bldr = _tb.class_("ResponseModel")
273
61
  self._properties: typing.Set[str] = set([])
274
- self._props = DynamicKnowledgeGraphProperties(self._bldr, self._properties)
62
+ self._props = ResponseModelProperties(self._bldr, self._properties)
275
63
 
276
64
  def type(self) -> baml_py.FieldType:
277
65
  return self._bldr.field()
278
66
 
279
67
  @property
280
- def props(self) -> "DynamicKnowledgeGraphProperties":
68
+ def props(self) -> "ResponseModelProperties":
281
69
  return self._props
282
70
 
283
71
 
284
- class DynamicKnowledgeGraphBuilder(DynamicKnowledgeGraphAst):
72
+ class ResponseModelBuilder(ResponseModelAst):
285
73
  def __init__(self, tb: type_builder.TypeBuilder):
286
74
  super().__init__(tb)
287
75
 
@@ -291,286 +79,16 @@ class DynamicKnowledgeGraphBuilder(DynamicKnowledgeGraphAst):
291
79
  return self._bldr.property(name).type(type)
292
80
 
293
81
  def list_properties(self) -> typing.List[typing.Tuple[str, baml_py.ClassPropertyBuilder]]:
294
- return [(name, self._bldr.property(name)) for name in self._properties]
295
-
296
-
297
- class DynamicKnowledgeGraphProperties:
298
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
299
- self.__bldr = bldr
300
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
301
-
302
- def __getattr__(self, name: str) -> baml_py.ClassPropertyBuilder:
303
- if name not in self.__properties:
304
- raise AttributeError(f"Property {name} not found.")
305
- return self.__bldr.property(name)
306
-
307
-
308
- class EdgeAst:
309
- def __init__(self, tb: type_builder.TypeBuilder):
310
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
311
- self._bldr = _tb.class_("Edge")
312
- self._properties: typing.Set[str] = set(
313
- [
314
- "source_node_id",
315
- "target_node_id",
316
- "relationship_name",
317
- ]
318
- )
319
- self._props = EdgeProperties(self._bldr, self._properties)
320
-
321
- def type(self) -> baml_py.FieldType:
322
- return self._bldr.field()
323
-
324
- @property
325
- def props(self) -> "EdgeProperties":
326
- return self._props
327
-
328
-
329
- class EdgeViewer(EdgeAst):
330
- def __init__(self, tb: type_builder.TypeBuilder):
331
- super().__init__(tb)
332
-
333
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
334
- return [
335
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
336
- for name in self._properties
337
- ]
338
-
339
-
340
- class EdgeProperties:
341
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
342
- self.__bldr = bldr
343
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
344
-
345
- @property
346
- def source_node_id(self) -> type_builder.ClassPropertyViewer:
347
- return type_builder.ClassPropertyViewer(self.__bldr.property("source_node_id"))
348
-
349
- @property
350
- def target_node_id(self) -> type_builder.ClassPropertyViewer:
351
- return type_builder.ClassPropertyViewer(self.__bldr.property("target_node_id"))
352
-
353
- @property
354
- def relationship_name(self) -> type_builder.ClassPropertyViewer:
355
- return type_builder.ClassPropertyViewer(self.__bldr.property("relationship_name"))
356
-
357
-
358
- class ImageContentAst:
359
- def __init__(self, tb: type_builder.TypeBuilder):
360
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
361
- self._bldr = _tb.class_("ImageContent")
362
- self._properties: typing.Set[str] = set(
363
- [
364
- "type",
365
- "subclass",
366
- ]
367
- )
368
- self._props = ImageContentProperties(self._bldr, self._properties)
369
-
370
- def type(self) -> baml_py.FieldType:
371
- return self._bldr.field()
372
-
373
- @property
374
- def props(self) -> "ImageContentProperties":
375
- return self._props
376
-
377
-
378
- class ImageContentViewer(ImageContentAst):
379
- def __init__(self, tb: type_builder.TypeBuilder):
380
- super().__init__(tb)
381
-
382
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
383
- return [
384
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
385
- for name in self._properties
386
- ]
387
-
388
-
389
- class ImageContentProperties:
390
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
391
- self.__bldr = bldr
392
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
393
-
394
- @property
395
- def type(self) -> type_builder.ClassPropertyViewer:
396
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
397
-
398
- @property
399
- def subclass(self) -> type_builder.ClassPropertyViewer:
400
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
401
-
402
-
403
- class KnowledgeGraphAst:
404
- def __init__(self, tb: type_builder.TypeBuilder):
405
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
406
- self._bldr = _tb.class_("KnowledgeGraph")
407
- self._properties: typing.Set[str] = set(
408
- [
409
- "nodes",
410
- "edges",
411
- ]
412
- )
413
- self._props = KnowledgeGraphProperties(self._bldr, self._properties)
414
-
415
- def type(self) -> baml_py.FieldType:
416
- return self._bldr.field()
417
-
418
- @property
419
- def props(self) -> "KnowledgeGraphProperties":
420
- return self._props
421
-
422
-
423
- class KnowledgeGraphViewer(KnowledgeGraphAst):
424
- def __init__(self, tb: type_builder.TypeBuilder):
425
- super().__init__(tb)
426
-
427
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
428
- return [
429
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
430
- for name in self._properties
431
- ]
432
-
433
-
434
- class KnowledgeGraphProperties:
435
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
436
- self.__bldr = bldr
437
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
438
-
439
- @property
440
- def nodes(self) -> type_builder.ClassPropertyViewer:
441
- return type_builder.ClassPropertyViewer(self.__bldr.property("nodes"))
442
-
443
- @property
444
- def edges(self) -> type_builder.ClassPropertyViewer:
445
- return type_builder.ClassPropertyViewer(self.__bldr.property("edges"))
446
-
447
-
448
- class Model3DContentAst:
449
- def __init__(self, tb: type_builder.TypeBuilder):
450
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
451
- self._bldr = _tb.class_("Model3DContent")
452
- self._properties: typing.Set[str] = set(
453
- [
454
- "type",
455
- "subclass",
456
- ]
457
- )
458
- self._props = Model3DContentProperties(self._bldr, self._properties)
459
-
460
- def type(self) -> baml_py.FieldType:
461
- return self._bldr.field()
462
-
463
- @property
464
- def props(self) -> "Model3DContentProperties":
465
- return self._props
466
-
467
-
468
- class Model3DContentViewer(Model3DContentAst):
469
- def __init__(self, tb: type_builder.TypeBuilder):
470
- super().__init__(tb)
471
-
472
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
473
- return [
474
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
475
- for name in self._properties
476
- ]
477
-
478
-
479
- class Model3DContentProperties:
480
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
481
- self.__bldr = bldr
482
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
483
-
484
- @property
485
- def type(self) -> type_builder.ClassPropertyViewer:
486
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
487
-
488
- @property
489
- def subclass(self) -> type_builder.ClassPropertyViewer:
490
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
491
-
492
-
493
- class MultimediaContentAst:
494
- def __init__(self, tb: type_builder.TypeBuilder):
495
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
496
- self._bldr = _tb.class_("MultimediaContent")
497
- self._properties: typing.Set[str] = set(
498
- [
499
- "type",
500
- "subclass",
501
- ]
502
- )
503
- self._props = MultimediaContentProperties(self._bldr, self._properties)
504
-
505
- def type(self) -> baml_py.FieldType:
506
- return self._bldr.field()
507
-
508
- @property
509
- def props(self) -> "MultimediaContentProperties":
510
- return self._props
511
-
512
-
513
- class MultimediaContentViewer(MultimediaContentAst):
514
- def __init__(self, tb: type_builder.TypeBuilder):
515
- super().__init__(tb)
516
-
517
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
518
- return [
519
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
520
- for name in self._properties
521
- ]
522
-
523
-
524
- class MultimediaContentProperties:
525
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
526
- self.__bldr = bldr
527
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
528
-
529
- @property
530
- def type(self) -> type_builder.ClassPropertyViewer:
531
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
532
-
533
- @property
534
- def subclass(self) -> type_builder.ClassPropertyViewer:
535
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
536
-
537
-
538
- class NodeAst:
539
- def __init__(self, tb: type_builder.TypeBuilder):
540
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
541
- self._bldr = _tb.class_("Node")
542
- self._properties: typing.Set[str] = set(
543
- [
544
- "id",
545
- "name",
546
- "type",
547
- "description",
548
- ]
549
- )
550
- self._props = NodeProperties(self._bldr, self._properties)
551
-
552
- def type(self) -> baml_py.FieldType:
553
- return self._bldr.field()
82
+ return self._bldr.list_properties()
554
83
 
555
- @property
556
- def props(self) -> "NodeProperties":
557
- return self._props
84
+ def remove_property(self, name: str) -> None:
85
+ self._bldr.remove_property(name)
558
86
 
87
+ def reset(self) -> None:
88
+ self._bldr.reset()
559
89
 
560
- class NodeBuilder(NodeAst):
561
- def __init__(self, tb: type_builder.TypeBuilder):
562
- super().__init__(tb)
563
-
564
- def add_property(self, name: str, type: baml_py.FieldType) -> baml_py.ClassPropertyBuilder:
565
- if name in self._properties:
566
- raise ValueError(f"Property {name} already exists.")
567
- return self._bldr.property(name).type(type)
568
-
569
- def list_properties(self) -> typing.List[typing.Tuple[str, baml_py.ClassPropertyBuilder]]:
570
- return [(name, self._bldr.property(name)) for name in self._properties]
571
90
 
572
-
573
- class NodeProperties:
91
+ class ResponseModelProperties:
574
92
  def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
575
93
  self.__bldr = bldr
576
94
  self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
@@ -579,384 +97,3 @@ class NodeProperties:
579
97
  if name not in self.__properties:
580
98
  raise AttributeError(f"Property {name} not found.")
581
99
  return self.__bldr.property(name)
582
-
583
- @property
584
- def id(self) -> baml_py.ClassPropertyBuilder:
585
- return self.__bldr.property("id")
586
-
587
- @property
588
- def name(self) -> baml_py.ClassPropertyBuilder:
589
- return self.__bldr.property("name")
590
-
591
- @property
592
- def type(self) -> baml_py.ClassPropertyBuilder:
593
- return self.__bldr.property("type")
594
-
595
- @property
596
- def description(self) -> baml_py.ClassPropertyBuilder:
597
- return self.__bldr.property("description")
598
-
599
-
600
- class ProceduralContentAst:
601
- def __init__(self, tb: type_builder.TypeBuilder):
602
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
603
- self._bldr = _tb.class_("ProceduralContent")
604
- self._properties: typing.Set[str] = set(
605
- [
606
- "type",
607
- "subclass",
608
- ]
609
- )
610
- self._props = ProceduralContentProperties(self._bldr, self._properties)
611
-
612
- def type(self) -> baml_py.FieldType:
613
- return self._bldr.field()
614
-
615
- @property
616
- def props(self) -> "ProceduralContentProperties":
617
- return self._props
618
-
619
-
620
- class ProceduralContentViewer(ProceduralContentAst):
621
- def __init__(self, tb: type_builder.TypeBuilder):
622
- super().__init__(tb)
623
-
624
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
625
- return [
626
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
627
- for name in self._properties
628
- ]
629
-
630
-
631
- class ProceduralContentProperties:
632
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
633
- self.__bldr = bldr
634
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
635
-
636
- @property
637
- def type(self) -> type_builder.ClassPropertyViewer:
638
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
639
-
640
- @property
641
- def subclass(self) -> type_builder.ClassPropertyViewer:
642
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
643
-
644
-
645
- class SummarizedClassAst:
646
- def __init__(self, tb: type_builder.TypeBuilder):
647
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
648
- self._bldr = _tb.class_("SummarizedClass")
649
- self._properties: typing.Set[str] = set(
650
- [
651
- "name",
652
- "description",
653
- "methods",
654
- "decorators",
655
- ]
656
- )
657
- self._props = SummarizedClassProperties(self._bldr, self._properties)
658
-
659
- def type(self) -> baml_py.FieldType:
660
- return self._bldr.field()
661
-
662
- @property
663
- def props(self) -> "SummarizedClassProperties":
664
- return self._props
665
-
666
-
667
- class SummarizedClassViewer(SummarizedClassAst):
668
- def __init__(self, tb: type_builder.TypeBuilder):
669
- super().__init__(tb)
670
-
671
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
672
- return [
673
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
674
- for name in self._properties
675
- ]
676
-
677
-
678
- class SummarizedClassProperties:
679
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
680
- self.__bldr = bldr
681
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
682
-
683
- @property
684
- def name(self) -> type_builder.ClassPropertyViewer:
685
- return type_builder.ClassPropertyViewer(self.__bldr.property("name"))
686
-
687
- @property
688
- def description(self) -> type_builder.ClassPropertyViewer:
689
- return type_builder.ClassPropertyViewer(self.__bldr.property("description"))
690
-
691
- @property
692
- def methods(self) -> type_builder.ClassPropertyViewer:
693
- return type_builder.ClassPropertyViewer(self.__bldr.property("methods"))
694
-
695
- @property
696
- def decorators(self) -> type_builder.ClassPropertyViewer:
697
- return type_builder.ClassPropertyViewer(self.__bldr.property("decorators"))
698
-
699
-
700
- class SummarizedCodeAst:
701
- def __init__(self, tb: type_builder.TypeBuilder):
702
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
703
- self._bldr = _tb.class_("SummarizedCode")
704
- self._properties: typing.Set[str] = set(
705
- [
706
- "high_level_summary",
707
- "key_features",
708
- "imports",
709
- "constants",
710
- "classes",
711
- "functions",
712
- "workflow_description",
713
- ]
714
- )
715
- self._props = SummarizedCodeProperties(self._bldr, self._properties)
716
-
717
- def type(self) -> baml_py.FieldType:
718
- return self._bldr.field()
719
-
720
- @property
721
- def props(self) -> "SummarizedCodeProperties":
722
- return self._props
723
-
724
-
725
- class SummarizedCodeViewer(SummarizedCodeAst):
726
- def __init__(self, tb: type_builder.TypeBuilder):
727
- super().__init__(tb)
728
-
729
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
730
- return [
731
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
732
- for name in self._properties
733
- ]
734
-
735
-
736
- class SummarizedCodeProperties:
737
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
738
- self.__bldr = bldr
739
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
740
-
741
- @property
742
- def high_level_summary(self) -> type_builder.ClassPropertyViewer:
743
- return type_builder.ClassPropertyViewer(self.__bldr.property("high_level_summary"))
744
-
745
- @property
746
- def key_features(self) -> type_builder.ClassPropertyViewer:
747
- return type_builder.ClassPropertyViewer(self.__bldr.property("key_features"))
748
-
749
- @property
750
- def imports(self) -> type_builder.ClassPropertyViewer:
751
- return type_builder.ClassPropertyViewer(self.__bldr.property("imports"))
752
-
753
- @property
754
- def constants(self) -> type_builder.ClassPropertyViewer:
755
- return type_builder.ClassPropertyViewer(self.__bldr.property("constants"))
756
-
757
- @property
758
- def classes(self) -> type_builder.ClassPropertyViewer:
759
- return type_builder.ClassPropertyViewer(self.__bldr.property("classes"))
760
-
761
- @property
762
- def functions(self) -> type_builder.ClassPropertyViewer:
763
- return type_builder.ClassPropertyViewer(self.__bldr.property("functions"))
764
-
765
- @property
766
- def workflow_description(self) -> type_builder.ClassPropertyViewer:
767
- return type_builder.ClassPropertyViewer(self.__bldr.property("workflow_description"))
768
-
769
-
770
- class SummarizedContentAst:
771
- def __init__(self, tb: type_builder.TypeBuilder):
772
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
773
- self._bldr = _tb.class_("SummarizedContent")
774
- self._properties: typing.Set[str] = set(
775
- [
776
- "summary",
777
- "description",
778
- ]
779
- )
780
- self._props = SummarizedContentProperties(self._bldr, self._properties)
781
-
782
- def type(self) -> baml_py.FieldType:
783
- return self._bldr.field()
784
-
785
- @property
786
- def props(self) -> "SummarizedContentProperties":
787
- return self._props
788
-
789
-
790
- class SummarizedContentViewer(SummarizedContentAst):
791
- def __init__(self, tb: type_builder.TypeBuilder):
792
- super().__init__(tb)
793
-
794
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
795
- return [
796
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
797
- for name in self._properties
798
- ]
799
-
800
-
801
- class SummarizedContentProperties:
802
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
803
- self.__bldr = bldr
804
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
805
-
806
- @property
807
- def summary(self) -> type_builder.ClassPropertyViewer:
808
- return type_builder.ClassPropertyViewer(self.__bldr.property("summary"))
809
-
810
- @property
811
- def description(self) -> type_builder.ClassPropertyViewer:
812
- return type_builder.ClassPropertyViewer(self.__bldr.property("description"))
813
-
814
-
815
- class SummarizedFunctionAst:
816
- def __init__(self, tb: type_builder.TypeBuilder):
817
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
818
- self._bldr = _tb.class_("SummarizedFunction")
819
- self._properties: typing.Set[str] = set(
820
- [
821
- "name",
822
- "description",
823
- "inputs",
824
- "outputs",
825
- "decorators",
826
- ]
827
- )
828
- self._props = SummarizedFunctionProperties(self._bldr, self._properties)
829
-
830
- def type(self) -> baml_py.FieldType:
831
- return self._bldr.field()
832
-
833
- @property
834
- def props(self) -> "SummarizedFunctionProperties":
835
- return self._props
836
-
837
-
838
- class SummarizedFunctionViewer(SummarizedFunctionAst):
839
- def __init__(self, tb: type_builder.TypeBuilder):
840
- super().__init__(tb)
841
-
842
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
843
- return [
844
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
845
- for name in self._properties
846
- ]
847
-
848
-
849
- class SummarizedFunctionProperties:
850
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
851
- self.__bldr = bldr
852
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
853
-
854
- @property
855
- def name(self) -> type_builder.ClassPropertyViewer:
856
- return type_builder.ClassPropertyViewer(self.__bldr.property("name"))
857
-
858
- @property
859
- def description(self) -> type_builder.ClassPropertyViewer:
860
- return type_builder.ClassPropertyViewer(self.__bldr.property("description"))
861
-
862
- @property
863
- def inputs(self) -> type_builder.ClassPropertyViewer:
864
- return type_builder.ClassPropertyViewer(self.__bldr.property("inputs"))
865
-
866
- @property
867
- def outputs(self) -> type_builder.ClassPropertyViewer:
868
- return type_builder.ClassPropertyViewer(self.__bldr.property("outputs"))
869
-
870
- @property
871
- def decorators(self) -> type_builder.ClassPropertyViewer:
872
- return type_builder.ClassPropertyViewer(self.__bldr.property("decorators"))
873
-
874
-
875
- class TextContentAst:
876
- def __init__(self, tb: type_builder.TypeBuilder):
877
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
878
- self._bldr = _tb.class_("TextContent")
879
- self._properties: typing.Set[str] = set(
880
- [
881
- "type",
882
- "subclass",
883
- ]
884
- )
885
- self._props = TextContentProperties(self._bldr, self._properties)
886
-
887
- def type(self) -> baml_py.FieldType:
888
- return self._bldr.field()
889
-
890
- @property
891
- def props(self) -> "TextContentProperties":
892
- return self._props
893
-
894
-
895
- class TextContentViewer(TextContentAst):
896
- def __init__(self, tb: type_builder.TypeBuilder):
897
- super().__init__(tb)
898
-
899
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
900
- return [
901
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
902
- for name in self._properties
903
- ]
904
-
905
-
906
- class TextContentProperties:
907
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
908
- self.__bldr = bldr
909
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
910
-
911
- @property
912
- def type(self) -> type_builder.ClassPropertyViewer:
913
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
914
-
915
- @property
916
- def subclass(self) -> type_builder.ClassPropertyViewer:
917
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))
918
-
919
-
920
- class VideoContentAst:
921
- def __init__(self, tb: type_builder.TypeBuilder):
922
- _tb = tb._tb # type: ignore (we know how to use this private attribute)
923
- self._bldr = _tb.class_("VideoContent")
924
- self._properties: typing.Set[str] = set(
925
- [
926
- "type",
927
- "subclass",
928
- ]
929
- )
930
- self._props = VideoContentProperties(self._bldr, self._properties)
931
-
932
- def type(self) -> baml_py.FieldType:
933
- return self._bldr.field()
934
-
935
- @property
936
- def props(self) -> "VideoContentProperties":
937
- return self._props
938
-
939
-
940
- class VideoContentViewer(VideoContentAst):
941
- def __init__(self, tb: type_builder.TypeBuilder):
942
- super().__init__(tb)
943
-
944
- def list_properties(self) -> typing.List[typing.Tuple[str, type_builder.ClassPropertyViewer]]:
945
- return [
946
- (name, type_builder.ClassPropertyViewer(self._bldr.property(name)))
947
- for name in self._properties
948
- ]
949
-
950
-
951
- class VideoContentProperties:
952
- def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
953
- self.__bldr = bldr
954
- self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
955
-
956
- @property
957
- def type(self) -> type_builder.ClassPropertyViewer:
958
- return type_builder.ClassPropertyViewer(self.__bldr.property("type"))
959
-
960
- @property
961
- def subclass(self) -> type_builder.ClassPropertyViewer:
962
- return type_builder.ClassPropertyViewer(self.__bldr.property("subclass"))