trulens-core 1.0.1a1__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 (53) hide show
  1. trulens_core-1.0.1a1/PKG-INFO +38 -0
  2. trulens_core-1.0.1a1/README.md +1 -0
  3. trulens_core-1.0.1a1/pyproject.toml +60 -0
  4. trulens_core-1.0.1a1/trulens/core/__init__.py +40 -0
  5. trulens_core-1.0.1a1/trulens/core/app/__init__.py +23 -0
  6. trulens_core-1.0.1a1/trulens/core/app/base.py +1538 -0
  7. trulens_core-1.0.1a1/trulens/core/app/basic.py +168 -0
  8. trulens_core-1.0.1a1/trulens/core/app/custom.py +541 -0
  9. trulens_core-1.0.1a1/trulens/core/app/virtual.py +572 -0
  10. trulens_core-1.0.1a1/trulens/core/database/__init__.py +0 -0
  11. trulens_core-1.0.1a1/trulens/core/database/base.py +287 -0
  12. trulens_core-1.0.1a1/trulens/core/database/exceptions.py +66 -0
  13. trulens_core-1.0.1a1/trulens/core/database/legacy/__init__.py +0 -0
  14. trulens_core-1.0.1a1/trulens/core/database/legacy/migration.py +399 -0
  15. trulens_core-1.0.1a1/trulens/core/database/migrations/__init__.py +184 -0
  16. trulens_core-1.0.1a1/trulens/core/database/migrations/alembic.ini +104 -0
  17. trulens_core-1.0.1a1/trulens/core/database/migrations/data.py +191 -0
  18. trulens_core-1.0.1a1/trulens/core/database/migrations/env.py +99 -0
  19. trulens_core-1.0.1a1/trulens/core/database/migrations/script.py.mako +35 -0
  20. trulens_core-1.0.1a1/trulens/core/database/migrations/versions/1_first_revision.py +80 -0
  21. trulens_core-1.0.1a1/trulens/core/database/orm.py +380 -0
  22. trulens_core-1.0.1a1/trulens/core/database/sqlalchemy.py +943 -0
  23. trulens_core-1.0.1a1/trulens/core/database/utils.py +230 -0
  24. trulens_core-1.0.1a1/trulens/core/feedback/__init__.py +13 -0
  25. trulens_core-1.0.1a1/trulens/core/feedback/endpoint.py +966 -0
  26. trulens_core-1.0.1a1/trulens/core/feedback/feedback.py +1220 -0
  27. trulens_core-1.0.1a1/trulens/core/feedback/provider.py +71 -0
  28. trulens_core-1.0.1a1/trulens/core/guardrails/__init__.py +0 -0
  29. trulens_core-1.0.1a1/trulens/core/guardrails/base.py +73 -0
  30. trulens_core-1.0.1a1/trulens/core/instruments.py +1035 -0
  31. trulens_core-1.0.1a1/trulens/core/py.typed +0 -0
  32. trulens_core-1.0.1a1/trulens/core/schema/__init__.py +38 -0
  33. trulens_core-1.0.1a1/trulens/core/schema/app.py +279 -0
  34. trulens_core-1.0.1a1/trulens/core/schema/base.py +102 -0
  35. trulens_core-1.0.1a1/trulens/core/schema/feedback.py +408 -0
  36. trulens_core-1.0.1a1/trulens/core/schema/record.py +255 -0
  37. trulens_core-1.0.1a1/trulens/core/schema/select.py +146 -0
  38. trulens_core-1.0.1a1/trulens/core/schema/types.py +60 -0
  39. trulens_core-1.0.1a1/trulens/core/tru.py +942 -0
  40. trulens_core-1.0.1a1/trulens/core/utils/__init__.py +0 -0
  41. trulens_core-1.0.1a1/trulens/core/utils/asynchro.py +169 -0
  42. trulens_core-1.0.1a1/trulens/core/utils/constants.py +18 -0
  43. trulens_core-1.0.1a1/trulens/core/utils/containers.py +193 -0
  44. trulens_core-1.0.1a1/trulens/core/utils/imports.py +576 -0
  45. trulens_core-1.0.1a1/trulens/core/utils/json.py +442 -0
  46. trulens_core-1.0.1a1/trulens/core/utils/keys.py +438 -0
  47. trulens_core-1.0.1a1/trulens/core/utils/pace.py +137 -0
  48. trulens_core-1.0.1a1/trulens/core/utils/pyschema.py +722 -0
  49. trulens_core-1.0.1a1/trulens/core/utils/python.py +856 -0
  50. trulens_core-1.0.1a1/trulens/core/utils/serial.py +1212 -0
  51. trulens_core-1.0.1a1/trulens/core/utils/text.py +118 -0
  52. trulens_core-1.0.1a1/trulens/core/utils/threading.py +216 -0
  53. trulens_core-1.0.1a1/trulens/core/utils/trulens.py +82 -0
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.1
2
+ Name: trulens-core
3
+ Version: 1.0.1a1
4
+ Summary: Library to systematically track and evaluate LLM based applications.
5
+ Home-page: https://trulens.org/
6
+ License: MIT
7
+ Author: Snowflake Inc.
8
+ Author-email: ml-observability-wg-dl@snowflake.com
9
+ Requires-Python: >=3.9,<4.0
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Provides-Extra: snowflake
19
+ Requires-Dist: alembic (>=1.11,<2.0)
20
+ Requires-Dist: dill (>=0.3,<0.4)
21
+ Requires-Dist: munch (>=3.0,<4.0)
22
+ Requires-Dist: nest-asyncio (>=1.5,<2.0)
23
+ Requires-Dist: numpy (>=1.23,<2.0)
24
+ Requires-Dist: pydantic (>=2,<3)
25
+ Requires-Dist: python-dotenv (>=1.0,<2.0)
26
+ Requires-Dist: snowflake-connector-python (>=3.11.0,<4.0.0) ; (python_version < "3.12") and (extra == "snowflake")
27
+ Requires-Dist: snowflake-core (>=0.9.0,<0.10.0) ; (python_version < "3.12") and (extra == "snowflake")
28
+ Requires-Dist: snowflake-snowpark-python (>=1.20.0,<2.0.0) ; (python_version < "3.12") and (extra == "snowflake")
29
+ Requires-Dist: snowflake-sqlalchemy (>=1.6,<2.0) ; (python_version < "3.12") and (extra == "snowflake")
30
+ Requires-Dist: sqlalchemy (>=2.0,<3.0)
31
+ Requires-Dist: tqdm (>=4.66,<5.0)
32
+ Requires-Dist: typing_extensions (>=4.9,<5.0)
33
+ Project-URL: Documentation, https://trulens.org/trulens/getting_started/
34
+ Project-URL: Repository, https://github.com/truera/trulens
35
+ Description-Content-Type: text/markdown
36
+
37
+ # trulens-core
38
+
@@ -0,0 +1 @@
1
+ # trulens-core
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ build-backend = "poetry.core.masonry.api"
3
+ requires = [
4
+ "poetry-core",
5
+ ]
6
+
7
+ [tool.poetry]
8
+ name = "trulens-core"
9
+ version = "1.0.1a1"
10
+ description = "Library to systematically track and evaluate LLM based applications."
11
+ authors = [
12
+ "Snowflake Inc. <ml-observability-wg-dl@snowflake.com>",
13
+ ]
14
+ license = "MIT"
15
+ readme = "README.md"
16
+ packages = [
17
+ { include = "trulens" },
18
+ ]
19
+ homepage = "https://trulens.org/"
20
+ documentation = "https://trulens.org/trulens/getting_started/"
21
+ repository = "https://github.com/truera/trulens"
22
+ classifiers = [
23
+ "Programming Language :: Python :: 3",
24
+ "Operating System :: OS Independent",
25
+ "Development Status :: 3 - Alpha",
26
+ "License :: OSI Approved :: MIT License",
27
+ ]
28
+
29
+ [tool.poetry.dependencies]
30
+ python = "^3.9"
31
+ numpy = "^1.23"
32
+ munch = "^3.0"
33
+ dill = "^0.3"
34
+ tqdm = "^4.66"
35
+ typing_extensions = "^4.9"
36
+ pydantic = "^2"
37
+ sqlalchemy = "^2.0"
38
+ alembic = "^1.11"
39
+ nest-asyncio = "^1.5"
40
+ python-dotenv = "^1.0"
41
+
42
+ snowflake-core = { version = "^0.9.0", python = "<3.12", optional = true }
43
+ snowflake-connector-python = { version = "^3.11.0", python = "<3.12", optional = true }
44
+ snowflake-snowpark-python = { version = "^1.20.0", python = "<3.12", optional = true }
45
+ snowflake-sqlalchemy = { version = "^1.6", python = "<3.12", optional = true }
46
+
47
+ [tool.poetry.group.openai]
48
+ optional = true
49
+
50
+ [tool.poetry.group.openai.dependencies]
51
+ openai = "^1.37"
52
+ httpx = "^0.27"
53
+
54
+ [tool.poetry.extras]
55
+ snowflake = [
56
+ "snowflake-core",
57
+ "snowflake-connector-python",
58
+ "snowflake-snowpark-python",
59
+ "snowflake-sqlalchemy",
60
+ ]
@@ -0,0 +1,40 @@
1
+ """# Trulens Core LLM Evaluation Library
2
+
3
+ The `trulens-core` library includes everything to get started.
4
+
5
+ """
6
+
7
+ import os
8
+
9
+ # NOTE: workaround for MKL and multiprocessing
10
+ # https://github.com/pytorch/csprng/issues/115
11
+ os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
12
+
13
+ from importlib.metadata import version
14
+
15
+ from trulens.core.app import TruBasicApp
16
+ from trulens.core.app import TruCustomApp
17
+ from trulens.core.app import TruVirtual
18
+ from trulens.core.feedback import Feedback
19
+ from trulens.core.feedback import Provider
20
+ from trulens.core.schema import FeedbackMode
21
+ from trulens.core.schema import Select
22
+ from trulens.core.tru import Tru
23
+ from trulens.core.utils.imports import safe_importlib_package_name
24
+
25
+ __version__ = version(safe_importlib_package_name(__package__ or __name__))
26
+
27
+
28
+ __all__ = [
29
+ "Tru", # main interface
30
+ # app types
31
+ "TruBasicApp",
32
+ "TruCustomApp",
33
+ "TruVirtual",
34
+ # app setup
35
+ "FeedbackMode",
36
+ # feedback setup
37
+ "Feedback",
38
+ "Select",
39
+ "Provider",
40
+ ]
@@ -0,0 +1,23 @@
1
+ """
2
+ Apps in trulens derive from two classes,
3
+ [AppDefinition][trulens.core.schema.AppDefinition] and
4
+ [App][trulens.core.app.App]. The first contains only serialized or serializable
5
+ components in a JSON-like format while the latter contains the executable apps
6
+ that may or may not be serializable.
7
+ """
8
+
9
+ from trulens.core.app.base import App
10
+ from trulens.core.app.basic import TruBasicApp
11
+ from trulens.core.app.basic import TruWrapperApp
12
+ from trulens.core.app.custom import TruCustomApp
13
+ from trulens.core.app.virtual import TruVirtual
14
+ from trulens.core.app.virtual import VirtualApp
15
+
16
+ __all__ = [
17
+ "App",
18
+ "TruBasicApp",
19
+ "TruWrapperApp",
20
+ "TruCustomApp",
21
+ "TruVirtual",
22
+ "VirtualApp",
23
+ ]