cognee 0.2.1.dev7__py3-none-any.whl → 0.2.2.dev1__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 (223) hide show
  1. cognee/api/client.py +44 -4
  2. cognee/api/health.py +332 -0
  3. cognee/api/v1/add/add.py +5 -2
  4. cognee/api/v1/add/routers/get_add_router.py +3 -0
  5. cognee/api/v1/cognify/code_graph_pipeline.py +3 -1
  6. cognee/api/v1/cognify/cognify.py +8 -0
  7. cognee/api/v1/cognify/routers/get_cognify_router.py +8 -1
  8. cognee/api/v1/config/config.py +3 -1
  9. cognee/api/v1/datasets/routers/get_datasets_router.py +2 -8
  10. cognee/api/v1/delete/delete.py +16 -12
  11. cognee/api/v1/responses/routers/get_responses_router.py +3 -1
  12. cognee/api/v1/search/search.py +10 -0
  13. cognee/api/v1/settings/routers/get_settings_router.py +0 -2
  14. cognee/base_config.py +1 -0
  15. cognee/eval_framework/evaluation/direct_llm_eval_adapter.py +5 -6
  16. cognee/infrastructure/databases/graph/config.py +2 -0
  17. cognee/infrastructure/databases/graph/get_graph_engine.py +58 -12
  18. cognee/infrastructure/databases/graph/graph_db_interface.py +15 -10
  19. cognee/infrastructure/databases/graph/kuzu/adapter.py +43 -16
  20. cognee/infrastructure/databases/graph/kuzu/kuzu_migrate.py +281 -0
  21. cognee/infrastructure/databases/graph/neo4j_driver/adapter.py +151 -77
  22. cognee/infrastructure/databases/graph/neptune_driver/__init__.py +15 -0
  23. cognee/infrastructure/databases/graph/neptune_driver/adapter.py +1427 -0
  24. cognee/infrastructure/databases/graph/neptune_driver/exceptions.py +115 -0
  25. cognee/infrastructure/databases/graph/neptune_driver/neptune_utils.py +224 -0
  26. cognee/infrastructure/databases/graph/networkx/adapter.py +3 -3
  27. cognee/infrastructure/databases/hybrid/neptune_analytics/NeptuneAnalyticsAdapter.py +449 -0
  28. cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py +11 -3
  29. cognee/infrastructure/databases/vector/chromadb/ChromaDBAdapter.py +8 -3
  30. cognee/infrastructure/databases/vector/create_vector_engine.py +31 -23
  31. cognee/infrastructure/databases/vector/embeddings/FastembedEmbeddingEngine.py +3 -1
  32. cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py +21 -6
  33. cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py +4 -3
  34. cognee/infrastructure/databases/vector/embeddings/get_embedding_engine.py +3 -1
  35. cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py +22 -16
  36. cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py +36 -34
  37. cognee/infrastructure/databases/vector/vector_db_interface.py +78 -7
  38. cognee/infrastructure/files/utils/get_data_file_path.py +39 -0
  39. cognee/infrastructure/files/utils/guess_file_type.py +2 -2
  40. cognee/infrastructure/files/utils/open_data_file.py +4 -23
  41. cognee/infrastructure/llm/LLMGateway.py +137 -0
  42. cognee/infrastructure/llm/__init__.py +14 -4
  43. cognee/infrastructure/llm/config.py +29 -1
  44. cognee/infrastructure/llm/prompts/answer_hotpot_question.txt +1 -1
  45. cognee/infrastructure/llm/prompts/answer_hotpot_using_cognee_search.txt +1 -1
  46. cognee/infrastructure/llm/prompts/answer_simple_question.txt +1 -1
  47. cognee/infrastructure/llm/prompts/answer_simple_question_restricted.txt +1 -1
  48. cognee/infrastructure/llm/prompts/categorize_categories.txt +1 -1
  49. cognee/infrastructure/llm/prompts/classify_content.txt +1 -1
  50. cognee/infrastructure/llm/prompts/context_for_question.txt +1 -1
  51. cognee/infrastructure/llm/prompts/graph_context_for_question.txt +1 -1
  52. cognee/infrastructure/llm/prompts/natural_language_retriever_system.txt +1 -1
  53. cognee/infrastructure/llm/prompts/patch_gen_instructions.txt +1 -1
  54. cognee/infrastructure/llm/prompts/search_type_selector_prompt.txt +130 -0
  55. cognee/infrastructure/llm/prompts/summarize_code.txt +2 -2
  56. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/__init__.py +57 -0
  57. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/async_client.py +533 -0
  58. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/config.py +94 -0
  59. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/globals.py +37 -0
  60. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/inlinedbaml.py +21 -0
  61. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/parser.py +131 -0
  62. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/runtime.py +266 -0
  63. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/stream_types.py +137 -0
  64. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/sync_client.py +550 -0
  65. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/tracing.py +26 -0
  66. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/type_builder.py +962 -0
  67. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/type_map.py +52 -0
  68. cognee/infrastructure/llm/structured_output_framework/baml/baml_client/types.py +166 -0
  69. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extract_categories.baml +109 -0
  70. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extract_content_graph.baml +343 -0
  71. cognee/{modules/data → infrastructure/llm/structured_output_framework/baml/baml_src}/extraction/__init__.py +1 -0
  72. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/extract_summary.py +89 -0
  73. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/knowledge_graph/extract_content_graph.py +33 -0
  74. cognee/infrastructure/llm/structured_output_framework/baml/baml_src/generators.baml +18 -0
  75. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/extraction/__init__.py +3 -0
  76. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/extraction/extract_categories.py +12 -0
  77. cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/extract_summary.py +16 -7
  78. cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/knowledge_graph/extract_content_graph.py +7 -6
  79. cognee/infrastructure/llm/{anthropic → structured_output_framework/litellm_instructor/llm/anthropic}/adapter.py +10 -4
  80. cognee/infrastructure/llm/{gemini → structured_output_framework/litellm_instructor/llm/gemini}/adapter.py +6 -5
  81. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/__init__.py +0 -0
  82. cognee/infrastructure/llm/{generic_llm_api → structured_output_framework/litellm_instructor/llm/generic_llm_api}/adapter.py +7 -3
  83. cognee/infrastructure/llm/{get_llm_client.py → structured_output_framework/litellm_instructor/llm/get_llm_client.py} +18 -6
  84. cognee/infrastructure/llm/{llm_interface.py → structured_output_framework/litellm_instructor/llm/llm_interface.py} +2 -2
  85. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/ollama/__init__.py +0 -0
  86. cognee/infrastructure/llm/{ollama → structured_output_framework/litellm_instructor/llm/ollama}/adapter.py +4 -2
  87. cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/__init__.py +0 -0
  88. cognee/infrastructure/llm/{openai → structured_output_framework/litellm_instructor/llm/openai}/adapter.py +6 -4
  89. cognee/infrastructure/llm/{rate_limiter.py → structured_output_framework/litellm_instructor/llm/rate_limiter.py} +0 -5
  90. cognee/infrastructure/llm/tokenizer/Gemini/adapter.py +4 -2
  91. cognee/infrastructure/llm/tokenizer/TikToken/adapter.py +7 -3
  92. cognee/infrastructure/llm/tokenizer/__init__.py +4 -0
  93. cognee/infrastructure/llm/utils.py +3 -1
  94. cognee/infrastructure/loaders/LoaderEngine.py +156 -0
  95. cognee/infrastructure/loaders/LoaderInterface.py +73 -0
  96. cognee/infrastructure/loaders/__init__.py +18 -0
  97. cognee/infrastructure/loaders/core/__init__.py +7 -0
  98. cognee/infrastructure/loaders/core/audio_loader.py +98 -0
  99. cognee/infrastructure/loaders/core/image_loader.py +114 -0
  100. cognee/infrastructure/loaders/core/text_loader.py +90 -0
  101. cognee/infrastructure/loaders/create_loader_engine.py +32 -0
  102. cognee/infrastructure/loaders/external/__init__.py +22 -0
  103. cognee/infrastructure/loaders/external/pypdf_loader.py +96 -0
  104. cognee/infrastructure/loaders/external/unstructured_loader.py +127 -0
  105. cognee/infrastructure/loaders/get_loader_engine.py +18 -0
  106. cognee/infrastructure/loaders/supported_loaders.py +18 -0
  107. cognee/infrastructure/loaders/use_loader.py +21 -0
  108. cognee/infrastructure/loaders/utils/__init__.py +0 -0
  109. cognee/modules/data/methods/__init__.py +1 -0
  110. cognee/modules/data/methods/get_authorized_dataset.py +23 -0
  111. cognee/modules/data/models/Data.py +13 -3
  112. cognee/modules/data/processing/document_types/AudioDocument.py +2 -2
  113. cognee/modules/data/processing/document_types/ImageDocument.py +2 -2
  114. cognee/modules/data/processing/document_types/PdfDocument.py +4 -11
  115. cognee/modules/data/processing/document_types/UnstructuredDocument.py +2 -5
  116. cognee/modules/engine/utils/generate_edge_id.py +5 -0
  117. cognee/modules/graph/cognee_graph/CogneeGraph.py +45 -35
  118. cognee/modules/graph/methods/get_formatted_graph_data.py +8 -2
  119. cognee/modules/graph/utils/get_graph_from_model.py +93 -101
  120. cognee/modules/ingestion/data_types/TextData.py +8 -2
  121. cognee/modules/ingestion/save_data_to_file.py +1 -1
  122. cognee/modules/pipelines/exceptions/__init__.py +1 -0
  123. cognee/modules/pipelines/exceptions/exceptions.py +12 -0
  124. cognee/modules/pipelines/models/DataItemStatus.py +5 -0
  125. cognee/modules/pipelines/models/PipelineRunInfo.py +6 -0
  126. cognee/modules/pipelines/models/__init__.py +1 -0
  127. cognee/modules/pipelines/operations/pipeline.py +10 -2
  128. cognee/modules/pipelines/operations/run_tasks.py +252 -20
  129. cognee/modules/pipelines/operations/run_tasks_distributed.py +1 -1
  130. cognee/modules/retrieval/chunks_retriever.py +23 -1
  131. cognee/modules/retrieval/code_retriever.py +66 -9
  132. cognee/modules/retrieval/completion_retriever.py +11 -9
  133. cognee/modules/retrieval/context_providers/TripletSearchContextProvider.py +0 -2
  134. cognee/modules/retrieval/graph_completion_context_extension_retriever.py +0 -2
  135. cognee/modules/retrieval/graph_completion_cot_retriever.py +8 -9
  136. cognee/modules/retrieval/graph_completion_retriever.py +1 -1
  137. cognee/modules/retrieval/insights_retriever.py +4 -0
  138. cognee/modules/retrieval/natural_language_retriever.py +9 -15
  139. cognee/modules/retrieval/summaries_retriever.py +23 -1
  140. cognee/modules/retrieval/utils/brute_force_triplet_search.py +23 -4
  141. cognee/modules/retrieval/utils/completion.py +6 -9
  142. cognee/modules/retrieval/utils/description_to_codepart_search.py +2 -3
  143. cognee/modules/search/methods/search.py +5 -1
  144. cognee/modules/search/operations/__init__.py +1 -0
  145. cognee/modules/search/operations/select_search_type.py +42 -0
  146. cognee/modules/search/types/SearchType.py +1 -0
  147. cognee/modules/settings/get_settings.py +0 -8
  148. cognee/modules/settings/save_vector_db_config.py +1 -1
  149. cognee/shared/data_models.py +3 -1
  150. cognee/shared/logging_utils.py +0 -5
  151. cognee/tasks/chunk_naive_llm_classifier/chunk_naive_llm_classifier.py +2 -2
  152. cognee/tasks/documents/extract_chunks_from_documents.py +10 -12
  153. cognee/tasks/entity_completion/entity_extractors/llm_entity_extractor.py +4 -6
  154. cognee/tasks/graph/cascade_extract/utils/extract_content_nodes_and_relationship_names.py +4 -6
  155. cognee/tasks/graph/cascade_extract/utils/extract_edge_triplets.py +6 -7
  156. cognee/tasks/graph/cascade_extract/utils/extract_nodes.py +4 -7
  157. cognee/tasks/graph/extract_graph_from_code.py +3 -2
  158. cognee/tasks/graph/extract_graph_from_data.py +4 -3
  159. cognee/tasks/graph/infer_data_ontology.py +5 -6
  160. cognee/tasks/ingestion/data_item_to_text_file.py +79 -0
  161. cognee/tasks/ingestion/ingest_data.py +91 -61
  162. cognee/tasks/ingestion/resolve_data_directories.py +3 -0
  163. cognee/tasks/repo_processor/get_repo_file_dependencies.py +3 -0
  164. cognee/tasks/storage/index_data_points.py +1 -1
  165. cognee/tasks/storage/index_graph_edges.py +4 -1
  166. cognee/tasks/summarization/summarize_code.py +2 -3
  167. cognee/tasks/summarization/summarize_text.py +3 -2
  168. cognee/tests/test_cognee_server_start.py +12 -7
  169. cognee/tests/test_deduplication.py +2 -2
  170. cognee/tests/test_deletion.py +58 -17
  171. cognee/tests/test_graph_visualization_permissions.py +161 -0
  172. cognee/tests/test_neptune_analytics_graph.py +309 -0
  173. cognee/tests/test_neptune_analytics_hybrid.py +176 -0
  174. cognee/tests/{test_weaviate.py → test_neptune_analytics_vector.py} +86 -11
  175. cognee/tests/test_pgvector.py +5 -5
  176. cognee/tests/test_s3.py +1 -6
  177. cognee/tests/unit/infrastructure/databases/test_rate_limiter.py +11 -10
  178. cognee/tests/unit/infrastructure/databases/vector/__init__.py +0 -0
  179. cognee/tests/unit/infrastructure/mock_embedding_engine.py +1 -1
  180. cognee/tests/unit/infrastructure/test_embedding_rate_limiting_realistic.py +5 -5
  181. cognee/tests/unit/infrastructure/test_rate_limiting_realistic.py +6 -4
  182. cognee/tests/unit/infrastructure/test_rate_limiting_retry.py +1 -1
  183. cognee/tests/unit/interfaces/graph/get_graph_from_model_unit_test.py +61 -3
  184. cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py +84 -9
  185. cognee/tests/unit/modules/search/search_methods_test.py +55 -0
  186. {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/METADATA +13 -9
  187. {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/RECORD +203 -164
  188. cognee/infrastructure/databases/vector/pinecone/adapter.py +0 -8
  189. cognee/infrastructure/databases/vector/qdrant/QDrantAdapter.py +0 -514
  190. cognee/infrastructure/databases/vector/qdrant/__init__.py +0 -2
  191. cognee/infrastructure/databases/vector/weaviate_db/WeaviateAdapter.py +0 -527
  192. cognee/infrastructure/databases/vector/weaviate_db/__init__.py +0 -1
  193. cognee/modules/data/extraction/extract_categories.py +0 -14
  194. cognee/tests/test_qdrant.py +0 -99
  195. distributed/Dockerfile +0 -34
  196. distributed/app.py +0 -4
  197. distributed/entrypoint.py +0 -71
  198. distributed/entrypoint.sh +0 -5
  199. distributed/modal_image.py +0 -11
  200. distributed/queues.py +0 -5
  201. distributed/tasks/queued_add_data_points.py +0 -13
  202. distributed/tasks/queued_add_edges.py +0 -13
  203. distributed/tasks/queued_add_nodes.py +0 -13
  204. distributed/test.py +0 -28
  205. distributed/utils.py +0 -19
  206. distributed/workers/data_point_saving_worker.py +0 -93
  207. distributed/workers/graph_saving_worker.py +0 -104
  208. /cognee/infrastructure/databases/{graph/memgraph → hybrid/neptune_analytics}/__init__.py +0 -0
  209. /cognee/infrastructure/{llm → databases/vector/embeddings}/embedding_rate_limiter.py +0 -0
  210. /cognee/infrastructure/{databases/vector/pinecone → llm/structured_output_framework}/__init__.py +0 -0
  211. /cognee/infrastructure/llm/{anthropic → structured_output_framework/baml/baml_src}/__init__.py +0 -0
  212. /cognee/infrastructure/llm/{gemini/__init__.py → structured_output_framework/baml/baml_src/extraction/extract_categories.py} +0 -0
  213. /cognee/infrastructure/llm/{generic_llm_api → structured_output_framework/baml/baml_src/extraction/knowledge_graph}/__init__.py +0 -0
  214. /cognee/infrastructure/llm/{ollama → structured_output_framework/litellm_instructor}/__init__.py +0 -0
  215. /cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/knowledge_graph/__init__.py +0 -0
  216. /cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/texts.json +0 -0
  217. /cognee/infrastructure/llm/{openai → structured_output_framework/litellm_instructor/llm}/__init__.py +0 -0
  218. {distributed → cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/anthropic}/__init__.py +0 -0
  219. {distributed/tasks → cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/gemini}/__init__.py +0 -0
  220. /cognee/modules/data/{extraction/knowledge_graph → methods}/add_model_class_to_graph.py +0 -0
  221. {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/WHEEL +0 -0
  222. {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/licenses/LICENSE +0 -0
  223. {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/licenses/NOTICE.md +0 -0
@@ -0,0 +1,962 @@
1
+ # ----------------------------------------------------------------------------
2
+ #
3
+ # Welcome to Baml! To use this generated code, please run the following:
4
+ #
5
+ # $ pip install baml
6
+ #
7
+ # ----------------------------------------------------------------------------
8
+
9
+ # This file was generated by BAML: please do not edit it. Instead, edit the
10
+ # BAML files and re-generate this code using: baml-cli generate
11
+ # baml-cli is available with the baml package.
12
+
13
+ import typing
14
+ from baml_py import type_builder
15
+ from baml_py import baml_py
16
+ from .globals import DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME
17
+
18
+
19
+ class TypeBuilder(type_builder.TypeBuilder):
20
+ def __init__(self):
21
+ super().__init__(
22
+ classes=set(
23
+ [
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",
41
+ ]
42
+ ),
43
+ enums=set([]),
44
+ runtime=DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME,
45
+ )
46
+
47
+ # #########################################################################
48
+ # Generated enums 0
49
+ # #########################################################################
50
+
51
+ # #########################################################################
52
+ # Generated classes 17
53
+ # #########################################################################
54
+
55
+ @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)
122
+
123
+
124
+ # #########################################################################
125
+ # Generated enums 0
126
+ # #########################################################################
127
+
128
+
129
+ # #########################################################################
130
+ # Generated classes 17
131
+ # #########################################################################
132
+
133
+
134
+ class AudioContentAst:
135
+ def __init__(self, tb: type_builder.TypeBuilder):
136
+ _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")
273
+ self._properties: typing.Set[str] = set([])
274
+ self._props = DynamicKnowledgeGraphProperties(self._bldr, self._properties)
275
+
276
+ def type(self) -> baml_py.FieldType:
277
+ return self._bldr.field()
278
+
279
+ @property
280
+ def props(self) -> "DynamicKnowledgeGraphProperties":
281
+ return self._props
282
+
283
+
284
+ class DynamicKnowledgeGraphBuilder(DynamicKnowledgeGraphAst):
285
+ def __init__(self, tb: type_builder.TypeBuilder):
286
+ super().__init__(tb)
287
+
288
+ def add_property(self, name: str, type: baml_py.FieldType) -> baml_py.ClassPropertyBuilder:
289
+ if name in self._properties:
290
+ raise ValueError(f"Property {name} already exists.")
291
+ return self._bldr.property(name).type(type)
292
+
293
+ 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()
554
+
555
+ @property
556
+ def props(self) -> "NodeProperties":
557
+ return self._props
558
+
559
+
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
+
572
+
573
+ class NodeProperties:
574
+ def __init__(self, bldr: baml_py.ClassBuilder, properties: typing.Set[str]):
575
+ self.__bldr = bldr
576
+ self.__properties = properties # type: ignore (we know how to use this private attribute) # noqa: F821
577
+
578
+ def __getattr__(self, name: str) -> baml_py.ClassPropertyBuilder:
579
+ if name not in self.__properties:
580
+ raise AttributeError(f"Property {name} not found.")
581
+ 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"))