divi 0.0.1b0__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.
- divi-0.0.1b0/.dockerignore +1 -0
- divi-0.0.1b0/.github/dependabot.yml +11 -0
- divi-0.0.1b0/.gitignore +52 -0
- divi-0.0.1b0/LICENSE +21 -0
- divi-0.0.1b0/PKG-INFO +18 -0
- divi-0.0.1b0/README.md +14 -0
- divi-0.0.1b0/apps/README.md +15 -0
- divi-0.0.1b0/apps/docs/README.md +32 -0
- divi-0.0.1b0/apps/docs/docs.json +78 -0
- divi-0.0.1b0/apps/docs/en/concepts/score.mdx +4 -0
- divi-0.0.1b0/apps/docs/en/concepts/session.mdx +4 -0
- divi-0.0.1b0/apps/docs/en/development/roadmap.mdx +4 -0
- divi-0.0.1b0/apps/docs/en/introduction.mdx +15 -0
- divi-0.0.1b0/apps/docs/en/quickstart/trace.mdx +4 -0
- divi-0.0.1b0/apps/docs/en/tutorials/self-refine.mdx +4 -0
- divi-0.0.1b0/apps/docs/favicon.ico +0 -0
- divi-0.0.1b0/apps/docs/images/researcher-angel.png +0 -0
- divi-0.0.1b0/apps/docs/images/scholar-angel.png +0 -0
- divi-0.0.1b0/apps/docs/package.json +11 -0
- divi-0.0.1b0/apps/docs/snippets/snippet-intro.mdx +4 -0
- divi-0.0.1b0/apps/docs/zh/concepts/score.mdx +4 -0
- divi-0.0.1b0/apps/docs/zh/concepts/session.mdx +4 -0
- divi-0.0.1b0/apps/docs/zh/development/roadmap.mdx +4 -0
- divi-0.0.1b0/apps/docs/zh/introduction.mdx +15 -0
- divi-0.0.1b0/apps/docs/zh/quickstart/trace.mdx +4 -0
- divi-0.0.1b0/apps/docs/zh/tutorials/self-refine.mdx +4 -0
- divi-0.0.1b0/apps/graphql/Dockerfile +43 -0
- divi-0.0.1b0/apps/graphql/README.md +3 -0
- divi-0.0.1b0/apps/graphql/codegen.ts +19 -0
- divi-0.0.1b0/apps/graphql/package.json +28 -0
- divi-0.0.1b0/apps/graphql/src/datasources/auth-api.ts +76 -0
- divi-0.0.1b0/apps/graphql/src/datasources/datapark-api.ts +62 -0
- divi-0.0.1b0/apps/graphql/src/index.ts +34 -0
- divi-0.0.1b0/apps/graphql/src/resolvers.ts +125 -0
- divi-0.0.1b0/apps/graphql/src/schema.graphql +205 -0
- divi-0.0.1b0/apps/graphql/src/types/context.d.ts +9 -0
- divi-0.0.1b0/apps/graphql/src/types/response.d.ts +16 -0
- divi-0.0.1b0/apps/graphql/src/types/types.d.ts +658 -0
- divi-0.0.1b0/apps/graphql/tsconfig.json +13 -0
- divi-0.0.1b0/apps/web/.gitignore +36 -0
- divi-0.0.1b0/apps/web/README.md +36 -0
- divi-0.0.1b0/apps/web/app/dashboard/@modal/(.)traces/[id]/page.tsx +21 -0
- divi-0.0.1b0/apps/web/app/dashboard/@modal/default.tsx +3 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/actions.ts +131 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/components/columns.tsx +72 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/components/create-dialog.tsx +134 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/components/data-table-cell-viewer.tsx +108 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/components/data-table-toolbar.tsx +50 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/components/data-table.tsx +132 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/components/delete-dialog.tsx +70 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/data/data.tsx +10 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/data/schema.ts +11 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/layout.tsx +29 -0
- divi-0.0.1b0/apps/web/app/dashboard/api-keys/page.tsx +15 -0
- divi-0.0.1b0/apps/web/app/dashboard/components/app-sidebar.tsx +101 -0
- divi-0.0.1b0/apps/web/app/dashboard/components/nav-main.tsx +38 -0
- divi-0.0.1b0/apps/web/app/dashboard/components/nav-secondary.tsx +40 -0
- divi-0.0.1b0/apps/web/app/dashboard/components/nav-user.tsx +103 -0
- divi-0.0.1b0/apps/web/app/dashboard/components/site-header.tsx +24 -0
- divi-0.0.1b0/apps/web/app/dashboard/layout.tsx +56 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/account/components/account-form.tsx +86 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/account/page.tsx +63 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/appearance/components/appearance-form.tsx +47 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/appearance/page.tsx +18 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/components/profile-form.tsx +96 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/components/sidebar-nav.tsx +44 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/layout.tsx +48 -0
- divi-0.0.1b0/apps/web/app/dashboard/settings/page.tsx +23 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(children)/[id]/components/Span.tsx +264 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(children)/[id]/components/responsive-resizable.tsx +44 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(children)/[id]/components/trace-board.tsx +38 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(children)/[id]/components/trace-chart.tsx +120 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(children)/[id]/page.tsx +13 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/components/columns.tsx +100 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/components/data-table-row-action.tsx +31 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/components/data-table-toolbar.tsx +51 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/components/data-table.tsx +132 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/data/data.tsx +19 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/data/schema.ts +12 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/layout.tsx +26 -0
- divi-0.0.1b0/apps/web/app/dashboard/traces/(overview)/page.tsx +36 -0
- divi-0.0.1b0/apps/web/app/dashboard/usages/actions.ts +75 -0
- divi-0.0.1b0/apps/web/app/dashboard/usages/components/usage-board.tsx +74 -0
- divi-0.0.1b0/apps/web/app/dashboard/usages/components/usage-chart.tsx +205 -0
- divi-0.0.1b0/apps/web/app/dashboard/usages/layout.tsx +26 -0
- divi-0.0.1b0/apps/web/app/dashboard/usages/page.tsx +29 -0
- divi-0.0.1b0/apps/web/app/favicon.ico +0 -0
- divi-0.0.1b0/apps/web/app/home/components/home-header.tsx +52 -0
- divi-0.0.1b0/apps/web/app/home/components/home-hero.tsx +41 -0
- divi-0.0.1b0/apps/web/app/home/page.tsx +11 -0
- divi-0.0.1b0/apps/web/app/layout.tsx +43 -0
- divi-0.0.1b0/apps/web/app/login/components/login-form.tsx +71 -0
- divi-0.0.1b0/apps/web/app/login/page.tsx +44 -0
- divi-0.0.1b0/apps/web/app/page.tsx +5 -0
- divi-0.0.1b0/apps/web/app/signup/components/signup-form.tsx +52 -0
- divi-0.0.1b0/apps/web/app/signup/page.tsx +63 -0
- divi-0.0.1b0/apps/web/components/ApolloWrapper.tsx +40 -0
- divi-0.0.1b0/apps/web/components/Highter.tsx +19 -0
- divi-0.0.1b0/apps/web/components/Modal.tsx +117 -0
- divi-0.0.1b0/apps/web/components/calendar.tsx +84 -0
- divi-0.0.1b0/apps/web/components/data-table-column-header.tsx +102 -0
- divi-0.0.1b0/apps/web/components/data-table-faceted-filter.tsx +153 -0
- divi-0.0.1b0/apps/web/components/data-table-pagination.tsx +92 -0
- divi-0.0.1b0/apps/web/components/data-table-row.tsx +63 -0
- divi-0.0.1b0/apps/web/components/data-table-view-options.tsx +57 -0
- divi-0.0.1b0/apps/web/components/date-picker.tsx +101 -0
- divi-0.0.1b0/apps/web/components/mode-switcher.tsx +43 -0
- divi-0.0.1b0/apps/web/components/theme-provider.tsx +11 -0
- divi-0.0.1b0/apps/web/components.json +20 -0
- divi-0.0.1b0/apps/web/hooks/actionState.ts +29 -0
- divi-0.0.1b0/apps/web/hooks/apolloClient.ts +19 -0
- divi-0.0.1b0/apps/web/lib/callback/toast-callback.ts +25 -0
- divi-0.0.1b0/apps/web/lib/callback/with-callback.ts +29 -0
- divi-0.0.1b0/apps/web/lib/server/README.md +3 -0
- divi-0.0.1b0/apps/web/lib/server/auth.ts +23 -0
- divi-0.0.1b0/apps/web/lib/server/cookies.ts +32 -0
- divi-0.0.1b0/apps/web/lib/server/evaluation.ts +17 -0
- divi-0.0.1b0/apps/web/lib/server/openai.ts +49 -0
- divi-0.0.1b0/apps/web/lib/server/span.ts +148 -0
- divi-0.0.1b0/apps/web/lib/types/span.d.ts +27 -0
- divi-0.0.1b0/apps/web/lib/types/state.d.ts +8 -0
- divi-0.0.1b0/apps/web/lib/types/usage.d.ts +9 -0
- divi-0.0.1b0/apps/web/lib/utils.ts +35 -0
- divi-0.0.1b0/apps/web/middleware.ts +75 -0
- divi-0.0.1b0/apps/web/next-env.d.ts +5 -0
- divi-0.0.1b0/apps/web/next.config.ts +5 -0
- divi-0.0.1b0/apps/web/package.json +54 -0
- divi-0.0.1b0/apps/web/postcss.config.mjs +1 -0
- divi-0.0.1b0/apps/web/public/peeking-angel.png +0 -0
- divi-0.0.1b0/apps/web/public/thinking-angel.png +0 -0
- divi-0.0.1b0/apps/web/tsconfig.json +17 -0
- divi-0.0.1b0/apps/web/vercel.json +12 -0
- divi-0.0.1b0/biome.json +30 -0
- divi-0.0.1b0/compose-dev.yml +34 -0
- divi-0.0.1b0/divi/__init__.py +18 -0
- divi-0.0.1b0/divi/decorators/__init__.py +4 -0
- divi-0.0.1b0/divi/decorators/collect.py +34 -0
- divi-0.0.1b0/divi/decorators/obs_openai.py +48 -0
- divi-0.0.1b0/divi/decorators/observable.py +91 -0
- divi-0.0.1b0/divi/decorators/observe.py +47 -0
- divi-0.0.1b0/divi/evaluation/__init__.py +4 -0
- divi-0.0.1b0/divi/evaluation/evaluate.py +61 -0
- divi-0.0.1b0/divi/evaluation/evaluator.py +174 -0
- divi-0.0.1b0/divi/evaluation/prompts.py +19 -0
- divi-0.0.1b0/divi/evaluation/scores.py +8 -0
- divi-0.0.1b0/divi/proto/common/v1/common.proto +49 -0
- divi-0.0.1b0/divi/proto/common/v1/common_pb2.py +43 -0
- divi-0.0.1b0/divi/proto/common/v1/common_pb2.pyi +44 -0
- divi-0.0.1b0/divi/proto/core/health/v1/health_service.proto +17 -0
- divi-0.0.1b0/divi/proto/core/health/v1/health_service_pb2.py +41 -0
- divi-0.0.1b0/divi/proto/core/health/v1/health_service_pb2.pyi +19 -0
- divi-0.0.1b0/divi/proto/core/health/v1/health_service_pb2_grpc.py +100 -0
- divi-0.0.1b0/divi/proto/metric/v1/metric.proto +26 -0
- divi-0.0.1b0/divi/proto/metric/v1/metric_pb2.py +40 -0
- divi-0.0.1b0/divi/proto/metric/v1/metric_pb2.pyi +25 -0
- divi-0.0.1b0/divi/proto/trace/v1/trace.proto +50 -0
- divi-0.0.1b0/divi/proto/trace/v1/trace_pb2.py +42 -0
- divi-0.0.1b0/divi/proto/trace/v1/trace_pb2.pyi +42 -0
- divi-0.0.1b0/divi/services/__init__.py +7 -0
- divi-0.0.1b0/divi/services/auth/__init__.py +4 -0
- divi-0.0.1b0/divi/services/auth/auth.py +13 -0
- divi-0.0.1b0/divi/services/auth/init.py +22 -0
- divi-0.0.1b0/divi/services/auth/tokman.py +42 -0
- divi-0.0.1b0/divi/services/core/__init__.py +5 -0
- divi-0.0.1b0/divi/services/core/core.py +35 -0
- divi-0.0.1b0/divi/services/core/finish.py +15 -0
- divi-0.0.1b0/divi/services/core/init.py +70 -0
- divi-0.0.1b0/divi/services/datapark/__init__.py +4 -0
- divi-0.0.1b0/divi/services/datapark/datapark.py +91 -0
- divi-0.0.1b0/divi/services/datapark/init.py +21 -0
- divi-0.0.1b0/divi/services/finish.py +9 -0
- divi-0.0.1b0/divi/services/init.py +10 -0
- divi-0.0.1b0/divi/services/service.py +54 -0
- divi-0.0.1b0/divi/session/__init__.py +3 -0
- divi-0.0.1b0/divi/session/session.py +40 -0
- divi-0.0.1b0/divi/session/setup.py +48 -0
- divi-0.0.1b0/divi/session/teardown.py +7 -0
- divi-0.0.1b0/divi/signals/__init__.py +3 -0
- divi-0.0.1b0/divi/signals/span.py +83 -0
- divi-0.0.1b0/divi/signals/trace.py +79 -0
- divi-0.0.1b0/divi/utils.py +49 -0
- divi-0.0.1b0/docker-compose.yml +152 -0
- divi-0.0.1b0/docs/README.md +3 -0
- divi-0.0.1b0/docs/developer_tools.md +6 -0
- divi-0.0.1b0/docs/images/architecture.svg +2 -0
- divi-0.0.1b0/docs/images/favicon.ico +0 -0
- divi-0.0.1b0/docs/images/og-image.png +0 -0
- divi-0.0.1b0/docs/images/storage.svg +2 -0
- divi-0.0.1b0/docs/package_readme.md +5 -0
- divi-0.0.1b0/go.work +3 -0
- divi-0.0.1b0/go.work.sum +107 -0
- divi-0.0.1b0/hatch.toml +10 -0
- divi-0.0.1b0/package.json +24 -0
- divi-0.0.1b0/packages/README.md +15 -0
- divi-0.0.1b0/pnpm-lock.yaml +9913 -0
- divi-0.0.1b0/pnpm-workspace.yaml +21 -0
- divi-0.0.1b0/pyproject.toml +31 -0
- divi-0.0.1b0/scripts/README.md +3 -0
- divi-0.0.1b0/scripts/hatch_build.py +81 -0
- divi-0.0.1b0/scripts/image_build.py +112 -0
- divi-0.0.1b0/scripts/key_build.py +46 -0
- divi-0.0.1b0/scripts/proto_build.py +51 -0
- divi-0.0.1b0/services/README.md +17 -0
- divi-0.0.1b0/services/go.mod +75 -0
- divi-0.0.1b0/services/go.sum +253 -0
- divi-0.0.1b0/services/internal/app/auth/handler/api.go +8 -0
- divi-0.0.1b0/services/internal/app/auth/handler/api_key.go +128 -0
- divi-0.0.1b0/services/internal/app/auth/handler/auth.go +155 -0
- divi-0.0.1b0/services/internal/app/auth/handler/user.go +180 -0
- divi-0.0.1b0/services/internal/app/auth/router/router.go +39 -0
- divi-0.0.1b0/services/internal/app/core/.keep +0 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/api.go +15 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/evaluation.go +147 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/metric.go +9 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/openai.go +185 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/session.go +43 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/trace.go +311 -0
- divi-0.0.1b0/services/internal/app/datapark/handler/usage.go +127 -0
- divi-0.0.1b0/services/internal/app/datapark/router/router.go +54 -0
- divi-0.0.1b0/services/internal/pkg/auth/auth.go +37 -0
- divi-0.0.1b0/services/internal/pkg/auth/middleware.go +29 -0
- divi-0.0.1b0/services/internal/pkg/config/config.go +22 -0
- divi-0.0.1b0/services/internal/pkg/database/connect.go +73 -0
- divi-0.0.1b0/services/internal/pkg/database/database.go +16 -0
- divi-0.0.1b0/services/internal/pkg/model/api_key.go +27 -0
- divi-0.0.1b0/services/internal/pkg/model/openai.go +29 -0
- divi-0.0.1b0/services/internal/pkg/model/score.go +16 -0
- divi-0.0.1b0/services/internal/pkg/model/session.go +22 -0
- divi-0.0.1b0/services/internal/pkg/model/trace.go +48 -0
- divi-0.0.1b0/services/internal/pkg/model/usage.go +46 -0
- divi-0.0.1b0/services/internal/pkg/model/user.go +25 -0
- divi-0.0.1b0/services/pb/common.pb.go +455 -0
- divi-0.0.1b0/services/pb/health_service.pb.go +196 -0
- divi-0.0.1b0/services/pb/health_service_grpc.pb.go +125 -0
- divi-0.0.1b0/services/pb/metric.pb.go +222 -0
- divi-0.0.1b0/services/pb/trace.pb.go +327 -0
- divi-0.0.1b0/tests/__init__.py +1 -0
- divi-0.0.1b0/tests/unit_tests/decorators/test_obs_openai.py +153 -0
- divi-0.0.1b0/tests/unit_tests/decorators/test_observable.py +37 -0
- divi-0.0.1b0/turbo.json +39 -0
- divi-0.0.1b0/uv.lock +654 -0
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: uv # See documentation for possible values
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
divi-0.0.1b0/.gitignore
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
.vscode/
|
2
|
+
.idea/
|
3
|
+
|
4
|
+
# Byte-compiled / optimized / DLL files
|
5
|
+
__pycache__/
|
6
|
+
*.py[cod]
|
7
|
+
*$py.class
|
8
|
+
|
9
|
+
# Distribution / packaging
|
10
|
+
.next/
|
11
|
+
dist/
|
12
|
+
out/
|
13
|
+
tmp/
|
14
|
+
build/
|
15
|
+
bin/
|
16
|
+
|
17
|
+
# Environments
|
18
|
+
.venv/
|
19
|
+
.env
|
20
|
+
|
21
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
22
|
+
|
23
|
+
# Dependencies
|
24
|
+
node_modules
|
25
|
+
.pnp
|
26
|
+
.pnp.js
|
27
|
+
|
28
|
+
# Local env files
|
29
|
+
.env
|
30
|
+
.env.local
|
31
|
+
.env.development.local
|
32
|
+
.env.test.local
|
33
|
+
.env.production.local
|
34
|
+
|
35
|
+
# Testing
|
36
|
+
coverage
|
37
|
+
|
38
|
+
# Turbo
|
39
|
+
.turbo
|
40
|
+
|
41
|
+
# Vercel
|
42
|
+
.vercel
|
43
|
+
|
44
|
+
# Debug
|
45
|
+
npm-debug.log*
|
46
|
+
yarn-debug.log*
|
47
|
+
yarn-error.log*
|
48
|
+
.pytest_cache/
|
49
|
+
|
50
|
+
# Misc
|
51
|
+
.DS_Store
|
52
|
+
*.pem
|
divi-0.0.1b0/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Kaikai
|
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.
|
divi-0.0.1b0/PKG-INFO
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: divi
|
3
|
+
Version: 0.0.1b0
|
4
|
+
Summary: The Agent Platform for Observability & Evaluation
|
5
|
+
License-File: LICENSE
|
6
|
+
Requires-Python: >=3.11
|
7
|
+
Requires-Dist: grpcio>=1.71.0
|
8
|
+
Requires-Dist: openai>=1.65.2
|
9
|
+
Requires-Dist: protobuf<6.0.dev0,>=5.26.1
|
10
|
+
Requires-Dist: pyjwt>=2.10.1
|
11
|
+
Requires-Dist: requests>=2.32.3
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
# Divine Agent
|
15
|
+
|
16
|
+
Agent Platform for Observability • Evaluation • Playground
|
17
|
+
|
18
|
+
> The project is still in the development stage. 😇
|
divi-0.0.1b0/README.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Apps
|
2
|
+
|
3
|
+
> A series of web applications.
|
4
|
+
|
5
|
+
## Table of Contents
|
6
|
+
|
7
|
+
| Name | Description | Port |
|
8
|
+
| --- | --- | --- |
|
9
|
+
| graphql | A GraphQL server | 4000 |
|
10
|
+
| web | A Next.js web server | 4001 |
|
11
|
+
| docs | A documentation server | 4002 |
|
12
|
+
|
13
|
+
## Rules
|
14
|
+
|
15
|
+
1. [Split project files by feature or route](https://nextjs.org/docs/app/getting-started/project-structure#split-project-files-by-feature-or-route)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Mintlify Starter Kit
|
2
|
+
|
3
|
+
Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including
|
4
|
+
|
5
|
+
- Guide pages
|
6
|
+
- Navigation
|
7
|
+
- Customizations
|
8
|
+
- API Reference pages
|
9
|
+
- Use of popular components
|
10
|
+
|
11
|
+
### Development
|
12
|
+
|
13
|
+
Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command
|
14
|
+
|
15
|
+
```
|
16
|
+
npm i -g mintlify
|
17
|
+
```
|
18
|
+
|
19
|
+
Run the following command at the root of your documentation (where docs.json is)
|
20
|
+
|
21
|
+
```
|
22
|
+
mintlify dev
|
23
|
+
```
|
24
|
+
|
25
|
+
### Publishing Changes
|
26
|
+
|
27
|
+
Install our Github App to auto propagate changes from your repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard.
|
28
|
+
|
29
|
+
#### Troubleshooting
|
30
|
+
|
31
|
+
- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
|
32
|
+
- Page loads as a 404 - Make sure you are running in a folder with `docs.json`
|
@@ -0,0 +1,78 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://mintlify.com/docs.json",
|
3
|
+
"theme": "maple",
|
4
|
+
"name": "Divine Agent",
|
5
|
+
"colors": {
|
6
|
+
"primary": "#09090b",
|
7
|
+
"light": "#FAFAFA",
|
8
|
+
"dark": "#09090b"
|
9
|
+
},
|
10
|
+
"favicon": "/favicon.ico",
|
11
|
+
"navigation": {
|
12
|
+
"languages": [
|
13
|
+
{
|
14
|
+
"language": "en",
|
15
|
+
"groups": [
|
16
|
+
{
|
17
|
+
"group": "Get Started",
|
18
|
+
"pages": ["en/introduction"]
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"group": "Tutorials",
|
22
|
+
"pages": ["en/tutorials/self-refine"]
|
23
|
+
}
|
24
|
+
]
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"language": "zh",
|
28
|
+
"groups": [
|
29
|
+
{
|
30
|
+
"group": "快速开始",
|
31
|
+
"pages": ["zh/introduction"]
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"group": "使用案例",
|
35
|
+
"pages": ["zh/tutorials/self-refine"]
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
],
|
40
|
+
"global": {
|
41
|
+
"anchors": [
|
42
|
+
{
|
43
|
+
"anchor": "Dashboard",
|
44
|
+
"href": "https://divine-agent.com",
|
45
|
+
"icon": "gauge-high"
|
46
|
+
}
|
47
|
+
]
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"logo": {
|
51
|
+
"light": "/images/researcher-angel.png",
|
52
|
+
"dark": "/images/scholar-angel.png"
|
53
|
+
},
|
54
|
+
"navbar": {
|
55
|
+
"links": [
|
56
|
+
{
|
57
|
+
"label": "GitHub",
|
58
|
+
"href": "https://github.com/Kaikaikaifang/divine-agent"
|
59
|
+
}
|
60
|
+
],
|
61
|
+
"primary": {
|
62
|
+
"type": "button",
|
63
|
+
"label": "Divine Agent",
|
64
|
+
"href": "https://divine-agent.com"
|
65
|
+
}
|
66
|
+
},
|
67
|
+
"seo": {
|
68
|
+
"metatags": {
|
69
|
+
"og:image": "https://raw.githubusercontent.com/Kaikaikaifang/divine-agent/refs/heads/main/docs/images/og-image.png?token=GHSAT0AAAAAAC7SUUQIZIJIKDD5UWUKWX2CZ66TXVA"
|
70
|
+
},
|
71
|
+
"indexing": "navigable"
|
72
|
+
},
|
73
|
+
"footer": {
|
74
|
+
"socials": {
|
75
|
+
"github": "https://github.com/Kaikaikaifang/divine-agent"
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
title: Introduction
|
3
|
+
description: "Welcome to the docs of Divine Agent"
|
4
|
+
---
|
5
|
+
|
6
|
+
<img
|
7
|
+
className="block dark:hidden w-20"
|
8
|
+
src="/images/researcher-angel.png"
|
9
|
+
alt="Hero Light"
|
10
|
+
/>
|
11
|
+
<img
|
12
|
+
className="hidden dark:block w-20"
|
13
|
+
src="/images/scholar-angel.png"
|
14
|
+
alt="Hero Dark"
|
15
|
+
/>
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,4 @@
|
|
1
|
+
One of the core principles of software development is DRY (Don't Repeat
|
2
|
+
Yourself). This is a principle that apply to documentation as
|
3
|
+
well. If you find yourself repeating the same content in multiple places, you
|
4
|
+
should consider creating a custom snippet to keep your content in sync.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
title: '介绍'
|
3
|
+
description: "欢迎使用 Divine Agent"
|
4
|
+
---
|
5
|
+
|
6
|
+
<img
|
7
|
+
className="block dark:hidden w-20"
|
8
|
+
src="/images/researcher-angel.png"
|
9
|
+
alt="Hero Light"
|
10
|
+
/>
|
11
|
+
<img
|
12
|
+
className="hidden dark:block w-20"
|
13
|
+
src="/images/scholar-angel.png"
|
14
|
+
alt="Hero Dark"
|
15
|
+
/>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
FROM node:23-alpine AS base
|
2
|
+
|
3
|
+
FROM base AS builder
|
4
|
+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
5
|
+
RUN apk update
|
6
|
+
RUN apk add --no-cache libc6-compat
|
7
|
+
# 启用 corepack 并激活 pnpm
|
8
|
+
RUN corepack enable && corepack prepare pnpm@latest --activate
|
9
|
+
# Set working directory
|
10
|
+
WORKDIR /app
|
11
|
+
# 使用 yarn 全局安装 turbo
|
12
|
+
RUN yarn global add turbo
|
13
|
+
COPY . .
|
14
|
+
RUN turbo prune @app/graphql --docker
|
15
|
+
|
16
|
+
# Add lockfile and package.json's of isolated subworkspace
|
17
|
+
FROM base AS installer
|
18
|
+
RUN apk update
|
19
|
+
RUN apk add --no-cache libc6-compat
|
20
|
+
# 启用 corepack 并激活 pnpm
|
21
|
+
RUN corepack enable && corepack prepare pnpm@latest --activate
|
22
|
+
WORKDIR /app
|
23
|
+
|
24
|
+
# First install dependencies (as they change less often)
|
25
|
+
COPY --from=builder /app/out/json/ .
|
26
|
+
COPY --from=builder /app/out/pnpm-lock.yaml .
|
27
|
+
RUN pnpm install
|
28
|
+
|
29
|
+
# Build the project and its dependencies
|
30
|
+
COPY --from=builder /app/out/full/ .
|
31
|
+
RUN pnpm turbo build
|
32
|
+
|
33
|
+
FROM base AS runner
|
34
|
+
WORKDIR /app
|
35
|
+
|
36
|
+
# Don't run production as root
|
37
|
+
RUN addgroup --system --gid 1001 divi
|
38
|
+
RUN adduser --system --uid 1001 divi
|
39
|
+
USER divi
|
40
|
+
COPY --from=installer /app .
|
41
|
+
|
42
|
+
EXPOSE 4000
|
43
|
+
CMD ["node", "apps/graphql/dist/index.js"]
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { CodegenConfig } from '@graphql-codegen/cli';
|
2
|
+
|
3
|
+
const config: CodegenConfig = {
|
4
|
+
schema: './src/schema.graphql',
|
5
|
+
generates: {
|
6
|
+
'./src/types/types.d.ts': {
|
7
|
+
plugins: ['typescript', 'typescript-resolvers'],
|
8
|
+
config: {
|
9
|
+
contextType: './context#DataSourceContext',
|
10
|
+
mappers: {
|
11
|
+
User: './user#UserModel',
|
12
|
+
APIKey: './api-key#APIKeyModel',
|
13
|
+
},
|
14
|
+
},
|
15
|
+
},
|
16
|
+
},
|
17
|
+
};
|
18
|
+
|
19
|
+
export default config;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"name": "@app/graphql",
|
3
|
+
"private": true,
|
4
|
+
"main": "index.ts",
|
5
|
+
"scripts": {
|
6
|
+
"dev": "ts-node-dev --respawn ./src/index.ts",
|
7
|
+
"build": "tsc",
|
8
|
+
"start": "npm run build && nodemon ./dist/index.js",
|
9
|
+
"prebuild": "graphql-codegen",
|
10
|
+
"postbuild": "cp src/schema.graphql dist/"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
"@apollo/datasource-rest": "^6.4.1",
|
14
|
+
"@apollo/server": "^4.12.0",
|
15
|
+
"@apollo/utils.keyvaluecache": "^3.1.0",
|
16
|
+
"graphql": "^16.11.0",
|
17
|
+
"graphql-tag": "^2.12.6"
|
18
|
+
},
|
19
|
+
"devDependencies": {
|
20
|
+
"@graphql-codegen/cli": "^4.0.1",
|
21
|
+
"@graphql-codegen/typescript": "^4.1.6",
|
22
|
+
"@graphql-codegen/typescript-resolvers": "^4.5.0",
|
23
|
+
"@workspace/typescript-config": "workspace:*",
|
24
|
+
"nodemon": "^3.1.10",
|
25
|
+
"ts-node-dev": "^2.0.0",
|
26
|
+
"typescript": "catalog:"
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import type { FetchResponse } from '@/types/response';
|
2
|
+
import type { ApiKey, User } from '@/types/types';
|
3
|
+
import { type AugmentedRequest, RESTDataSource } from '@apollo/datasource-rest';
|
4
|
+
import type { KeyValueCache } from '@apollo/utils.keyvaluecache';
|
5
|
+
|
6
|
+
export class AuthAPI extends RESTDataSource {
|
7
|
+
override baseURL = process.env.AUTH_SERVICE_URL ?? 'http://localhost:3000/';
|
8
|
+
private token: string;
|
9
|
+
|
10
|
+
constructor(options: { token: string; cache: KeyValueCache }) {
|
11
|
+
super(options);
|
12
|
+
this.token = options.token;
|
13
|
+
}
|
14
|
+
|
15
|
+
override willSendRequest(_path: string, request: AugmentedRequest) {
|
16
|
+
request.headers.authorization = this.token;
|
17
|
+
}
|
18
|
+
|
19
|
+
async createUser(email: string, password: string, username: string) {
|
20
|
+
return await this.post<FetchResponse<User>>('/api/user/', {
|
21
|
+
body: { email, password, username },
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
async getCurrentUser() {
|
26
|
+
return await this.get<FetchResponse<User>>('/api/user/');
|
27
|
+
}
|
28
|
+
|
29
|
+
async getUser(userId: string) {
|
30
|
+
return await this.get<FetchResponse<User>>(`/api/user/${userId}`);
|
31
|
+
}
|
32
|
+
|
33
|
+
async updateUser(userId: string, name: string | undefined) {
|
34
|
+
return await this.patch<FetchResponse<User>>(`/api/user/${userId}`, {
|
35
|
+
body: { name },
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
async deleteUser(userId: string, password: string) {
|
40
|
+
return await this.delete<FetchResponse<null>>(`/api/user/${userId}`, {
|
41
|
+
body: { password },
|
42
|
+
});
|
43
|
+
}
|
44
|
+
|
45
|
+
async getAPIKeys() {
|
46
|
+
return await this.get<FetchResponse<ApiKey[]>>('/api/api_key/');
|
47
|
+
}
|
48
|
+
|
49
|
+
async createAPIKey(name: string) {
|
50
|
+
return await this.post<FetchResponse<ApiKey>>('/api/api_key/', {
|
51
|
+
body: { name },
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
async updateAPIKey(apiKeyId: string, name: string | undefined) {
|
56
|
+
return await this.patch<FetchResponse<ApiKey>>(`/api/api_key/${apiKeyId}`, {
|
57
|
+
body: { name },
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
async revokeAPIKey(apiKeyId: string) {
|
62
|
+
return await this.delete<FetchResponse<null>>(`/api/api_key/${apiKeyId}`);
|
63
|
+
}
|
64
|
+
|
65
|
+
async login(identity: string, password: string) {
|
66
|
+
return await this.post<FetchResponse<string>>('/api/auth/login', {
|
67
|
+
body: { identity, password },
|
68
|
+
});
|
69
|
+
}
|
70
|
+
|
71
|
+
async loginWithAPIKey(apiKey: string) {
|
72
|
+
return await this.post<FetchResponse<string>>('/api/auth/api_key', {
|
73
|
+
body: { api_key: apiKey },
|
74
|
+
});
|
75
|
+
}
|
76
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import type { FetchResponse } from '@/types/response';
|
2
|
+
import type { ChatInput, Score, Span, Trace, UsageResult } from '@/types/types';
|
3
|
+
import { type AugmentedRequest, RESTDataSource } from '@apollo/datasource-rest';
|
4
|
+
import type { KeyValueCache } from '@apollo/utils.keyvaluecache';
|
5
|
+
|
6
|
+
export class DataParkAPI extends RESTDataSource {
|
7
|
+
override baseURL =
|
8
|
+
process.env.DATAPARK_SERVICE_URL ?? 'http://localhost:3001/';
|
9
|
+
private token: string;
|
10
|
+
|
11
|
+
constructor(options: { token: string; cache: KeyValueCache }) {
|
12
|
+
super(options);
|
13
|
+
this.token = options.token;
|
14
|
+
}
|
15
|
+
|
16
|
+
override willSendRequest(_path: string, request: AugmentedRequest) {
|
17
|
+
request.headers.authorization = this.token;
|
18
|
+
}
|
19
|
+
|
20
|
+
async getTraces(sessionId: string) {
|
21
|
+
return await this.get<FetchResponse<Trace[]>>(
|
22
|
+
`/api/session/${sessionId}/traces`
|
23
|
+
);
|
24
|
+
}
|
25
|
+
|
26
|
+
async getAllTraces() {
|
27
|
+
return await this.get<FetchResponse<Trace[]>>('/api/trace/');
|
28
|
+
}
|
29
|
+
|
30
|
+
async getSpans(traceId: string) {
|
31
|
+
return await this.get<FetchResponse<Span[]>>(`/api/trace/${traceId}/spans`);
|
32
|
+
}
|
33
|
+
|
34
|
+
async getScores(traceId: string) {
|
35
|
+
return await this.get<FetchResponse<Score[]>>(
|
36
|
+
`/api/trace/${traceId}/scores`
|
37
|
+
);
|
38
|
+
}
|
39
|
+
|
40
|
+
async getChatInput(spanId: string) {
|
41
|
+
return await this.get<FetchResponse<ChatInput>>(
|
42
|
+
`/api/v1/chat/completions/${spanId}/input`
|
43
|
+
);
|
44
|
+
}
|
45
|
+
|
46
|
+
async getCompletionUsage(
|
47
|
+
startTime: number,
|
48
|
+
endTime: number | undefined,
|
49
|
+
groupBy: string | undefined
|
50
|
+
) {
|
51
|
+
return await this.get<FetchResponse<UsageResult[]>>(
|
52
|
+
'/api/usage/completions',
|
53
|
+
{
|
54
|
+
params: {
|
55
|
+
start_time: startTime.toString(),
|
56
|
+
end_time: endTime?.toString(),
|
57
|
+
group_by: groupBy,
|
58
|
+
},
|
59
|
+
}
|
60
|
+
);
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
2
|
+
import { join } from 'node:path';
|
3
|
+
import { ApolloServer } from '@apollo/server';
|
4
|
+
import { startStandaloneServer } from '@apollo/server/standalone';
|
5
|
+
import gql from 'graphql-tag';
|
6
|
+
import { AuthAPI } from './datasources/auth-api';
|
7
|
+
import { DataParkAPI } from './datasources/datapark-api';
|
8
|
+
import { resolvers } from './resolvers';
|
9
|
+
|
10
|
+
const typeDefs = gql(
|
11
|
+
readFileSync(join(__dirname, './schema.graphql'), { encoding: 'utf-8' })
|
12
|
+
);
|
13
|
+
|
14
|
+
async function startApolloServer() {
|
15
|
+
const server = new ApolloServer({ typeDefs, resolvers });
|
16
|
+
const { url } = await startStandaloneServer(server, {
|
17
|
+
context: ({ req }) => {
|
18
|
+
const token = req.headers.authorization || '';
|
19
|
+
const { cache } = server;
|
20
|
+
return Promise.resolve({
|
21
|
+
dataSources: {
|
22
|
+
authAPI: new AuthAPI({ token, cache }),
|
23
|
+
dataparkAPI: new DataParkAPI({ token, cache }),
|
24
|
+
},
|
25
|
+
});
|
26
|
+
},
|
27
|
+
});
|
28
|
+
console.info(`
|
29
|
+
🚀 Server is running!
|
30
|
+
📭 Query at ${url}
|
31
|
+
`);
|
32
|
+
}
|
33
|
+
|
34
|
+
startApolloServer();
|