commons 0.1.0__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 (102) hide show
  1. commons/__init__.py +48 -0
  2. commons/_agent.py +655 -0
  3. commons/_backends.py +244 -0
  4. commons/_catalog/__init__.py +73 -0
  5. commons/_catalog/_core.py +617 -0
  6. commons/_catalog/_databricks.py +296 -0
  7. commons/_catalog/_databricks_semantic.py +485 -0
  8. commons/_catalog/_import.py +270 -0
  9. commons/_catalog/_security.py +433 -0
  10. commons/_catalog/_snowflake.py +174 -0
  11. commons/_catalog/_snowflake_semantic.py +566 -0
  12. commons/_citation_scan.py +320 -0
  13. commons/_citations.py +383 -0
  14. commons/_connect.py +683 -0
  15. commons/_context_layer.py +193 -0
  16. commons/_data_dictionary.py +478 -0
  17. commons/_data_source.py +736 -0
  18. commons/_definitions/__init__.py +51 -0
  19. commons/_definitions/_compile.py +578 -0
  20. commons/_definitions/_emit_duckdb.py +346 -0
  21. commons/_definitions/_emit_sql.py +546 -0
  22. commons/_definitions/_export.py +876 -0
  23. commons/_definitions/_expression.py +529 -0
  24. commons/_definitions/_registry.py +311 -0
  25. commons/_display.py +322 -0
  26. commons/_duckdb.py +62 -0
  27. commons/_execution/__init__.py +1 -0
  28. commons/_execution/_backend.py +494 -0
  29. commons/_execution/_driver.py +511 -0
  30. commons/_execution/_env.py +74 -0
  31. commons/_execution/_protocol.py +1318 -0
  32. commons/_execution/_runtime/__init__.py +10 -0
  33. commons/_execution/_runtime/_figure_backend.py +30 -0
  34. commons/_execution/_runtime/_guardrails.py +215 -0
  35. commons/_execution/_runtime/_landlock.py +375 -0
  36. commons/_execution/_runtime/_limits.py +43 -0
  37. commons/_execution/_runtime/_plots.py +205 -0
  38. commons/_execution/_runtime/_repl.py +367 -0
  39. commons/_execution/_runtime/_seatbelt.py +155 -0
  40. commons/_execution/_runtime/_seccomp.py +821 -0
  41. commons/_execution/_runtime/_userns.py +662 -0
  42. commons/_execution/_runtime/_worker.py +451 -0
  43. commons/_execution/_sandbox.py +202 -0
  44. commons/_execution/_thread.py +190 -0
  45. commons/_frames.py +147 -0
  46. commons/_handles.py +84 -0
  47. commons/_icons.py +56 -0
  48. commons/_measure_results.py +206 -0
  49. commons/_measures.py +893 -0
  50. commons/_pool.py +602 -0
  51. commons/_prompt.py +303 -0
  52. commons/_provenance.py +156 -0
  53. commons/_reminders.py +56 -0
  54. commons/_rows.py +166 -0
  55. commons/_run_python.py +428 -0
  56. commons/_semantic_models.py +943 -0
  57. commons/_skills.py +53 -0
  58. commons/_sql_guard.py +167 -0
  59. commons/_tools.py +1005 -0
  60. commons/_tracing.py +387 -0
  61. commons/_trajectory/__init__.py +157 -0
  62. commons/_trajectory/_build.py +618 -0
  63. commons/_trajectory/_deployment.py +337 -0
  64. commons/_trajectory/_otlp.py +156 -0
  65. commons/_trajectory/_semconv.py +154 -0
  66. commons/_trajectory/_source.py +263 -0
  67. commons/_ui/__init__.py +46 -0
  68. commons/_ui/_app.py +58 -0
  69. commons/_ui/_assets.py +52 -0
  70. commons/_ui/_server.py +78 -0
  71. commons/_ui/_theme.py +61 -0
  72. commons/prompts/README.md +1 -0
  73. commons/prompts/citation-request.md +1 -0
  74. commons/prompts/skills/artifacts/SKILL.md +35 -0
  75. commons/prompts/skills/trust-system/SKILL.md +15 -0
  76. commons/prompts/system-prompt.md +173 -0
  77. commons/py.typed +0 -0
  78. commons/skills/commons/SKILL.md +105 -0
  79. commons/skills/commons/references/data-dictionaries.md +77 -0
  80. commons/skills/commons/references/evaluation.md +200 -0
  81. commons/skills/commons/references/extracting-from-artifacts.md +62 -0
  82. commons/skills/commons/references/iterating-from-trajectories.md +43 -0
  83. commons/skills/commons/references/onboarding.md +156 -0
  84. commons/ui.py +5 -0
  85. commons/www/README.md +1 -0
  86. commons/www/commons-chat/commons-artifact.css +79 -0
  87. commons/www/commons-chat/commons-artifact.js +358 -0
  88. commons/www/commons-chat/commons-chat.css +716 -0
  89. commons/www/commons-chat/commons-chat.js +94 -0
  90. commons/www/commons-chat/commons-document.css +187 -0
  91. commons/www/commons-chat/figs/citation-definition.svg +4 -0
  92. commons/www/commons-chat/figs/citation-mark.svg +5 -0
  93. commons/www/commons-chat/figs/citation-prose.svg +4 -0
  94. commons/www/commons-chat/figs/citation-schema.svg +4 -0
  95. commons/www/commons-chat/figs/trusted-icon.svg +6 -0
  96. commons/www/commons-chat/figs/warning-icon.svg +7 -0
  97. commons/www/commons-share/commons-share.css +166 -0
  98. commons/www/commons-share/commons-share.js +131 -0
  99. commons-0.1.0.dist-info/METADATA +96 -0
  100. commons-0.1.0.dist-info/RECORD +102 -0
  101. commons-0.1.0.dist-info/WHEEL +4 -0
  102. commons-0.1.0.dist-info/licenses/LICENSE.md +21 -0
commons/__init__.py ADDED
@@ -0,0 +1,48 @@
1
+ """Build trustworthy data agents.
2
+
3
+ Give an LLM data, semantic, and context layers to work with, tools for
4
+ querying them, and A/B/C provenance semantics so every answer carries a
5
+ classification as to how much it can be trusted.
6
+ """
7
+
8
+ import importlib
9
+ from typing import Any
10
+
11
+ from ._agent import Commons
12
+ from ._citations import CitationDecision
13
+ from ._context_layer import ContextLayer, context_layer
14
+ from ._data_source import DataSource, data_source, list_tables
15
+ from ._measures import Injected, Measure, SemanticLayer, measure, semantic_layer
16
+ from ._provenance import Tag
17
+ from ._trajectory import Exchange, Trajectory, trajectory_read
18
+
19
+ __all__: list[str] = [
20
+ "CitationDecision",
21
+ "Commons",
22
+ "ContextLayer",
23
+ "DataSource",
24
+ "Exchange",
25
+ "Injected",
26
+ "Measure",
27
+ "SemanticLayer",
28
+ "Tag",
29
+ "Trajectory",
30
+ "context_layer",
31
+ "data_source",
32
+ "list_tables",
33
+ "measure",
34
+ "semantic_layer",
35
+ "trajectory_read",
36
+ ]
37
+
38
+
39
+ def __getattr__(name: str) -> Any:
40
+ # `commons.ui` is resolved on first use so that importing commons does
41
+ # not import shiny for users who may never build a UI.
42
+ if name == "ui":
43
+ return importlib.import_module(f"{__name__}.ui")
44
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
45
+
46
+
47
+ def __dir__() -> list[str]:
48
+ return sorted([*__all__, "ui"])