divi 0.0.1.dev12__tar.gz → 0.0.1.dev13__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 (152) hide show
  1. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/.gitignore +1 -0
  2. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/PKG-INFO +1 -1
  3. divi-0.0.1.dev13/README.md +16 -0
  4. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/package.json +8 -9
  5. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/package.json +9 -13
  6. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/__init__.py +1 -1
  7. divi-0.0.1.dev13/divi/decorators/observable.py +108 -0
  8. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/proto/common/v1/common.proto +6 -6
  9. divi-0.0.1.dev13/divi/proto/common/v1/common_pb2.py +45 -0
  10. divi-0.0.1.dev13/divi/proto/common/v1/common_pb2.pyi +56 -0
  11. divi-0.0.1.dev13/divi/proto/core/health/v1/health_service_pb2.py +41 -0
  12. divi-0.0.1.dev13/divi/proto/core/health/v1/health_service_pb2.pyi +19 -0
  13. divi-0.0.1.dev13/divi/proto/core/health/v1/health_service_pb2_grpc.py +100 -0
  14. divi-0.0.1.dev13/divi/proto/metric/v1/metric.proto +29 -0
  15. divi-0.0.1.dev13/divi/proto/metric/v1/metric_pb2.py +40 -0
  16. divi-0.0.1.dev13/divi/proto/metric/v1/metric_pb2.pyi +27 -0
  17. divi-0.0.1.dev13/divi/proto/run/v1/run.proto +38 -0
  18. divi-0.0.1.dev13/divi/proto/run/v1/run_pb2.py +40 -0
  19. divi-0.0.1.dev13/divi/proto/run/v1/run_pb2.pyi +34 -0
  20. divi-0.0.1.dev13/divi/proto/trace/v1/trace.proto +50 -0
  21. divi-0.0.1.dev13/divi/proto/trace/v1/trace_pb2.py +42 -0
  22. divi-0.0.1.dev13/divi/proto/trace/v1/trace_pb2.pyi +42 -0
  23. divi-0.0.1.dev13/divi/run/__init__.py +3 -0
  24. divi-0.0.1.dev13/divi/run/run.py +24 -0
  25. divi-0.0.1.dev13/divi/run/setup.py +50 -0
  26. divi-0.0.1.dev13/divi/run/teardown.py +7 -0
  27. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/auth/init.py +2 -5
  28. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/core/core.py +3 -3
  29. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/core/init.py +5 -12
  30. divi-0.0.1.dev13/divi/services/datapark/__init__.py +4 -0
  31. divi-0.0.1.dev13/divi/services/datapark/init.py +5 -0
  32. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/finish.py +4 -0
  33. divi-0.0.1.dev13/divi/services/init.py +13 -0
  34. divi-0.0.1.dev13/divi/signals/__init__.py +3 -0
  35. divi-0.0.1.dev13/divi/signals/trace/__init__.py +3 -0
  36. divi-0.0.1.dev13/divi/signals/trace/trace.py +81 -0
  37. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/docker-compose.yml +0 -2
  38. divi-0.0.1.dev12/README.md → divi-0.0.1.dev13/docs/developer_tools.md +1 -25
  39. divi-0.0.1.dev13/docs/images/architecture.svg +2 -0
  40. divi-0.0.1.dev13/docs/images/storage.svg +2 -0
  41. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/pnpm-lock.yaml +447 -471
  42. divi-0.0.1.dev13/pnpm-workspace.yaml +18 -0
  43. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/scripts/proto_build.py +5 -3
  44. divi-0.0.1.dev13/services/proto/common.pb.go +542 -0
  45. divi-0.0.1.dev13/services/proto/health_service.pb.go +196 -0
  46. divi-0.0.1.dev13/services/proto/health_service_grpc.pb.go +125 -0
  47. divi-0.0.1.dev13/services/proto/metric.pb.go +237 -0
  48. divi-0.0.1.dev13/services/proto/resource.pb.go +153 -0
  49. divi-0.0.1.dev13/services/proto/run.pb.go +261 -0
  50. divi-0.0.1.dev13/services/proto/trace.pb.go +336 -0
  51. divi-0.0.1.dev13/tests/__init__.py +1 -0
  52. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/tests/unit_tests/decorators/test_obs_openai.py +1 -1
  53. divi-0.0.1.dev13/tests/unit_tests/decorators/test_observable.py +36 -0
  54. divi-0.0.1.dev12/divi/decorators/observable.py +0 -40
  55. divi-0.0.1.dev12/divi/proto/resource/v1/resource.proto +0 -19
  56. divi-0.0.1.dev12/divi/proto/trace/v1/trace.proto +0 -18
  57. divi-0.0.1.dev12/divi/run/__init__.py +0 -3
  58. divi-0.0.1.dev12/divi/run/run.py +0 -2
  59. divi-0.0.1.dev12/divi/services/datapark/__init__.py +0 -3
  60. divi-0.0.1.dev12/divi/services/datapark/init.py +0 -9
  61. divi-0.0.1.dev12/divi/services/init.py +0 -7
  62. divi-0.0.1.dev12/divi/signals/__init__.py +0 -4
  63. divi-0.0.1.dev12/divi/signals/metric/__init__.py +0 -3
  64. divi-0.0.1.dev12/divi/signals/metric/metric.py +0 -2
  65. divi-0.0.1.dev12/divi/signals/trace/__init__.py +0 -3
  66. divi-0.0.1.dev12/divi/signals/trace/trace.py +0 -2
  67. divi-0.0.1.dev12/pnpm-workspace.yaml +0 -4
  68. divi-0.0.1.dev12/services/proto/core.pb.go +0 -74
  69. divi-0.0.1.dev12/services/proto/core_grpc.pb.go +0 -125
  70. divi-0.0.1.dev12/services/proto/health.pb.go +0 -216
  71. divi-0.0.1.dev12/tests/__init__.py +0 -1
  72. divi-0.0.1.dev12/tests/unit_tests/decorators/test_observable.py +0 -18
  73. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/.air.toml +0 -0
  74. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/.dockerignore +0 -0
  75. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/.github/dependabot.yml +0 -0
  76. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/LICENSE +0 -0
  77. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/README.md +0 -0
  78. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/Dockerfile +0 -0
  79. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/README.md +0 -0
  80. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/codegen.ts +0 -0
  81. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/datasources/auth-api.ts +0 -0
  82. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/index.ts +0 -0
  83. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/resolvers.ts +0 -0
  84. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/schema.graphql +0 -0
  85. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/types/api-key.d.ts +0 -0
  86. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/types/context.d.ts +0 -0
  87. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/types/response.d.ts +0 -0
  88. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/types/types.d.ts +0 -0
  89. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/src/types/user.d.ts +0 -0
  90. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/graphql/tsconfig.json +0 -0
  91. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/.gitignore +0 -0
  92. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/README.md +0 -0
  93. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/app/favicon.ico +0 -0
  94. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/app/layout.tsx +0 -0
  95. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/app/login/page.tsx +0 -0
  96. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/app/page.tsx +0 -0
  97. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/app/signup/page.tsx +0 -0
  98. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/components/ApolloWrapper.tsx +0 -0
  99. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/components/login-form.tsx +0 -0
  100. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/components/signup-form.tsx +0 -0
  101. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/components.json +0 -0
  102. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/hooks/apolloClient.ts +0 -0
  103. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/next-env.d.ts +0 -0
  104. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/next.config.ts +0 -0
  105. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/postcss.config.mjs +0 -0
  106. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/public/peeking-angel.png +0 -0
  107. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/public/thinking-angel.png +0 -0
  108. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/apps/web/tsconfig.json +0 -0
  109. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/biome.json +0 -0
  110. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/config/config.py +0 -0
  111. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/decorators/__init__.py +0 -0
  112. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/decorators/obs_openai.py +0 -0
  113. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/proto/core/health/v1/health_service.proto +0 -0
  114. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/__init__.py +0 -0
  115. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/auth/__init__.py +0 -0
  116. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/auth/auth.py +0 -0
  117. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/auth/tokman.py +0 -0
  118. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/core/__init__.py +0 -0
  119. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/core/finish.py +0 -0
  120. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/datapark/datapark.py +0 -0
  121. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/services/service.py +0 -0
  122. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/divi/utils.py +0 -0
  123. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/docs/README.md +0 -0
  124. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/docs/package_readme.md +0 -0
  125. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/go.work +0 -0
  126. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/go.work.sum +0 -0
  127. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/hatch.toml +0 -0
  128. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/package.json +0 -0
  129. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/packages/README.md +0 -0
  130. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/pyproject.toml +0 -0
  131. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/scripts/README.md +0 -0
  132. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/scripts/hatch_build.py +0 -0
  133. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/scripts/key_build.py +0 -0
  134. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/README.md +0 -0
  135. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/go.mod +0 -0
  136. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/go.sum +0 -0
  137. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/auth/handler/api.go +0 -0
  138. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/auth/handler/api_key.go +0 -0
  139. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/auth/handler/auth.go +0 -0
  140. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/auth/handler/user.go +0 -0
  141. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/auth/middleware/auth.go +0 -0
  142. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/auth/router/router.go +0 -0
  143. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/core/.keep +0 -0
  144. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/app/datapark/.keep +0 -0
  145. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/pkg/auth/auth.go +0 -0
  146. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/pkg/config/config.go +0 -0
  147. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/pkg/database/connect.go +0 -0
  148. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/pkg/database/database.go +0 -0
  149. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/pkg/model/api_key.go +0 -0
  150. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/services/internal/pkg/model/user.go +0 -0
  151. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/turbo.json +0 -0
  152. {divi-0.0.1.dev12 → divi-0.0.1.dev13}/uv.lock +0 -0
@@ -45,6 +45,7 @@ coverage
45
45
  npm-debug.log*
46
46
  yarn-debug.log*
47
47
  yarn-error.log*
48
+ .pytest_cache/
48
49
 
49
50
  # Misc
50
51
  .DS_Store
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: divi
3
- Version: 0.0.1.dev12
3
+ Version: 0.0.1.dev13
4
4
  Summary: The Agent Platform for Observability & Evaluation
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -0,0 +1,16 @@
1
+ # divine-agent
2
+
3
+ **Agent Platform for Observability • Evaluation • Playground**
4
+
5
+ ## TODO
6
+
7
+ - [ ] trace: obs_openai()
8
+ - [ ] trace: @obs
9
+ - [ ] datapark services
10
+ - [ ] collect data
11
+
12
+ ## Architecture
13
+
14
+ ![architecture](./docs/images/architecture.svg)
15
+
16
+ ![storage](./docs/images/storage.svg)
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@app/graphql",
3
3
  "private": true,
4
- "version": "0.1.0",
5
4
  "main": "index.ts",
6
5
  "scripts": {
7
6
  "dev": "ts-node-dev --respawn ./src/index.ts",
@@ -11,19 +10,19 @@
11
10
  "postbuild": "cp src/schema.graphql dist/"
12
11
  },
13
12
  "dependencies": {
14
- "@apollo/datasource-rest": "^6.4.1",
15
- "@apollo/server": "^4.11.3",
16
- "@apollo/utils.keyvaluecache": "^3.1.0",
17
13
  "graphql": "^16.10.0",
18
- "graphql-tag": "^2.12.6"
14
+ "graphql-tag": "^2.12.6",
15
+ "@apollo/server": "^4.11.3",
16
+ "@apollo/datasource-rest": "^6.4.1",
17
+ "@apollo/utils.keyvaluecache": "^3.1.0"
19
18
  },
20
19
  "devDependencies": {
20
+ "typescript": "catalog:",
21
+ "nodemon": "^3.1.9",
22
+ "ts-node-dev": "^2.0.0",
21
23
  "@graphql-codegen/cli": "^4.0.1",
22
24
  "@graphql-codegen/typescript": "^4.1.5",
23
25
  "@graphql-codegen/typescript-resolvers": "^4.4.4",
24
- "@workspace/typescript-config": "workspace:*",
25
- "nodemon": "^3.1.9",
26
- "ts-node-dev": "^2.0.0",
27
- "typescript": "^5.7.3"
26
+ "@workspace/typescript-config": "workspace:*"
28
27
  }
29
28
  }
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "@app/web",
3
- "version": "0.1.0",
4
3
  "private": true,
5
4
  "type": "module",
6
5
  "scripts": {
@@ -10,23 +9,20 @@
10
9
  "analyze": "ANALYZE=true pnpm build"
11
10
  },
12
11
  "dependencies": {
13
- "@apollo/client": "^3.13.1",
12
+ "@apollo/client": "^3.13.2",
14
13
  "@apollo/experimental-nextjs-app-support": "^0.11.9",
15
14
  "@workspace/graphql-client": "workspace:*",
16
-
17
- "@radix-ui/react-slot": "^1.1.2",
18
15
  "@workspace/ui": "workspace:*",
19
- "lucide-react": "^0.475.0",
20
-
21
- "next": "^15.1.7",
22
- "react": "^19.0.0",
23
- "react-dom": "^19.0.0"
16
+ "lucide-react": "catalog:",
17
+ "next": "catalog:",
18
+ "react": "catalog:",
19
+ "react-dom": "catalog:"
24
20
  },
25
21
  "devDependencies": {
26
- "@types/node": "^22.13.5",
27
- "@types/react": "19.0.8",
28
- "@types/react-dom": "19.0.3",
22
+ "@types/node": "catalog:",
23
+ "@types/react": "catalog:",
24
+ "@types/react-dom": "catalog:",
29
25
  "@workspace/typescript-config": "workspace:*",
30
- "typescript": "5.7.3"
26
+ "typescript": "catalog:"
31
27
  }
32
28
  }
@@ -12,5 +12,5 @@ _core: Optional[Core] = None
12
12
  _auth: Optional[Auth] = None
13
13
  _datapark: Optional[DataPark] = None
14
14
 
15
- __version__ = "0.0.1.dev12"
15
+ __version__ = "0.0.1.dev13"
16
16
  __all__ = ["proto", "obs_openai", "observable"]
@@ -0,0 +1,108 @@
1
+ import contextvars
2
+ import functools
3
+ import inspect
4
+ from typing import (
5
+ Any,
6
+ Callable,
7
+ Generic,
8
+ List,
9
+ Mapping,
10
+ Optional,
11
+ ParamSpec,
12
+ Protocol,
13
+ TypeVar,
14
+ Union,
15
+ overload,
16
+ runtime_checkable,
17
+ )
18
+
19
+ from divi.run import RunExtra
20
+ from divi.run.setup import setup
21
+ from divi.signals.trace import Span
22
+
23
+ R = TypeVar("R", covariant=True)
24
+ P = ParamSpec("P")
25
+
26
+ # ContextVar to store the extra information
27
+ # from the Run and parent Span
28
+ _RUNEXTRA = contextvars.ContextVar[Optional[RunExtra]](
29
+ "_RUNEXTRA", default=None
30
+ )
31
+
32
+
33
+ @runtime_checkable
34
+ class WithRunExtra(Protocol, Generic[P, R]):
35
+ def __call__(
36
+ self,
37
+ *args: P.args,
38
+ run_extra: Optional[RunExtra] = None, # type: ignore[valid-type]
39
+ **kwargs: P.kwargs,
40
+ ) -> R: ...
41
+
42
+
43
+ @overload
44
+ def observable(func: Callable[P, R]) -> WithRunExtra[P, R]: ...
45
+
46
+
47
+ @overload
48
+ def observable(
49
+ kind: str = "function",
50
+ *,
51
+ name: Optional[str] = None,
52
+ metadata: Optional[Mapping[str, Any]] = None,
53
+ ) -> Callable[[Callable[P, R]], WithRunExtra[P, R]]: ...
54
+
55
+
56
+ def observable(
57
+ *args, **kwargs
58
+ ) -> Union[Callable, Callable[[Callable], Callable]]:
59
+ """Observable decorator factory."""
60
+
61
+ kind = kwargs.pop("kind", "function")
62
+ name = kwargs.pop("name", None)
63
+ metadata = kwargs.pop("metadata", None)
64
+
65
+ def decorator(func):
66
+ span = Span(kind=kind, name=name or func.__name__, metadata=metadata)
67
+
68
+ @functools.wraps(func)
69
+ def wrapper(*args, run_extra: Optional[RunExtra] = None, **kwargs):
70
+ run_extra = setup(span, _RUNEXTRA.get() or run_extra)
71
+ # set current context
72
+ token = _RUNEXTRA.set(run_extra)
73
+ # execute the function
74
+ span.start()
75
+ result = func(*args, **kwargs)
76
+ span.end()
77
+ # recover parent context
78
+ _RUNEXTRA.reset(token)
79
+ # TODO: collect result
80
+ return result
81
+
82
+ @functools.wraps(func)
83
+ def generator_wrapper(
84
+ *args, run_extra: Optional[RunExtra] = None, **kwargs
85
+ ):
86
+ run_extra = setup(span, _RUNEXTRA.get() or run_extra)
87
+ # set current context
88
+ token = _RUNEXTRA.set(run_extra)
89
+ # execute the function
90
+ results: List[Any] = []
91
+ span.start()
92
+ for item in func(*args, **kwargs):
93
+ results.append(item)
94
+ yield item
95
+ span.end()
96
+ # recover parent context
97
+ _RUNEXTRA.reset(token)
98
+ # TODO: collect results
99
+
100
+ if inspect.isgeneratorfunction(func):
101
+ return generator_wrapper
102
+ return wrapper
103
+
104
+ # Function Decorator
105
+ if len(args) == 1 and callable(args[0]) and not kwargs:
106
+ return decorator(args[0])
107
+ # Factory Decorator
108
+ return decorator
@@ -48,12 +48,12 @@ message KeyValue {
48
48
  AnyValue value = 2;
49
49
  }
50
50
 
51
- // InstrumentationScope is a message representing the instrumentation scope information
52
- // such as the fully qualified name and version.
53
- message InstrumentationScope {
54
- // An empty instrumentation scope name means the name is unknown.
55
- string name = 1;
56
- string version = 2;
51
+ // RunScope specifies the scope of the message
52
+ message RunScope {
53
+ // The run_id is a unique identifier that represents a run. It is a 16-byte array.
54
+ bytes run_id = 1;
55
+ // The name of the run.
56
+ string run_name = 2;
57
57
 
58
58
  // Additional attributes that describe the scope. [Optional].
59
59
  // Attribute keys MUST be unique (it is not allowed to have more than one
@@ -0,0 +1,45 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: divi/proto/common/v1/common.proto
5
+ # Protobuf Python Version: 5.29.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 29,
16
+ 0,
17
+ '',
18
+ 'divi/proto/common/v1/common.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!divi/proto/common/v1/common.proto\x12\x14\x64ivi.proto.common.v1\"\xfa\x01\n\x08\x41nyValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12\x37\n\x0b\x61rray_value\x18\x05 \x01(\x0b\x32 .divi.proto.common.v1.ArrayValueH\x00\x12:\n\x0ckvlist_value\x18\x06 \x01(\x0b\x32\".divi.proto.common.v1.KeyValueListH\x00\x12\x15\n\x0b\x62ytes_value\x18\x07 \x01(\x0cH\x00\x42\x07\n\x05value\"<\n\nArrayValue\x12.\n\x06values\x18\x01 \x03(\x0b\x32\x1e.divi.proto.common.v1.AnyValue\">\n\x0cKeyValueList\x12.\n\x06values\x18\x01 \x03(\x0b\x32\x1e.divi.proto.common.v1.KeyValue\"F\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0b\x32\x1e.divi.proto.common.v1.AnyValue\"\x82\x01\n\x08RunScope\x12\x0e\n\x06run_id\x18\x01 \x01(\x0c\x12\x10\n\x08run_name\x18\x02 \x01(\t\x12\x32\n\nattributes\x18\x03 \x03(\x0b\x32\x1e.divi.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\rB\x10Z\x0eservices/protob\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'divi.proto.common.v1.common_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ _globals['DESCRIPTOR']._loaded_options = None
34
+ _globals['DESCRIPTOR']._serialized_options = b'Z\016services/proto'
35
+ _globals['_ANYVALUE']._serialized_start=60
36
+ _globals['_ANYVALUE']._serialized_end=310
37
+ _globals['_ARRAYVALUE']._serialized_start=312
38
+ _globals['_ARRAYVALUE']._serialized_end=372
39
+ _globals['_KEYVALUELIST']._serialized_start=374
40
+ _globals['_KEYVALUELIST']._serialized_end=436
41
+ _globals['_KEYVALUE']._serialized_start=438
42
+ _globals['_KEYVALUE']._serialized_end=508
43
+ _globals['_RUNSCOPE']._serialized_start=511
44
+ _globals['_RUNSCOPE']._serialized_end=641
45
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,56 @@
1
+ from google.protobuf.internal import containers as _containers
2
+ from google.protobuf import descriptor as _descriptor
3
+ from google.protobuf import message as _message
4
+ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
5
+
6
+ DESCRIPTOR: _descriptor.FileDescriptor
7
+
8
+ class AnyValue(_message.Message):
9
+ __slots__ = ("string_value", "bool_value", "int_value", "double_value", "array_value", "kvlist_value", "bytes_value")
10
+ STRING_VALUE_FIELD_NUMBER: _ClassVar[int]
11
+ BOOL_VALUE_FIELD_NUMBER: _ClassVar[int]
12
+ INT_VALUE_FIELD_NUMBER: _ClassVar[int]
13
+ DOUBLE_VALUE_FIELD_NUMBER: _ClassVar[int]
14
+ ARRAY_VALUE_FIELD_NUMBER: _ClassVar[int]
15
+ KVLIST_VALUE_FIELD_NUMBER: _ClassVar[int]
16
+ BYTES_VALUE_FIELD_NUMBER: _ClassVar[int]
17
+ string_value: str
18
+ bool_value: bool
19
+ int_value: int
20
+ double_value: float
21
+ array_value: ArrayValue
22
+ kvlist_value: KeyValueList
23
+ bytes_value: bytes
24
+ def __init__(self, string_value: _Optional[str] = ..., bool_value: bool = ..., int_value: _Optional[int] = ..., double_value: _Optional[float] = ..., array_value: _Optional[_Union[ArrayValue, _Mapping]] = ..., kvlist_value: _Optional[_Union[KeyValueList, _Mapping]] = ..., bytes_value: _Optional[bytes] = ...) -> None: ...
25
+
26
+ class ArrayValue(_message.Message):
27
+ __slots__ = ("values",)
28
+ VALUES_FIELD_NUMBER: _ClassVar[int]
29
+ values: _containers.RepeatedCompositeFieldContainer[AnyValue]
30
+ def __init__(self, values: _Optional[_Iterable[_Union[AnyValue, _Mapping]]] = ...) -> None: ...
31
+
32
+ class KeyValueList(_message.Message):
33
+ __slots__ = ("values",)
34
+ VALUES_FIELD_NUMBER: _ClassVar[int]
35
+ values: _containers.RepeatedCompositeFieldContainer[KeyValue]
36
+ def __init__(self, values: _Optional[_Iterable[_Union[KeyValue, _Mapping]]] = ...) -> None: ...
37
+
38
+ class KeyValue(_message.Message):
39
+ __slots__ = ("key", "value")
40
+ KEY_FIELD_NUMBER: _ClassVar[int]
41
+ VALUE_FIELD_NUMBER: _ClassVar[int]
42
+ key: str
43
+ value: AnyValue
44
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[AnyValue, _Mapping]] = ...) -> None: ...
45
+
46
+ class RunScope(_message.Message):
47
+ __slots__ = ("run_id", "run_name", "attributes", "dropped_attributes_count")
48
+ RUN_ID_FIELD_NUMBER: _ClassVar[int]
49
+ RUN_NAME_FIELD_NUMBER: _ClassVar[int]
50
+ ATTRIBUTES_FIELD_NUMBER: _ClassVar[int]
51
+ DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER: _ClassVar[int]
52
+ run_id: bytes
53
+ run_name: str
54
+ attributes: _containers.RepeatedCompositeFieldContainer[KeyValue]
55
+ dropped_attributes_count: int
56
+ def __init__(self, run_id: _Optional[bytes] = ..., run_name: _Optional[str] = ..., attributes: _Optional[_Iterable[_Union[KeyValue, _Mapping]]] = ..., dropped_attributes_count: _Optional[int] = ...) -> None: ...
@@ -0,0 +1,41 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: divi/proto/core/health/v1/health_service.proto
5
+ # Protobuf Python Version: 5.29.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 29,
16
+ 0,
17
+ '',
18
+ 'divi/proto/core/health/v1/health_service.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.divi/proto/core/health/v1/health_service.proto\x12\x19\x64ivi.proto.core.health.v1\"%\n\x12HealthCheckRequest\x12\x0f\n\x07version\x18\x01 \x01(\t\"6\n\x13HealthCheckResponse\x12\x0e\n\x06status\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t2y\n\rHealthService\x12h\n\x05\x43heck\x12-.divi.proto.core.health.v1.HealthCheckRequest\x1a..divi.proto.core.health.v1.HealthCheckResponse\"\x00\x42\x10Z\x0eservices/protob\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'divi.proto.core.health.v1.health_service_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ _globals['DESCRIPTOR']._loaded_options = None
34
+ _globals['DESCRIPTOR']._serialized_options = b'Z\016services/proto'
35
+ _globals['_HEALTHCHECKREQUEST']._serialized_start=77
36
+ _globals['_HEALTHCHECKREQUEST']._serialized_end=114
37
+ _globals['_HEALTHCHECKRESPONSE']._serialized_start=116
38
+ _globals['_HEALTHCHECKRESPONSE']._serialized_end=170
39
+ _globals['_HEALTHSERVICE']._serialized_start=172
40
+ _globals['_HEALTHSERVICE']._serialized_end=293
41
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,19 @@
1
+ from google.protobuf import descriptor as _descriptor
2
+ from google.protobuf import message as _message
3
+ from typing import ClassVar as _ClassVar, Optional as _Optional
4
+
5
+ DESCRIPTOR: _descriptor.FileDescriptor
6
+
7
+ class HealthCheckRequest(_message.Message):
8
+ __slots__ = ("version",)
9
+ VERSION_FIELD_NUMBER: _ClassVar[int]
10
+ version: str
11
+ def __init__(self, version: _Optional[str] = ...) -> None: ...
12
+
13
+ class HealthCheckResponse(_message.Message):
14
+ __slots__ = ("status", "message")
15
+ STATUS_FIELD_NUMBER: _ClassVar[int]
16
+ MESSAGE_FIELD_NUMBER: _ClassVar[int]
17
+ status: bool
18
+ message: str
19
+ def __init__(self, status: bool = ..., message: _Optional[str] = ...) -> None: ...
@@ -0,0 +1,100 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from divi.proto.core.health.v1 import health_service_pb2 as divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.69.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in divi/proto/core/health/v1/health_service_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class HealthServiceStub(object):
29
+ """HealthService is a service that implements health check.
30
+ """
31
+
32
+ def __init__(self, channel):
33
+ """Constructor.
34
+
35
+ Args:
36
+ channel: A grpc.Channel.
37
+ """
38
+ self.Check = channel.unary_unary(
39
+ '/divi.proto.core.health.v1.HealthService/Check',
40
+ request_serializer=divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2.HealthCheckRequest.SerializeToString,
41
+ response_deserializer=divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2.HealthCheckResponse.FromString,
42
+ _registered_method=True)
43
+
44
+
45
+ class HealthServiceServicer(object):
46
+ """HealthService is a service that implements health check.
47
+ """
48
+
49
+ def Check(self, request, context):
50
+ """Missing associated documentation comment in .proto file."""
51
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
52
+ context.set_details('Method not implemented!')
53
+ raise NotImplementedError('Method not implemented!')
54
+
55
+
56
+ def add_HealthServiceServicer_to_server(servicer, server):
57
+ rpc_method_handlers = {
58
+ 'Check': grpc.unary_unary_rpc_method_handler(
59
+ servicer.Check,
60
+ request_deserializer=divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2.HealthCheckRequest.FromString,
61
+ response_serializer=divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2.HealthCheckResponse.SerializeToString,
62
+ ),
63
+ }
64
+ generic_handler = grpc.method_handlers_generic_handler(
65
+ 'divi.proto.core.health.v1.HealthService', rpc_method_handlers)
66
+ server.add_generic_rpc_handlers((generic_handler,))
67
+ server.add_registered_method_handlers('divi.proto.core.health.v1.HealthService', rpc_method_handlers)
68
+
69
+
70
+ # This class is part of an EXPERIMENTAL API.
71
+ class HealthService(object):
72
+ """HealthService is a service that implements health check.
73
+ """
74
+
75
+ @staticmethod
76
+ def Check(request,
77
+ target,
78
+ options=(),
79
+ channel_credentials=None,
80
+ call_credentials=None,
81
+ insecure=False,
82
+ compression=None,
83
+ wait_for_ready=None,
84
+ timeout=None,
85
+ metadata=None):
86
+ return grpc.experimental.unary_unary(
87
+ request,
88
+ target,
89
+ '/divi.proto.core.health.v1.HealthService/Check',
90
+ divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2.HealthCheckRequest.SerializeToString,
91
+ divi_dot_proto_dot_core_dot_health_dot_v1_dot_health__service__pb2.HealthCheckResponse.FromString,
92
+ options,
93
+ channel_credentials,
94
+ insecure,
95
+ call_credentials,
96
+ compression,
97
+ wait_for_ready,
98
+ timeout,
99
+ metadata,
100
+ _registered_method=True)
@@ -0,0 +1,29 @@
1
+ syntax = "proto3";
2
+
3
+ package divi.proto.metric.v1;
4
+
5
+ import "divi/proto/common/v1/common.proto";
6
+
7
+ option go_package = "services/proto";
8
+
9
+ message ScopeMetrics {
10
+ // The scope of the message
11
+ divi.proto.common.v1.RunScope scope = 1;
12
+
13
+ // A list of spans that originate from a resource.
14
+ repeated Metric metrics = 2;
15
+ }
16
+
17
+ message Metric {
18
+ // The name of the metric.
19
+ string name = 1;
20
+
21
+ // The description of the metric.
22
+ string description = 2;
23
+
24
+ // The data of the metric.
25
+ divi.proto.common.v1.AnyValue data = 3;
26
+
27
+ // The metadata is a set of attributes that describe the span.
28
+ repeated divi.proto.common.v1.KeyValue metadata = 4;
29
+ }
@@ -0,0 +1,40 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: divi/proto/metric/v1/metric.proto
5
+ # Protobuf Python Version: 5.29.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 29,
16
+ 0,
17
+ '',
18
+ 'divi/proto/metric/v1/metric.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from divi.proto.common.v1 import common_pb2 as divi_dot_proto_dot_common_dot_v1_dot_common__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!divi/proto/metric/v1/metric.proto\x12\x14\x64ivi.proto.metric.v1\x1a!divi/proto/common/v1/common.proto\"l\n\x0cScopeMetrics\x12-\n\x05scope\x18\x01 \x01(\x0b\x32\x1e.divi.proto.common.v1.RunScope\x12-\n\x07metrics\x18\x02 \x03(\x0b\x32\x1c.divi.proto.metric.v1.Metric\"\x8b\x01\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12,\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1e.divi.proto.common.v1.AnyValue\x12\x30\n\x08metadata\x18\x04 \x03(\x0b\x32\x1e.divi.proto.common.v1.KeyValueB\x10Z\x0eservices/protob\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'divi.proto.metric.v1.metric_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'Z\016services/proto'
36
+ _globals['_SCOPEMETRICS']._serialized_start=94
37
+ _globals['_SCOPEMETRICS']._serialized_end=202
38
+ _globals['_METRIC']._serialized_start=205
39
+ _globals['_METRIC']._serialized_end=344
40
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,27 @@
1
+ from divi.proto.common.v1 import common_pb2 as _common_pb2
2
+ from google.protobuf.internal import containers as _containers
3
+ from google.protobuf import descriptor as _descriptor
4
+ from google.protobuf import message as _message
5
+ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
6
+
7
+ DESCRIPTOR: _descriptor.FileDescriptor
8
+
9
+ class ScopeMetrics(_message.Message):
10
+ __slots__ = ("scope", "metrics")
11
+ SCOPE_FIELD_NUMBER: _ClassVar[int]
12
+ METRICS_FIELD_NUMBER: _ClassVar[int]
13
+ scope: _common_pb2.RunScope
14
+ metrics: _containers.RepeatedCompositeFieldContainer[Metric]
15
+ def __init__(self, scope: _Optional[_Union[_common_pb2.RunScope, _Mapping]] = ..., metrics: _Optional[_Iterable[_Union[Metric, _Mapping]]] = ...) -> None: ...
16
+
17
+ class Metric(_message.Message):
18
+ __slots__ = ("name", "description", "data", "metadata")
19
+ NAME_FIELD_NUMBER: _ClassVar[int]
20
+ DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
21
+ DATA_FIELD_NUMBER: _ClassVar[int]
22
+ METADATA_FIELD_NUMBER: _ClassVar[int]
23
+ name: str
24
+ description: str
25
+ data: _common_pb2.AnyValue
26
+ metadata: _containers.RepeatedCompositeFieldContainer[_common_pb2.KeyValue]
27
+ def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., data: _Optional[_Union[_common_pb2.AnyValue, _Mapping]] = ..., metadata: _Optional[_Iterable[_Union[_common_pb2.KeyValue, _Mapping]]] = ...) -> None: ...
@@ -0,0 +1,38 @@
1
+ syntax = "proto3";
2
+
3
+ package divi.proto.run.v1;
4
+
5
+ import "divi/proto/common/v1/common.proto";
6
+
7
+ option go_package = "services/proto";
8
+
9
+ message Run {
10
+ // The run_id is the unique identifier of the run. It is a 16-byte array.
11
+ bytes run_id = 1;
12
+
13
+ // The name of the run.
14
+ string name = 2;
15
+
16
+ enum RunKind {
17
+ // Observation represents a run that is used for observation.
18
+ Observation = 0;
19
+
20
+ // Evaluation represents a run that is used for evaluation.
21
+ Evaluation = 1;
22
+
23
+ // Dataset represents a run that is used for creating a dataset.
24
+ Dataset = 2;
25
+ }
26
+
27
+ // The kind of the run.
28
+ RunKind kind = 3;
29
+
30
+ // The start_time_unix_nano is the start time of the run in Unix nanoseconds.
31
+ fixed64 start_time_unix_nano = 4;
32
+
33
+ // The end_time_unix_nano is the end time of the run in Unix nanoseconds.
34
+ fixed64 end_time_unix_nano = 5;
35
+
36
+ // The metadata is a set of attributes that describe the run.
37
+ repeated divi.proto.common.v1.KeyValue metadata = 6;
38
+ }