commons 0.1.0__tar.gz

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 (270) hide show
  1. commons-0.1.0/.gitignore +29 -0
  2. commons-0.1.0/LICENSE.md +21 -0
  3. commons-0.1.0/PKG-INFO +96 -0
  4. commons-0.1.0/README.md +63 -0
  5. commons-0.1.0/demo.ipynb +393 -0
  6. commons-0.1.0/demo.py +307 -0
  7. commons-0.1.0/docs/.gitignore +6 -0
  8. commons-0.1.0/docs/01-get-started.qmd +398 -0
  9. commons-0.1.0/docs/02-governance.qmd +81 -0
  10. commons-0.1.0/docs/03-feature-parity.qmd +14 -0
  11. commons-0.1.0/docs/assets/figs/citation-definition.svg +4 -0
  12. commons-0.1.0/docs/assets/figs/citation-mark.svg +5 -0
  13. commons-0.1.0/docs/assets/figs/citation-prose.svg +4 -0
  14. commons-0.1.0/docs/assets/figs/citation-schema.svg +4 -0
  15. commons-0.1.0/docs/assets/figs/trusted-icon.svg +6 -0
  16. commons-0.1.0/docs/assets/figs/warning-icon.svg +7 -0
  17. commons-0.1.0/docs/assets/hex/commons-hex.png +0 -0
  18. commons-0.1.0/docs/assets/logos/python-logo.svg +1 -0
  19. commons-0.1.0/docs/assets/logos/r-logo.svg +14 -0
  20. commons-0.1.0/docs/assets/styles.css +169 -0
  21. commons-0.1.0/docs/favicon/apple-touch-icon.png +0 -0
  22. commons-0.1.0/docs/favicon/favicon-96x96.png +0 -0
  23. commons-0.1.0/docs/favicon/favicon.ico +0 -0
  24. commons-0.1.0/docs/favicon/favicon.svg +1 -0
  25. commons-0.1.0/docs/favicon/site.webmanifest +21 -0
  26. commons-0.1.0/docs/favicon/web-app-manifest-192x192.png +0 -0
  27. commons-0.1.0/docs/favicon/web-app-manifest-512x512.png +0 -0
  28. commons-0.1.0/great-docs.yml +141 -0
  29. commons-0.1.0/index.qmd +61 -0
  30. commons-0.1.0/notes/2026-08-20-execution-prior-art.md +100 -0
  31. commons-0.1.0/notes/2026-08-31-trace-round-trip.md +65 -0
  32. commons-0.1.0/pyproject.toml +86 -0
  33. commons-0.1.0/src/commons/__init__.py +48 -0
  34. commons-0.1.0/src/commons/_agent.py +655 -0
  35. commons-0.1.0/src/commons/_backends.py +244 -0
  36. commons-0.1.0/src/commons/_catalog/__init__.py +73 -0
  37. commons-0.1.0/src/commons/_catalog/_core.py +617 -0
  38. commons-0.1.0/src/commons/_catalog/_databricks.py +296 -0
  39. commons-0.1.0/src/commons/_catalog/_databricks_semantic.py +485 -0
  40. commons-0.1.0/src/commons/_catalog/_import.py +270 -0
  41. commons-0.1.0/src/commons/_catalog/_security.py +433 -0
  42. commons-0.1.0/src/commons/_catalog/_snowflake.py +174 -0
  43. commons-0.1.0/src/commons/_catalog/_snowflake_semantic.py +566 -0
  44. commons-0.1.0/src/commons/_citation_scan.py +320 -0
  45. commons-0.1.0/src/commons/_citations.py +383 -0
  46. commons-0.1.0/src/commons/_connect.py +683 -0
  47. commons-0.1.0/src/commons/_context_layer.py +193 -0
  48. commons-0.1.0/src/commons/_data_dictionary.py +478 -0
  49. commons-0.1.0/src/commons/_data_source.py +736 -0
  50. commons-0.1.0/src/commons/_definitions/__init__.py +51 -0
  51. commons-0.1.0/src/commons/_definitions/_compile.py +578 -0
  52. commons-0.1.0/src/commons/_definitions/_emit_duckdb.py +346 -0
  53. commons-0.1.0/src/commons/_definitions/_emit_sql.py +546 -0
  54. commons-0.1.0/src/commons/_definitions/_export.py +876 -0
  55. commons-0.1.0/src/commons/_definitions/_expression.py +529 -0
  56. commons-0.1.0/src/commons/_definitions/_registry.py +311 -0
  57. commons-0.1.0/src/commons/_display.py +322 -0
  58. commons-0.1.0/src/commons/_duckdb.py +62 -0
  59. commons-0.1.0/src/commons/_execution/__init__.py +1 -0
  60. commons-0.1.0/src/commons/_execution/_backend.py +494 -0
  61. commons-0.1.0/src/commons/_execution/_driver.py +511 -0
  62. commons-0.1.0/src/commons/_execution/_env.py +74 -0
  63. commons-0.1.0/src/commons/_execution/_protocol.py +1318 -0
  64. commons-0.1.0/src/commons/_execution/_runtime/__init__.py +10 -0
  65. commons-0.1.0/src/commons/_execution/_runtime/_figure_backend.py +30 -0
  66. commons-0.1.0/src/commons/_execution/_runtime/_guardrails.py +215 -0
  67. commons-0.1.0/src/commons/_execution/_runtime/_landlock.py +375 -0
  68. commons-0.1.0/src/commons/_execution/_runtime/_limits.py +43 -0
  69. commons-0.1.0/src/commons/_execution/_runtime/_plots.py +205 -0
  70. commons-0.1.0/src/commons/_execution/_runtime/_repl.py +367 -0
  71. commons-0.1.0/src/commons/_execution/_runtime/_seatbelt.py +155 -0
  72. commons-0.1.0/src/commons/_execution/_runtime/_seccomp.py +821 -0
  73. commons-0.1.0/src/commons/_execution/_runtime/_userns.py +662 -0
  74. commons-0.1.0/src/commons/_execution/_runtime/_worker.py +451 -0
  75. commons-0.1.0/src/commons/_execution/_sandbox.py +202 -0
  76. commons-0.1.0/src/commons/_execution/_thread.py +190 -0
  77. commons-0.1.0/src/commons/_frames.py +147 -0
  78. commons-0.1.0/src/commons/_handles.py +84 -0
  79. commons-0.1.0/src/commons/_icons.py +56 -0
  80. commons-0.1.0/src/commons/_measure_results.py +206 -0
  81. commons-0.1.0/src/commons/_measures.py +893 -0
  82. commons-0.1.0/src/commons/_pool.py +602 -0
  83. commons-0.1.0/src/commons/_prompt.py +303 -0
  84. commons-0.1.0/src/commons/_provenance.py +156 -0
  85. commons-0.1.0/src/commons/_reminders.py +56 -0
  86. commons-0.1.0/src/commons/_rows.py +166 -0
  87. commons-0.1.0/src/commons/_run_python.py +428 -0
  88. commons-0.1.0/src/commons/_semantic_models.py +943 -0
  89. commons-0.1.0/src/commons/_skills.py +53 -0
  90. commons-0.1.0/src/commons/_sql_guard.py +167 -0
  91. commons-0.1.0/src/commons/_tools.py +1005 -0
  92. commons-0.1.0/src/commons/_tracing.py +387 -0
  93. commons-0.1.0/src/commons/_trajectory/__init__.py +157 -0
  94. commons-0.1.0/src/commons/_trajectory/_build.py +618 -0
  95. commons-0.1.0/src/commons/_trajectory/_deployment.py +337 -0
  96. commons-0.1.0/src/commons/_trajectory/_otlp.py +156 -0
  97. commons-0.1.0/src/commons/_trajectory/_semconv.py +154 -0
  98. commons-0.1.0/src/commons/_trajectory/_source.py +263 -0
  99. commons-0.1.0/src/commons/_ui/__init__.py +46 -0
  100. commons-0.1.0/src/commons/_ui/_app.py +58 -0
  101. commons-0.1.0/src/commons/_ui/_assets.py +52 -0
  102. commons-0.1.0/src/commons/_ui/_server.py +78 -0
  103. commons-0.1.0/src/commons/_ui/_theme.py +61 -0
  104. commons-0.1.0/src/commons/prompts/README.md +1 -0
  105. commons-0.1.0/src/commons/prompts/citation-request.md +1 -0
  106. commons-0.1.0/src/commons/prompts/skills/artifacts/SKILL.md +35 -0
  107. commons-0.1.0/src/commons/prompts/skills/trust-system/SKILL.md +15 -0
  108. commons-0.1.0/src/commons/prompts/system-prompt.md +173 -0
  109. commons-0.1.0/src/commons/py.typed +0 -0
  110. commons-0.1.0/src/commons/skills/commons/SKILL.md +105 -0
  111. commons-0.1.0/src/commons/skills/commons/references/data-dictionaries.md +77 -0
  112. commons-0.1.0/src/commons/skills/commons/references/evaluation.md +200 -0
  113. commons-0.1.0/src/commons/skills/commons/references/extracting-from-artifacts.md +62 -0
  114. commons-0.1.0/src/commons/skills/commons/references/iterating-from-trajectories.md +43 -0
  115. commons-0.1.0/src/commons/skills/commons/references/onboarding.md +156 -0
  116. commons-0.1.0/src/commons/ui.py +5 -0
  117. commons-0.1.0/src/commons/www/README.md +1 -0
  118. commons-0.1.0/src/commons/www/commons-chat/commons-artifact.css +79 -0
  119. commons-0.1.0/src/commons/www/commons-chat/commons-artifact.js +358 -0
  120. commons-0.1.0/src/commons/www/commons-chat/commons-chat.css +716 -0
  121. commons-0.1.0/src/commons/www/commons-chat/commons-chat.js +94 -0
  122. commons-0.1.0/src/commons/www/commons-chat/commons-document.css +187 -0
  123. commons-0.1.0/src/commons/www/commons-chat/figs/citation-definition.svg +4 -0
  124. commons-0.1.0/src/commons/www/commons-chat/figs/citation-mark.svg +5 -0
  125. commons-0.1.0/src/commons/www/commons-chat/figs/citation-prose.svg +4 -0
  126. commons-0.1.0/src/commons/www/commons-chat/figs/citation-schema.svg +4 -0
  127. commons-0.1.0/src/commons/www/commons-chat/figs/trusted-icon.svg +6 -0
  128. commons-0.1.0/src/commons/www/commons-chat/figs/warning-icon.svg +7 -0
  129. commons-0.1.0/src/commons/www/commons-share/commons-share.css +166 -0
  130. commons-0.1.0/src/commons/www/commons-share/commons-share.js +131 -0
  131. commons-0.1.0/tests/README.md +56 -0
  132. commons-0.1.0/tests/__init__.py +0 -0
  133. commons-0.1.0/tests/_agents.py +56 -0
  134. commons-0.1.0/tests/_connect_fake.py +196 -0
  135. commons-0.1.0/tests/_env_file.py +33 -0
  136. commons-0.1.0/tests/_fresh_interpreter.py +48 -0
  137. commons-0.1.0/tests/_live_warehouse.py +277 -0
  138. commons-0.1.0/tests/_provider.py +133 -0
  139. commons-0.1.0/tests/_semantic_fixture.py +99 -0
  140. commons-0.1.0/tests/_session.py +34 -0
  141. commons-0.1.0/tests/_shared.py +100 -0
  142. commons-0.1.0/tests/_spans.py +53 -0
  143. commons-0.1.0/tests/_trace_fixture.py +141 -0
  144. commons-0.1.0/tests/_trajectories.py +233 -0
  145. commons-0.1.0/tests/_warehouse.py +293 -0
  146. commons-0.1.0/tests/conftest.py +77 -0
  147. commons-0.1.0/tests/data/r-format-signif.json +1322 -0
  148. commons-0.1.0/tests/measure_sources/README.md +1 -0
  149. commons-0.1.0/tests/measure_sources/aliased/aliased.py +11 -0
  150. commons-0.1.0/tests/measure_sources/bare_record/total.py +18 -0
  151. commons-0.1.0/tests/measure_sources/broken/broken_import.py +6 -0
  152. commons-0.1.0/tests/measure_sources/broken/self_removing_import.py +11 -0
  153. commons-0.1.0/tests/measure_sources/collision_a/shared_lib.py +5 -0
  154. commons-0.1.0/tests/measure_sources/collision_a/uses_shared.py +12 -0
  155. commons-0.1.0/tests/measure_sources/collision_b/shared_lib.py +9 -0
  156. commons-0.1.0/tests/measure_sources/dotted/email.mime.py +6 -0
  157. commons-0.1.0/tests/measure_sources/duplicate_helpers/a_file.py +13 -0
  158. commons-0.1.0/tests/measure_sources/duplicate_helpers/b_file.py +17 -0
  159. commons-0.1.0/tests/measure_sources/duplicate_measures/a_measure.py +6 -0
  160. commons-0.1.0/tests/measure_sources/duplicate_measures/b_measure.py +6 -0
  161. commons-0.1.0/tests/measure_sources/has_init/__init__.py +4 -0
  162. commons-0.1.0/tests/measure_sources/has_init/orders.py +6 -0
  163. commons-0.1.0/tests/measure_sources/nested/orders.py +12 -0
  164. commons-0.1.0/tests/measure_sources/orders.py +20 -0
  165. commons-0.1.0/tests/measure_sources/pkg_collision/json/data.txt +2 -0
  166. commons-0.1.0/tests/measure_sources/pkg_collision/orders.py +6 -0
  167. commons-0.1.0/tests/measure_sources/reentrant/composes_a_sibling.py +17 -0
  168. commons-0.1.0/tests/measure_sources/revenue.py +8 -0
  169. commons-0.1.0/tests/measure_sources/sibling_imports/helper_lib.py +6 -0
  170. commons-0.1.0/tests/measure_sources/sibling_imports/uses_helper.py +12 -0
  171. commons-0.1.0/tests/measure_sources/stdlib_collision/json.py +10 -0
  172. commons-0.1.0/tests/test_acceptance.py +178 -0
  173. commons-0.1.0/tests/test_agent.py +733 -0
  174. commons-0.1.0/tests/test_agent_skill.py +79 -0
  175. commons-0.1.0/tests/test_agent_stream.py +462 -0
  176. commons-0.1.0/tests/test_backends.py +95 -0
  177. commons-0.1.0/tests/test_catalog.py +658 -0
  178. commons-0.1.0/tests/test_catalog_databricks.py +245 -0
  179. commons-0.1.0/tests/test_catalog_import.py +281 -0
  180. commons-0.1.0/tests/test_catalog_rows_fixture.py +78 -0
  181. commons-0.1.0/tests/test_catalog_security.py +423 -0
  182. commons-0.1.0/tests/test_catalog_security_fixtures.py +252 -0
  183. commons-0.1.0/tests/test_catalog_snowflake.py +324 -0
  184. commons-0.1.0/tests/test_catalog_snowflake_semantic.py +112 -0
  185. commons-0.1.0/tests/test_citation_corpus.py +65 -0
  186. commons-0.1.0/tests/test_citation_request.py +89 -0
  187. commons-0.1.0/tests/test_citation_scan.py +192 -0
  188. commons-0.1.0/tests/test_citations.py +191 -0
  189. commons-0.1.0/tests/test_connect.py +557 -0
  190. commons-0.1.0/tests/test_context_layer.py +371 -0
  191. commons-0.1.0/tests/test_data_dictionary.py +505 -0
  192. commons-0.1.0/tests/test_data_source.py +145 -0
  193. commons-0.1.0/tests/test_data_source_board.py +258 -0
  194. commons-0.1.0/tests/test_data_source_engine.py +235 -0
  195. commons-0.1.0/tests/test_data_source_warehouse.py +159 -0
  196. commons-0.1.0/tests/test_databricks_metric_view_fixture.py +199 -0
  197. commons-0.1.0/tests/test_definition_binding.py +100 -0
  198. commons-0.1.0/tests/test_definition_compile.py +441 -0
  199. commons-0.1.0/tests/test_definition_emit_duckdb.py +402 -0
  200. commons-0.1.0/tests/test_definition_emit_sql.py +220 -0
  201. commons-0.1.0/tests/test_definition_export.py +549 -0
  202. commons-0.1.0/tests/test_definition_expression.py +310 -0
  203. commons-0.1.0/tests/test_definition_rendering.py +92 -0
  204. commons-0.1.0/tests/test_definitions_fixture.py +107 -0
  205. commons-0.1.0/tests/test_definitions_registry.py +496 -0
  206. commons-0.1.0/tests/test_duckdb.py +62 -0
  207. commons-0.1.0/tests/test_env_file.py +79 -0
  208. commons-0.1.0/tests/test_execution_backend.py +405 -0
  209. commons-0.1.0/tests/test_execution_driver.py +1131 -0
  210. commons-0.1.0/tests/test_execution_env.py +192 -0
  211. commons-0.1.0/tests/test_execution_guardrails.py +191 -0
  212. commons-0.1.0/tests/test_execution_landlock.py +559 -0
  213. commons-0.1.0/tests/test_execution_limits.py +187 -0
  214. commons-0.1.0/tests/test_execution_plots.py +561 -0
  215. commons-0.1.0/tests/test_execution_protocol.py +1565 -0
  216. commons-0.1.0/tests/test_execution_repl.py +447 -0
  217. commons-0.1.0/tests/test_execution_sandbox.py +184 -0
  218. commons-0.1.0/tests/test_execution_seatbelt.py +461 -0
  219. commons-0.1.0/tests/test_execution_seccomp.py +1177 -0
  220. commons-0.1.0/tests/test_execution_shared.py +132 -0
  221. commons-0.1.0/tests/test_execution_thread.py +251 -0
  222. commons-0.1.0/tests/test_execution_userns.py +803 -0
  223. commons-0.1.0/tests/test_handles.py +354 -0
  224. commons-0.1.0/tests/test_icons.py +64 -0
  225. commons-0.1.0/tests/test_live_warehouse_fixture.py +229 -0
  226. commons-0.1.0/tests/test_live_warehouses.py +400 -0
  227. commons-0.1.0/tests/test_measure_html.py +170 -0
  228. commons-0.1.0/tests/test_measure_results.py +167 -0
  229. commons-0.1.0/tests/test_measures.py +1308 -0
  230. commons-0.1.0/tests/test_packaging.py +56 -0
  231. commons-0.1.0/tests/test_pool.py +482 -0
  232. commons-0.1.0/tests/test_pool_semantic.py +199 -0
  233. commons-0.1.0/tests/test_prompt.py +255 -0
  234. commons-0.1.0/tests/test_provenance.py +177 -0
  235. commons-0.1.0/tests/test_provenance_span.py +195 -0
  236. commons-0.1.0/tests/test_reminders.py +81 -0
  237. commons-0.1.0/tests/test_rows.py +126 -0
  238. commons-0.1.0/tests/test_run_python.py +541 -0
  239. commons-0.1.0/tests/test_sandbox_abstract_ipc.py +50 -0
  240. commons-0.1.0/tests/test_sandbox_signals.py +112 -0
  241. commons-0.1.0/tests/test_semantic_models.py +141 -0
  242. commons-0.1.0/tests/test_semantic_models_fixture.py +220 -0
  243. commons-0.1.0/tests/test_setup_spans.py +198 -0
  244. commons-0.1.0/tests/test_share_with.py +283 -0
  245. commons-0.1.0/tests/test_shinychat.py +176 -0
  246. commons-0.1.0/tests/test_skills.py +7 -0
  247. commons-0.1.0/tests/test_snowflake_semantic_fixture.py +274 -0
  248. commons-0.1.0/tests/test_sql_guard.py +252 -0
  249. commons-0.1.0/tests/test_table_names.py +55 -0
  250. commons-0.1.0/tests/test_tool_display.py +518 -0
  251. commons-0.1.0/tests/test_tool_registration_fixture.py +180 -0
  252. commons-0.1.0/tests/test_tools.py +943 -0
  253. commons-0.1.0/tests/test_tools_semantic.py +81 -0
  254. commons-0.1.0/tests/test_trace_files_recipe.py +32 -0
  255. commons-0.1.0/tests/test_trace_round_trip.py +153 -0
  256. commons-0.1.0/tests/test_tracing.py +531 -0
  257. commons-0.1.0/tests/test_tracing_inert.py +25 -0
  258. commons-0.1.0/tests/test_trajectory_build.py +154 -0
  259. commons-0.1.0/tests/test_trajectory_connect.py +795 -0
  260. commons-0.1.0/tests/test_trajectory_otlp.py +282 -0
  261. commons-0.1.0/tests/test_trajectory_read.py +281 -0
  262. commons-0.1.0/tests/test_trajectory_semconv.py +162 -0
  263. commons-0.1.0/tests/test_turn_span.py +241 -0
  264. commons-0.1.0/tests/test_typed_parameters_fixture.py +45 -0
  265. commons-0.1.0/tests/test_ui_app.py +108 -0
  266. commons-0.1.0/tests/test_ui_assets.py +182 -0
  267. commons-0.1.0/tests/test_ui_server.py +132 -0
  268. commons-0.1.0/tests/test_ui_theme.py +67 -0
  269. commons-0.1.0/tests/test_where_literals.py +26 -0
  270. commons-0.1.0/uv.lock +5485 -0
@@ -0,0 +1,29 @@
1
+ # Package-relative ignores; see pkg-r/.gitignore for why these are not in the
2
+ # repository root.
3
+ .venv/
4
+ __pycache__/
5
+ *.py[cod]
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ build/
9
+ dist/
10
+ *.egg-info/
11
+
12
+ # The root ignores any directory named "docs"; this package's is committed.
13
+ !docs/
14
+
15
+ # Jupyter writes these beside a notebook; they carry outputs and local paths.
16
+ .ipynb_checkpoints/
17
+
18
+ # hatchling reads only this file, so the root .gitignore does not keep these
19
+ # out of the sdist.
20
+ .env
21
+ .env.*
22
+
23
+ /.quarto/
24
+ **/*.quarto_ipynb
25
+
26
+ # The site great-docs assembles and renders, plus its working directories.
27
+ /great-docs/
28
+ /.great-docs/
29
+ /_great_docs_build/
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2026 Posit Software, PBC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
commons-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.5
2
+ Name: commons
3
+ Version: 0.1.0
4
+ Summary: AI Agents for Data Analysis
5
+ Project-URL: Homepage, https://github.com/posit-dev/commons
6
+ Project-URL: Documentation, https://posit-dev.github.io/commons/py/
7
+ Project-URL: Issues, https://github.com/posit-dev/commons/issues
8
+ License-Expression: MIT
9
+ License-File: LICENSE.md
10
+ Classifier: Development Status :: 4 - Beta
11
+ Requires-Python: >=3.11
12
+ Requires-Dist: chatlas>=0.22.0
13
+ Requires-Dist: duckdb>=1.0
14
+ Requires-Dist: google-re2>=1.1.20251105
15
+ Requires-Dist: htmltools>=0.6
16
+ Requires-Dist: httpx>=0.27
17
+ Requires-Dist: jinja2>=3
18
+ Requires-Dist: opentelemetry-api>=1.0
19
+ Requires-Dist: pyarrow>=17
20
+ Requires-Dist: pydantic>=2
21
+ Requires-Dist: pyyaml>=6
22
+ Requires-Dist: raghilda>=0.2.1
23
+ Requires-Dist: sqlalchemy>=2.0
24
+ Requires-Dist: sqlglot>=25
25
+ Provides-Extra: shiny
26
+ Requires-Dist: packaging>=23; extra == 'shiny'
27
+ Requires-Dist: shiny>=1.7; extra == 'shiny'
28
+ Requires-Dist: shinychat<0.8,>=0.7; extra == 'shiny'
29
+ Provides-Extra: tracing
30
+ Requires-Dist: opentelemetry-exporter-otlp-json-file; extra == 'tracing'
31
+ Requires-Dist: opentelemetry-sdk>=1.39; extra == 'tracing'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # commons
35
+
36
+ `commons` is a constructor for trustworthy data agents. It gives an LLM data, semantic, and context layers to work with, tools for querying them, and A/B/C provenance tags so every answer carries a classification as to its trustworthiness.
37
+
38
+ The agent, the three layers (data, semantics, and context), and the chat UI are implemented: `commons.ui.server()` wires an agent to a chat element in a py-shiny app, and outside one, answers come back as text and server-rendered HTML. Python 3.11 or later is required.
39
+
40
+ ## Optional extras
41
+
42
+ The core dependencies will allow you to build and query an agent. Installing the `shiny` group (via `pip install commons[shiny]`) will additionally install everything `commons.ui` needs to serve a full chat UI; importing `commons.ui` without it raises an `ImportError` that names the missing packages and the install command. The `tracing` group installs the OpenTelemetry packages that `log=True` uses to write trace files locally; when running locally or deploying your app somewhere other than Posit Connect, logging also needs a tracer provider, as [Logging conversations](https://posit-dev.github.io/commons/py/user-guide/get-started.html#logging-conversations) describes.
43
+
44
+ To install the complete package with all extras, run `pip install "commons[shiny,tracing]"`.
45
+
46
+ ## Get started
47
+
48
+ An agent needs a chat client and at least one data source. A semantic layer of trusted calculations and a context layer of prose are both optional. The semantic layer changes which tools the agent registers, since a measure is what `call_measure` calls. The context layer does not: `search_context` is always registered, and without a layer behind it the tool reports that none is configured. Every parameter the model supplies to a measure needs a description, which is what the model reads to decide how to call it. commons fills a `commons.Injected` parameter itself, with the connection of the data source that shares its name, and the model never sees it.
49
+
50
+ The chat client comes from chatlas, so install the package for whichever provider you point it at — `chatlas.ChatAuto("anthropic/claude-sonnet-5")` below needs `pip install anthropic` — and set the provider's API key in the environment.
51
+
52
+ ```python
53
+ from typing import Annotated, Any
54
+
55
+ import chatlas
56
+ import commons
57
+ import pandas as pd
58
+ from pydantic import Field
59
+
60
+ sales = pd.DataFrame(
61
+ {"revenue": [500.0, 900.0, 300.0], "region": ["EMEA", "Americas", "EMEA"]}
62
+ )
63
+
64
+
65
+ @commons.measure(description="Total revenue for one region.")
66
+ def region_revenue(
67
+ region: Annotated[str, Field(description="Which region to total.")],
68
+ warehouse: commons.Injected[Any],
69
+ ) -> float:
70
+ (total,) = warehouse.execute(
71
+ "SELECT SUM(revenue) FROM sales WHERE region = ?", [region]
72
+ ).fetchone()
73
+ return float(total)
74
+
75
+
76
+ agent = commons.Commons(
77
+ client=chatlas.ChatAuto("anthropic/claude-sonnet-5"),
78
+ data_sources={"warehouse": commons.data_source(sales=sales)},
79
+ semantic_layer=commons.semantic_layer(region_revenue),
80
+ context_layer=commons.context_layer(files=["reporting-policy.md"]),
81
+ )
82
+
83
+ agent.chat("What is EMEA revenue?")
84
+ ```
85
+
86
+ `region_revenue` is trusted code, so an answer that runs it is tagged `Tag.A` and displays the Trusted marker. A question no measure covers sends the agent to `run_sql` or the context layer instead, and the answer comes back cited or untrusted depending on whether it quotes something the context layer can verify.
87
+
88
+ Use `stream_async()` in place of `chat()` to stream an answer as it arrives. Its signature is chatlas's, so a chat UI can drive the agent directly.
89
+
90
+ `commons.ui` puts the agent behind a py-shiny chat, which needs the `shiny` extra: `pip install "commons[shiny]"`. `commons.ui.app(agent)` is a complete app for local development. It shares its one agent across every session, so it suits one visitor at a time: two questions answered at once interleave the agent's citation and provenance state, and neither answer can be trusted. A deployed app builds the page with `commons.ui.theme()`, calls `commons.ui.server("chat", agent)` in its server function, and constructs the agent there so each session gets its own.
91
+
92
+ An agent is a chatlas `Chat`, so `get_tools()`, `system_prompt`, `set_model_params()` and the rest of that surface work on it directly. `chat()` and `stream_async()` are the only ways to ask it something. The other entry points chatlas offers would answer without the citation scanner and the provenance tag, so each of them raises `NotImplementedError`.
93
+
94
+ `demo.py` here is a fuller worked example, an agent over made-up forest canopy data with two measures and a context layer. Run it with `shiny run demo.py` for the chat, or `python demo.py` to ask the same questions from the terminal. `demo.ipynb` is the same agent in a notebook, with cells for reading what it registered and adding a measure of your own. `pkg-r/inst/demo.R` is the R package's version of it.
95
+
96
+ Behavior that both implementations must agree on belongs in [`tests/shared/`](https://github.com/posit-dev/commons/tree/main/tests/shared) at the repository root, which that directory's README defines as the authority. The provenance tag rules and display copy, the citation dialect, and the context layer's frontmatter handling are governed that way; both suites run those cases.
@@ -0,0 +1,63 @@
1
+ # commons
2
+
3
+ `commons` is a constructor for trustworthy data agents. It gives an LLM data, semantic, and context layers to work with, tools for querying them, and A/B/C provenance tags so every answer carries a classification as to its trustworthiness.
4
+
5
+ The agent, the three layers (data, semantics, and context), and the chat UI are implemented: `commons.ui.server()` wires an agent to a chat element in a py-shiny app, and outside one, answers come back as text and server-rendered HTML. Python 3.11 or later is required.
6
+
7
+ ## Optional extras
8
+
9
+ The core dependencies will allow you to build and query an agent. Installing the `shiny` group (via `pip install commons[shiny]`) will additionally install everything `commons.ui` needs to serve a full chat UI; importing `commons.ui` without it raises an `ImportError` that names the missing packages and the install command. The `tracing` group installs the OpenTelemetry packages that `log=True` uses to write trace files locally; when running locally or deploying your app somewhere other than Posit Connect, logging also needs a tracer provider, as [Logging conversations](https://posit-dev.github.io/commons/py/user-guide/get-started.html#logging-conversations) describes.
10
+
11
+ To install the complete package with all extras, run `pip install "commons[shiny,tracing]"`.
12
+
13
+ ## Get started
14
+
15
+ An agent needs a chat client and at least one data source. A semantic layer of trusted calculations and a context layer of prose are both optional. The semantic layer changes which tools the agent registers, since a measure is what `call_measure` calls. The context layer does not: `search_context` is always registered, and without a layer behind it the tool reports that none is configured. Every parameter the model supplies to a measure needs a description, which is what the model reads to decide how to call it. commons fills a `commons.Injected` parameter itself, with the connection of the data source that shares its name, and the model never sees it.
16
+
17
+ The chat client comes from chatlas, so install the package for whichever provider you point it at — `chatlas.ChatAuto("anthropic/claude-sonnet-5")` below needs `pip install anthropic` — and set the provider's API key in the environment.
18
+
19
+ ```python
20
+ from typing import Annotated, Any
21
+
22
+ import chatlas
23
+ import commons
24
+ import pandas as pd
25
+ from pydantic import Field
26
+
27
+ sales = pd.DataFrame(
28
+ {"revenue": [500.0, 900.0, 300.0], "region": ["EMEA", "Americas", "EMEA"]}
29
+ )
30
+
31
+
32
+ @commons.measure(description="Total revenue for one region.")
33
+ def region_revenue(
34
+ region: Annotated[str, Field(description="Which region to total.")],
35
+ warehouse: commons.Injected[Any],
36
+ ) -> float:
37
+ (total,) = warehouse.execute(
38
+ "SELECT SUM(revenue) FROM sales WHERE region = ?", [region]
39
+ ).fetchone()
40
+ return float(total)
41
+
42
+
43
+ agent = commons.Commons(
44
+ client=chatlas.ChatAuto("anthropic/claude-sonnet-5"),
45
+ data_sources={"warehouse": commons.data_source(sales=sales)},
46
+ semantic_layer=commons.semantic_layer(region_revenue),
47
+ context_layer=commons.context_layer(files=["reporting-policy.md"]),
48
+ )
49
+
50
+ agent.chat("What is EMEA revenue?")
51
+ ```
52
+
53
+ `region_revenue` is trusted code, so an answer that runs it is tagged `Tag.A` and displays the Trusted marker. A question no measure covers sends the agent to `run_sql` or the context layer instead, and the answer comes back cited or untrusted depending on whether it quotes something the context layer can verify.
54
+
55
+ Use `stream_async()` in place of `chat()` to stream an answer as it arrives. Its signature is chatlas's, so a chat UI can drive the agent directly.
56
+
57
+ `commons.ui` puts the agent behind a py-shiny chat, which needs the `shiny` extra: `pip install "commons[shiny]"`. `commons.ui.app(agent)` is a complete app for local development. It shares its one agent across every session, so it suits one visitor at a time: two questions answered at once interleave the agent's citation and provenance state, and neither answer can be trusted. A deployed app builds the page with `commons.ui.theme()`, calls `commons.ui.server("chat", agent)` in its server function, and constructs the agent there so each session gets its own.
58
+
59
+ An agent is a chatlas `Chat`, so `get_tools()`, `system_prompt`, `set_model_params()` and the rest of that surface work on it directly. `chat()` and `stream_async()` are the only ways to ask it something. The other entry points chatlas offers would answer without the citation scanner and the provenance tag, so each of them raises `NotImplementedError`.
60
+
61
+ `demo.py` here is a fuller worked example, an agent over made-up forest canopy data with two measures and a context layer. Run it with `shiny run demo.py` for the chat, or `python demo.py` to ask the same questions from the terminal. `demo.ipynb` is the same agent in a notebook, with cells for reading what it registered and adding a measure of your own. `pkg-r/inst/demo.R` is the R package's version of it.
62
+
63
+ Behavior that both implementations must agree on belongs in [`tests/shared/`](https://github.com/posit-dev/commons/tree/main/tests/shared) at the repository root, which that directory's README defines as the authority. The provenance tag rules and display copy, the citation dialect, and the context layer's frontmatter handling are governed that way; both suites run those cases.
@@ -0,0 +1,393 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "4b805450",
6
+ "metadata": {},
7
+ "source": [
8
+ "# A demonstration of the forest canopy agent\n",
9
+ "\n",
10
+ "This notebook is an interactive version of `demo.py`, demonstrating the backend behavior of a `Commons` agent. It is the same agent as the R implementation's\n",
11
+ "`inst/demo.R`, evaluating made-up forest canopy data, without the shiny chat UI in front of it.\n",
12
+ "\n",
13
+ "Launch it from `pkg-py/`:\n",
14
+ "\n",
15
+ "```bash\n",
16
+ "# The client comes from `chatlas.ChatAuto`, so `CHATLAS_CHAT_PROVIDER_MODEL`\n",
17
+ "# picks a different provider without editing this file. chatlas ships no\n",
18
+ "# provider SDK and neither does commons, hence the `uv run --with`.\n",
19
+ "\n",
20
+ "# These variables assume you're using bedrock via an AWS profile.\n",
21
+ "# See the chatlas documentation on how to use other providers\n",
22
+ "# (https://posit-dev.github.io/chatlas/reference/ChatAuto.html)\n",
23
+ "\n",
24
+ "# For example, to use Claude sonnet on Bedrock:\n",
25
+ "export CHATLAS_CHAT_PROVIDER_MODEL=bedrock-anthropic/us.anthropic.claude-sonnet-5\n",
26
+ "export AWS_PROFILE=claude\n",
27
+ "uv run --with 'anthropic[bedrock]' --with jupyterlab --with ipywidgets jupyter lab demo.ipynb\n",
28
+ "```\n",
29
+ "\n",
30
+ "If using Bedrock and the first model call fails on credentials, refresh the SSO token with `aws sso login --profile claude`."
31
+ ]
32
+ },
33
+ {
34
+ "cell_type": "markdown",
35
+ "id": "4ec38180",
36
+ "metadata": {},
37
+ "source": [
38
+ "## The pieces\n",
39
+ "\n",
40
+ "`demo.py` holds the two data frames, the notes file, and the three measures, so this\n",
41
+ "notebook imports them rather than keeping a second copy that can drift. The import\n",
42
+ "finds `demo.py` wherever the kernel started, so it works from the repository root\n",
43
+ "as well as from `pkg-py`."
44
+ ]
45
+ },
46
+ {
47
+ "cell_type": "code",
48
+ "execution_count": null,
49
+ "id": "6a3818de",
50
+ "metadata": {},
51
+ "outputs": [],
52
+ "source": [
53
+ "import sys\n",
54
+ "from pathlib import Path\n",
55
+ "\n",
56
+ "\n",
57
+ "# Jupyter's working directory depends on where it was launched, so find the\n",
58
+ "# directory holding demo.py rather than assuming it is the cwd.\n",
59
+ "def package_root() -> Path:\n",
60
+ " here = Path.cwd()\n",
61
+ " for parent in (here, *here.parents):\n",
62
+ " for candidate in (parent, parent / \"pkg-py\"):\n",
63
+ " if (candidate / \"demo.py\").is_file():\n",
64
+ " return candidate\n",
65
+ " raise FileNotFoundError(f\"No demo.py found at or above {here}\")\n",
66
+ "\n",
67
+ "\n",
68
+ "root = package_root()\n",
69
+ "if str(root) not in sys.path:\n",
70
+ " sys.path.insert(0, str(root))\n",
71
+ "\n",
72
+ "import demo\n",
73
+ "\n",
74
+ "print(f\"demo.py from {root}\")\n",
75
+ "demo.stands"
76
+ ]
77
+ },
78
+ {
79
+ "cell_type": "code",
80
+ "execution_count": null,
81
+ "id": "15dc3335",
82
+ "metadata": {},
83
+ "outputs": [],
84
+ "source": [
85
+ "demo.surveys.head()"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "markdown",
90
+ "id": "cca80d3e",
91
+ "metadata": {},
92
+ "source": [
93
+ "A measure is plain Python that commons trusts. `warehouse` is annotated\n",
94
+ "`Injected`, so commons supplies the DuckDB connection and the model never sees\n",
95
+ "that argument. Called directly, a measure is just a function:"
96
+ ]
97
+ },
98
+ {
99
+ "cell_type": "code",
100
+ "execution_count": null,
101
+ "id": "2ab25f90",
102
+ "metadata": {},
103
+ "outputs": [],
104
+ "source": [
105
+ "import duckdb\n",
106
+ "\n",
107
+ "con = duckdb.connect()\n",
108
+ "con.register('stands', demo.stands)\n",
109
+ "con.register('surveys', demo.surveys)\n",
110
+ "\n",
111
+ "demo.canopy_by_county(con)"
112
+ ]
113
+ },
114
+ {
115
+ "cell_type": "markdown",
116
+ "id": "a4e22e30",
117
+ "metadata": {},
118
+ "source": [
119
+ "## The agent\n",
120
+ "\n",
121
+ "One `Commons` over all three layers: the data source, the semantic layer of three\n",
122
+ "measures, and the context layer holding the notes prose."
123
+ ]
124
+ },
125
+ {
126
+ "cell_type": "code",
127
+ "execution_count": null,
128
+ "id": "40061944",
129
+ "metadata": {},
130
+ "outputs": [],
131
+ "source": [
132
+ "canopy = demo.agent()\n",
133
+ "canopy"
134
+ ]
135
+ },
136
+ {
137
+ "cell_type": "markdown",
138
+ "id": "a0d3f47f",
139
+ "metadata": {},
140
+ "source": [
141
+ "Which tools registered depends on what you gave it. There is no catalog and no\n",
142
+ "governed definitions here, so `search_catalog` and `call_metrics` are absent.\n",
143
+ "\n",
144
+ "`Commons` inherits from chatlas `Chat`, so `get_tools()`, `system_prompt` and the\n",
145
+ "rest of that surface work on `canopy` directly. Ask questions with `chat()` or\n",
146
+ "`stream_async()` only. The other entry points chatlas offers would skip the citation\n",
147
+ "scanner and the provenance tag, so each of them raises `NotImplementedError`."
148
+ ]
149
+ },
150
+ {
151
+ "cell_type": "code",
152
+ "execution_count": null,
153
+ "id": "641ff52d",
154
+ "metadata": {},
155
+ "outputs": [],
156
+ "source": [
157
+ "sorted(tool.name for tool in canopy.get_tools())"
158
+ ]
159
+ },
160
+ {
161
+ "cell_type": "markdown",
162
+ "id": "5aecee02",
163
+ "metadata": {},
164
+ "source": [
165
+ "The system prompt is assembled from the shared `prompts/` source plus everything\n",
166
+ "commons derived from your sources. Worth reading once."
167
+ ]
168
+ },
169
+ {
170
+ "cell_type": "code",
171
+ "execution_count": null,
172
+ "id": "3f9c7576",
173
+ "metadata": {},
174
+ "outputs": [],
175
+ "source": [
176
+ "print(canopy.system_prompt)"
177
+ ]
178
+ },
179
+ {
180
+ "cell_type": "markdown",
181
+ "id": "56175848",
182
+ "metadata": {},
183
+ "source": [
184
+ "The citation corpus is the trusted text an answer is allowed to quote. An answer\n",
185
+ "that quotes something outside it does not earn a citation."
186
+ ]
187
+ },
188
+ {
189
+ "cell_type": "code",
190
+ "execution_count": null,
191
+ "id": "82c0d634",
192
+ "metadata": {},
193
+ "outputs": [],
194
+ "source": [
195
+ "for entry in canopy.citation_corpus():\n",
196
+ " print(entry)"
197
+ ]
198
+ },
199
+ {
200
+ "cell_type": "markdown",
201
+ "id": "89efc318",
202
+ "metadata": {},
203
+ "source": [
204
+ "## Ask it something\n",
205
+ "\n",
206
+ "`demo.ask` streams with `content=\"all\"`, the mode a chat UI uses, and prints a line\n",
207
+ "naming each tool as it runs. Asking for text instead yields a bare `\\n\\n` per tool\n",
208
+ "result, standing in for content it is not emitting, which shows up as a blank gap.\n",
209
+ "\n",
210
+ "The provenance marker arrives last, as HTML for a UI to render, so here it prints as\n",
211
+ "raw tags. A question the measures cover should come back `Trusted`."
212
+ ]
213
+ },
214
+ {
215
+ "cell_type": "code",
216
+ "execution_count": null,
217
+ "id": "9cc30c9e",
218
+ "metadata": {},
219
+ "outputs": [],
220
+ "source": [
221
+ "await demo.ask(canopy, 'Which county has the most canopy cover?')"
222
+ ]
223
+ },
224
+ {
225
+ "cell_type": "markdown",
226
+ "metadata": {},
227
+ "source": [
228
+ "`canopy_headline` draws its own card: commons frames the metadata and arguments,\n",
229
+ "and the measure authors the big-number HTML inside. A UI renders that HTML; here it\n",
230
+ "prints as raw tags."
231
+ ]
232
+ },
233
+ {
234
+ "cell_type": "code",
235
+ "execution_count": null,
236
+ "metadata": {},
237
+ "outputs": [],
238
+ "source": [
239
+ "await demo.ask(canopy, 'Draw a canopy headline for Lane County.')"
240
+ ]
241
+ },
242
+ {
243
+ "cell_type": "markdown",
244
+ "id": "835a70e0",
245
+ "metadata": {},
246
+ "source": [
247
+ "A question no measure covers has to reach `run_sql` instead, so the same agent\n",
248
+ "answers it `Untrusted`, or `Cited` if it quotes the notes. The `Cited` marker\n",
249
+ "renders nothing of its own, because the citation aside already says as much."
250
+ ]
251
+ },
252
+ {
253
+ "cell_type": "code",
254
+ "execution_count": null,
255
+ "id": "841e19d0",
256
+ "metadata": {},
257
+ "outputs": [],
258
+ "source": [
259
+ "await demo.ask(canopy, 'How much canopy has Winberry Ridge gained since 2021?')"
260
+ ]
261
+ },
262
+ {
263
+ "cell_type": "markdown",
264
+ "id": "e910b1d8",
265
+ "metadata": {},
266
+ "source": [
267
+ "Which tools that took:"
268
+ ]
269
+ },
270
+ {
271
+ "cell_type": "code",
272
+ "execution_count": null,
273
+ "id": "3e7c1b8f",
274
+ "metadata": {},
275
+ "outputs": [],
276
+ "source": [
277
+ "demo.tools_run(canopy)"
278
+ ]
279
+ },
280
+ {
281
+ "cell_type": "markdown",
282
+ "id": "6d7984af",
283
+ "metadata": {},
284
+ "source": [
285
+ "## Your turn\n",
286
+ "\n",
287
+ "Ask it anything. The notes say canopy is always acre-weighted and that baseline\n",
288
+ "statistics cover established stands only, so questions that brush against those\n",
289
+ "rules are the interesting ones.\n",
290
+ "\n",
291
+ "`canopy` keeps the conversation, so follow-up questions have the earlier turns."
292
+ ]
293
+ },
294
+ {
295
+ "cell_type": "code",
296
+ "execution_count": null,
297
+ "id": "f3605303",
298
+ "metadata": {},
299
+ "outputs": [],
300
+ "source": [
301
+ "await demo.ask(canopy, 'Is a plain average of canopy_pct across stands wrong? Why?')"
302
+ ]
303
+ },
304
+ {
305
+ "cell_type": "markdown",
306
+ "id": "9ab02b27",
307
+ "metadata": {},
308
+ "source": [
309
+ "To try a measure of your own, add it to the semantic layer and rebuild. What that\n",
310
+ "changes is not the tool list, since `call_measure` is already registered, but what\n",
311
+ "`search_pool` can find and therefore what earns the `Trusted` outcome."
312
+ ]
313
+ },
314
+ {
315
+ "cell_type": "code",
316
+ "execution_count": null,
317
+ "id": "a0584084",
318
+ "metadata": {},
319
+ "outputs": [],
320
+ "source": [
321
+ "from typing import Any\n",
322
+ "\n",
323
+ "import commons\n",
324
+ "\n",
325
+ "\n",
326
+ "@commons.measure(description='Total acres by forest type, largest first.')\n",
327
+ "def acres_by_forest_type(warehouse: commons.Injected[Any]):\n",
328
+ " return warehouse.execute(\n",
329
+ " 'SELECT forest_type, SUM(acres) AS acres FROM stands'\n",
330
+ " ' GROUP BY forest_type ORDER BY acres DESC'\n",
331
+ " ).fetchdf()\n",
332
+ "\n",
333
+ "\n",
334
+ "layer = commons.semantic_layer(\n",
335
+ " demo.canopy_by_county,\n",
336
+ " demo.low_canopy_stands,\n",
337
+ " demo.canopy_headline,\n",
338
+ " acres_by_forest_type,\n",
339
+ ")\n",
340
+ "\n",
341
+ "mine = commons.Commons(\n",
342
+ " client=demo.client(),\n",
343
+ " data_sources={'warehouse': commons.data_source(stands=demo.stands, surveys=demo.surveys)},\n",
344
+ " semantic_layer=layer,\n",
345
+ " context_layer=commons.context_layer(files=[demo.shared_notes_file()]),\n",
346
+ ")\n",
347
+ "\n",
348
+ "sorted(layer.measures)"
349
+ ]
350
+ },
351
+ {
352
+ "cell_type": "markdown",
353
+ "id": "5a36487af549",
354
+ "metadata": {},
355
+ "source": [
356
+ "The question below has no measure behind it in `canopy`, so that agent would have to\n",
357
+ "reach `run_sql`. `mine` has one, so watch which tools it runs and which marker it\n",
358
+ "ends with."
359
+ ]
360
+ },
361
+ {
362
+ "cell_type": "code",
363
+ "execution_count": null,
364
+ "id": "315c6dc15abb",
365
+ "metadata": {},
366
+ "outputs": [],
367
+ "source": [
368
+ "await demo.ask(mine, 'How many acres are ponderosa pine?')"
369
+ ]
370
+ }
371
+ ],
372
+ "metadata": {
373
+ "kernelspec": {
374
+ "display_name": "Python 3 (ipykernel)",
375
+ "language": "python",
376
+ "name": "python3"
377
+ },
378
+ "language_info": {
379
+ "codemirror_mode": {
380
+ "name": "ipython",
381
+ "version": 3
382
+ },
383
+ "file_extension": ".py",
384
+ "mimetype": "text/x-python",
385
+ "name": "python",
386
+ "nbconvert_exporter": "python",
387
+ "pygments_lexer": "ipython3",
388
+ "version": "3.13.15"
389
+ }
390
+ },
391
+ "nbformat": 4,
392
+ "nbformat_minor": 5
393
+ }