divi 0.0.1b1__tar.gz → 0.0.1b2__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.1b2/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- divi-0.0.1b2/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- divi-0.0.1b2/.github/pull_request_template.md +12 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/PKG-INFO +1 -1
- {divi-0.0.1b1 → divi-0.0.1b2}/README.md +6 -3
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/docs.json +10 -2
- divi-0.0.1b2/apps/docs/en/quickstart/evaluation.mdx +34 -0
- divi-0.0.1b2/apps/docs/en/quickstart/trace.mdx +36 -0
- divi-0.0.1b2/apps/docs/images/pirate-eval-example-dark.png +0 -0
- divi-0.0.1b2/apps/docs/images/pirate-eval-example.png +0 -0
- divi-0.0.1b2/apps/docs/images/pirate-example-dark.png +0 -0
- divi-0.0.1b2/apps/docs/snippets/evaluation/pirate-custom-eval.mdx +40 -0
- divi-0.0.1b2/apps/docs/snippets/evaluation/pirate-eval.mdx +36 -0
- divi-0.0.1b2/apps/docs/snippets/pirate-example.mdx +34 -0
- divi-0.0.1b2/apps/docs/zh/quickstart/evaluation.mdx +34 -0
- divi-0.0.1b2/apps/docs/zh/quickstart/trace.mdx +36 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/__init__.py +1 -1
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/signals/span.py +5 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/signals/trace.py +5 -0
- divi-0.0.1b2/docs/CODE_OF_CONDUCT.md +128 -0
- divi-0.0.1b2/docs/CONTRIBUTING.md +3 -0
- divi-0.0.1b2/docs/README_ZH.md +77 -0
- divi-0.0.1b2/docs/SECURITY.md +16 -0
- divi-0.0.1b1/apps/docs/en/quickstart/evaluation.mdx +0 -5
- divi-0.0.1b1/apps/docs/en/quickstart/trace.mdx +0 -56
- divi-0.0.1b1/apps/docs/zh/quickstart/trace.mdx +0 -56
- divi-0.0.1b1/docs/README.md +0 -3
- {divi-0.0.1b1 → divi-0.0.1b2}/.dockerignore +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/.github/dependabot.yml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/.gitignore +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/LICENSE +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/en/concepts/score.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/en/concepts/session.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/en/development/roadmap.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/en/introduction.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/en/tutorials/self-refine.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/favicon.ico +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/images/pirate-example.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/images/researcher-angel.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/images/scholar-angel.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/package.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/snippets/snippet-intro.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/zh/concepts/score.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/zh/concepts/session.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/zh/development/roadmap.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/zh/introduction.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/docs/zh/tutorials/self-refine.mdx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/Dockerfile +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/codegen.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/package.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/datasources/auth-api.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/datasources/datapark-api.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/index.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/resolvers.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/schema.graphql +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/types/context.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/types/response.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/src/types/types.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/graphql/tsconfig.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/.gitignore +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/@modal/(.)traces/[id]/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/@modal/default.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/actions.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/columns.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/create-dialog.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/data-table-cell-viewer.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/data-table-toolbar.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/data-table.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/delete-dialog.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/data/data.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/data/schema.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/layout.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/components/app-sidebar.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/components/nav-main.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/components/nav-secondary.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/components/nav-user.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/components/site-header.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/layout.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/account/components/account-form.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/account/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/appearance/components/appearance-form.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/appearance/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/components/profile-form.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/components/sidebar-nav.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/layout.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/settings/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/Span.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/responsive-resizable.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/trace-board.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/trace-chart.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/columns.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/data-table-row-action.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/data-table-toolbar.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/data-table.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/data/data.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/data/schema.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/layout.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/usages/actions.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/usages/components/usage-board.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/usages/components/usage-chart.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/usages/layout.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/dashboard/usages/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/favicon.ico +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/home/components/home-header.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/home/components/home-hero.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/home/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/layout.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/login/components/login-form.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/login/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/signup/components/signup-form.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/app/signup/page.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/ApolloWrapper.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/Highter.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/Modal.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/calendar.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/data-table-column-header.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/data-table-faceted-filter.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/data-table-pagination.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/data-table-row.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/data-table-view-options.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/date-picker.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/mode-switcher.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components/theme-provider.tsx +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/components.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/hooks/actionState.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/hooks/apolloClient.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/callback/toast-callback.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/callback/with-callback.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/server/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/server/auth.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/server/cookies.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/server/evaluation.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/server/openai.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/server/span.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/types/span.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/types/state.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/types/usage.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/lib/utils.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/middleware.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/next-env.d.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/next.config.ts +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/package.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/postcss.config.mjs +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/public/peeking-angel.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/public/thinking-angel.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/tsconfig.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/apps/web/vercel.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/biome.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/compose-dev.yml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/decorators/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/decorators/collect.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/decorators/obs_openai.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/decorators/observable.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/decorators/observe.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/evaluation/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/evaluation/evaluate.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/evaluation/evaluator.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/evaluation/prompts.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/evaluation/scores.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/common/v1/common.proto +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/common/v1/common_pb2.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/common/v1/common_pb2.pyi +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service.proto +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service_pb2.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service_pb2.pyi +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service_pb2_grpc.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/metric/v1/metric.proto +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/metric/v1/metric_pb2.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/metric/v1/metric_pb2.pyi +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/trace/v1/trace.proto +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/trace/v1/trace_pb2.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/proto/trace/v1/trace_pb2.pyi +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/auth/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/auth/auth.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/auth/init.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/auth/tokman.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/core/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/core/core.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/core/finish.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/core/init.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/datapark/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/datapark/datapark.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/datapark/init.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/finish.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/init.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/services/service.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/session/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/session/session.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/session/setup.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/session/teardown.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/signals/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/divi/utils.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docker-compose.yml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/developer_tools.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/images/architecture.svg +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/images/favicon.ico +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/images/og-image.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/images/storage.svg +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/images/thinking-angel.png +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/docs/package_readme.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/go.work +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/go.work.sum +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/hatch.toml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/package.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/packages/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/pnpm-lock.yaml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/pnpm-workspace.yaml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/pyproject.toml +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/scripts/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/scripts/hatch_build.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/scripts/image_build.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/scripts/key_build.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/scripts/proto_build.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/README.md +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/go.mod +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/go.sum +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/auth/handler/api.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/auth/handler/api_key.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/auth/handler/auth.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/auth/handler/user.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/auth/router/router.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/core/.keep +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/api.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/evaluation.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/metric.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/openai.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/session.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/trace.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/handler/usage.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/app/datapark/router/router.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/auth/auth.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/auth/middleware.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/config/config.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/database/connect.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/database/database.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/api_key.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/openai.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/score.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/session.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/trace.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/usage.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/internal/pkg/model/user.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/pb/common.pb.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/pb/health_service.pb.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/pb/health_service_grpc.pb.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/pb/metric.pb.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/services/pb/trace.pb.go +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/tests/__init__.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/tests/unit_tests/decorators/test_obs_openai.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/tests/unit_tests/decorators/test_observable.py +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/turbo.json +0 -0
- {divi-0.0.1b1 → divi-0.0.1b2}/uv.lock +0 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
25
|
+
|
26
|
+
**Desktop (please complete the following information):**
|
27
|
+
- OS: [e.g. iOS]
|
28
|
+
- Browser [e.g. chrome, safari]
|
29
|
+
- Version [e.g. 22]
|
30
|
+
|
31
|
+
**Smartphone (please complete the following information):**
|
32
|
+
- Device: [e.g. iPhone6]
|
33
|
+
- OS: [e.g. iOS8.1]
|
34
|
+
- Browser [e.g. stock browser, safari]
|
35
|
+
- Version [e.g. 22]
|
36
|
+
|
37
|
+
**Additional context**
|
38
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!-- Thanks for contributing to divine-agent! 🥳
|
2
|
+
Given this is a project maintained by volunteers, please read this template to not waste your time, or ours! 😇 -->
|
3
|
+
|
4
|
+
# Summary
|
5
|
+
|
6
|
+
<!-- Write a small summary about what is happening here. -->
|
7
|
+
|
8
|
+
# Checklist
|
9
|
+
|
10
|
+
- [ ] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
|
11
|
+
- [ ] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
|
12
|
+
- [ ] I've updated the documentation accordingly.
|
@@ -10,6 +10,10 @@
|
|
10
10
|
</a>
|
11
11
|
</p>
|
12
12
|
|
13
|
+
<p align="center">
|
14
|
+
<a href="./docs/README_ZH.md">中文</a> / English
|
15
|
+
</p>
|
16
|
+
|
13
17
|
divine-agent is an observability tool for LLM-based agents, offering tracing, evaluation, and usage statistics.
|
14
18
|
|
15
19
|
---
|
@@ -27,7 +31,7 @@ Requires Python 3.11+
|
|
27
31
|
pip install divi
|
28
32
|
```
|
29
33
|
|
30
|
-
##
|
34
|
+
## Trace
|
31
35
|
|
32
36
|
1. Get API Key from [Web](https://www.divine-agent.com/dashboard/api-keys).
|
33
37
|
2. Create a `.env` file and add the following line:
|
@@ -36,7 +40,7 @@ pip install divi
|
|
36
40
|
```
|
37
41
|
3. Run the following code:
|
38
42
|
```python
|
39
|
-
from divi import
|
43
|
+
from divi import obs_openai, observable
|
40
44
|
from dotenv import load_dotenv
|
41
45
|
from openai import OpenAI
|
42
46
|
|
@@ -48,7 +52,6 @@ pip install divi
|
|
48
52
|
self.client = obs_openai(
|
49
53
|
OpenAI(),
|
50
54
|
name="Pirate",
|
51
|
-
scores=[Score.instruction_adherence],
|
52
55
|
)
|
53
56
|
|
54
57
|
@observable(name="Talk with pirate")
|
@@ -15,7 +15,11 @@
|
|
15
15
|
"groups": [
|
16
16
|
{
|
17
17
|
"group": "Get Started",
|
18
|
-
"pages": [
|
18
|
+
"pages": [
|
19
|
+
"en/introduction",
|
20
|
+
"en/quickstart/trace",
|
21
|
+
"en/quickstart/evaluation"
|
22
|
+
]
|
19
23
|
}
|
20
24
|
]
|
21
25
|
},
|
@@ -24,7 +28,11 @@
|
|
24
28
|
"groups": [
|
25
29
|
{
|
26
30
|
"group": "快速开始",
|
27
|
-
"pages": [
|
31
|
+
"pages": [
|
32
|
+
"zh/introduction",
|
33
|
+
"zh/quickstart/trace",
|
34
|
+
"zh/quickstart/evaluation"
|
35
|
+
]
|
28
36
|
}
|
29
37
|
]
|
30
38
|
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
title: 'Evaluation'
|
3
|
+
description: 'Evaluate your agents in one line'
|
4
|
+
---
|
5
|
+
import PirateEval from '/snippets/evaluation/pirate-eval.mdx';
|
6
|
+
import PirateCustomEval from '/snippets/evaluation/pirate-custom-eval.mdx';
|
7
|
+
|
8
|
+
<img className="block dark:hidden" src="/images/pirate-eval-example.png" />
|
9
|
+
<img className="hidden dark:block" src="/images/pirate-eval-example-dark.png" />
|
10
|
+
|
11
|
+
## Behavior Evaluation
|
12
|
+
|
13
|
+
> Automate evaluation of instruction adherence and task completion for your [traced](./trace) Pirate agent.
|
14
|
+
|
15
|
+
<PirateEval />
|
16
|
+
|
17
|
+
## Custom Configuration
|
18
|
+
|
19
|
+
| Property | Type | Default | Description |
|
20
|
+
|-----------------|--------|---------------------|---------------------|
|
21
|
+
| `model` | str | gpt-4o | Model name used for evaluation |
|
22
|
+
| `temperature` | float | 0.5 | Temperature parameter for evaluation |
|
23
|
+
| `n_rounds` | int | 5 | Number of evaluation rounds |
|
24
|
+
| `max_concurrency` | int | 10 | Maximum number of concurrent requests |
|
25
|
+
| `api_key` | str | OPENAI_API_KEY | API key for evaluation |
|
26
|
+
| `base_url` | str | OPENAI_BASE_URL | Service URL for evaluation |
|
27
|
+
|
28
|
+
By default, `api_key` and `base_url` will use values from environment variables, and other options are configured as shown in the table above. You can customize the settings as follows:
|
29
|
+
|
30
|
+
<PirateCustomEval />
|
31
|
+
|
32
|
+
## Notes
|
33
|
+
|
34
|
+
<Warning>The current evaluation functionality depends on OpenAI's [structured output](https://platform.openai.com/docs/guides/structured-outputs). Please ensure that your chosen [model](https://platform.openai.com/docs/models) supports this feature. We strongly recommend using `gpt-4o` or newer models to ensure evaluation effectiveness and compatibility.</Warning>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
title: 'Trace'
|
3
|
+
description: 'Start observe your agents in under 5 minutes'
|
4
|
+
---
|
5
|
+
|
6
|
+
import PirateExample from '/snippets/pirate-example.mdx';
|
7
|
+
|
8
|
+
<img className="block dark:hidden" src="/images/pirate-example.png" />
|
9
|
+
<img className="hidden dark:block" src="/images/pirate-example-dark.png" />
|
10
|
+
|
11
|
+
<Steps>
|
12
|
+
<Step title="Create an Account">
|
13
|
+
Create an account on [Divine Agent](https://www.divine-agent.com/signup?source=docs).
|
14
|
+
</Step>
|
15
|
+
<Step title="Install Divi">
|
16
|
+
Install the Divine Agent Python package:
|
17
|
+
```shell
|
18
|
+
pip install divi
|
19
|
+
```
|
20
|
+
</Step>
|
21
|
+
<Step title="Get API Key">
|
22
|
+
Get API Key from [Web](https://www.divine-agent.com/dashboard/api-keys).
|
23
|
+
</Step>
|
24
|
+
<Step title="Set up Environment">
|
25
|
+
Create a `.env` file and add the following line:
|
26
|
+
```env
|
27
|
+
DIVI_API_KEY=your_api_key
|
28
|
+
OPENAI_BASE_URL=https://api.openai.com/v1
|
29
|
+
OPENAI_API_KEY=your_llm_api_key
|
30
|
+
```
|
31
|
+
</Step>
|
32
|
+
<Step title="Trace Pirate Agent">
|
33
|
+
Run the following code:
|
34
|
+
<PirateExample />
|
35
|
+
</Step>
|
36
|
+
</Steps>
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
```python Pirate Example {2,15-18} [expandable]
|
2
|
+
from divi import obs_openai, observable
|
3
|
+
from divi.evaluation import EvaluatorConfig, Score
|
4
|
+
from dotenv import load_dotenv
|
5
|
+
from openai import OpenAI
|
6
|
+
|
7
|
+
load_dotenv()
|
8
|
+
|
9
|
+
|
10
|
+
class Pirate:
|
11
|
+
def __init__(self):
|
12
|
+
self.client = obs_openai(
|
13
|
+
OpenAI(),
|
14
|
+
name="Pirate",
|
15
|
+
scores=[Score.instruction_adherence, Score.task_completion],
|
16
|
+
eval=EvaluatorConfig(
|
17
|
+
model="gpt-4.1",
|
18
|
+
n_rounds=2,
|
19
|
+
),
|
20
|
+
)
|
21
|
+
|
22
|
+
@observable(name="Talk with pirate")
|
23
|
+
def talk(self, message: str):
|
24
|
+
"""Talk like a pirate."""
|
25
|
+
res = self.client.chat.completions.create(
|
26
|
+
model="gpt-4o",
|
27
|
+
messages=[
|
28
|
+
{"role": "developer", "content": "Talk like a pirate."},
|
29
|
+
{
|
30
|
+
"role": "user",
|
31
|
+
"content": message,
|
32
|
+
},
|
33
|
+
],
|
34
|
+
)
|
35
|
+
return res.choices[0].message.content
|
36
|
+
|
37
|
+
|
38
|
+
pirate = Pirate()
|
39
|
+
pirate.talk("How do I check if a Python object is an instance of a class?")
|
40
|
+
```
|
@@ -0,0 +1,36 @@
|
|
1
|
+
```python Pirate Example {2,14} [expandable]
|
2
|
+
from divi import obs_openai, observable
|
3
|
+
from divi.evaluation import Score
|
4
|
+
from dotenv import load_dotenv
|
5
|
+
from openai import OpenAI
|
6
|
+
|
7
|
+
load_dotenv()
|
8
|
+
|
9
|
+
|
10
|
+
class Pirate:
|
11
|
+
def __init__(self):
|
12
|
+
self.client = obs_openai(
|
13
|
+
OpenAI(),
|
14
|
+
name="Pirate",
|
15
|
+
scores=[Score.instruction_adherence, Score.task_completion],
|
16
|
+
)
|
17
|
+
|
18
|
+
@observable(name="Talk with pirate")
|
19
|
+
def talk(self, message: str):
|
20
|
+
"""Talk like a pirate."""
|
21
|
+
res = self.client.chat.completions.create(
|
22
|
+
model="gpt-4o",
|
23
|
+
messages=[
|
24
|
+
{"role": "developer", "content": "Talk like a pirate."},
|
25
|
+
{
|
26
|
+
"role": "user",
|
27
|
+
"content": message,
|
28
|
+
},
|
29
|
+
],
|
30
|
+
)
|
31
|
+
return res.choices[0].message.content
|
32
|
+
|
33
|
+
|
34
|
+
pirate = Pirate()
|
35
|
+
pirate.talk("How do I check if a Python object is an instance of a class?")
|
36
|
+
```
|
@@ -0,0 +1,34 @@
|
|
1
|
+
```python Pirate Example {1,10-13,15} [expandable]
|
2
|
+
from divi import obs_openai, observable
|
3
|
+
from dotenv import load_dotenv
|
4
|
+
from openai import OpenAI
|
5
|
+
|
6
|
+
load_dotenv()
|
7
|
+
|
8
|
+
|
9
|
+
class Pirate:
|
10
|
+
def __init__(self):
|
11
|
+
self.client = obs_openai(
|
12
|
+
OpenAI(),
|
13
|
+
name="Pirate",
|
14
|
+
)
|
15
|
+
|
16
|
+
@observable(name="Talk with pirate")
|
17
|
+
def talk(self, message: str):
|
18
|
+
"""Talk like a pirate."""
|
19
|
+
res = self.client.chat.completions.create(
|
20
|
+
model="gpt-4o",
|
21
|
+
messages=[
|
22
|
+
{"role": "developer", "content": "Talk like a pirate."},
|
23
|
+
{
|
24
|
+
"role": "user",
|
25
|
+
"content": message,
|
26
|
+
},
|
27
|
+
],
|
28
|
+
)
|
29
|
+
return res.choices[0].message.content
|
30
|
+
|
31
|
+
|
32
|
+
pirate = Pirate()
|
33
|
+
pirate.talk("How do I check if a Python object is an instance of a class?")
|
34
|
+
```
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
title: '评估'
|
3
|
+
description: '一行代码完成智能体评估'
|
4
|
+
---
|
5
|
+
import PirateEval from '/snippets/evaluation/pirate-eval.mdx';
|
6
|
+
import PirateCustomEval from '/snippets/evaluation/pirate-custom-eval.mdx';
|
7
|
+
|
8
|
+
<img className="block dark:hidden" src="/images/pirate-eval-example.png" />
|
9
|
+
<img className="hidden dark:block" src="/images/pirate-eval-example-dark.png" />
|
10
|
+
|
11
|
+
## 行为评估
|
12
|
+
|
13
|
+
> 自动化评估[跟踪](./trace)的海盗 (Pirate) 智能体的指令遵从性和任务完成度。
|
14
|
+
|
15
|
+
<PirateEval />
|
16
|
+
|
17
|
+
## 自定义设置
|
18
|
+
|
19
|
+
| Property | Type | Default | Description |
|
20
|
+
|-----------------|--------|:-------------------:|---------------------|
|
21
|
+
| `model` | str | gpt-4o | 用于评估的模型名称 |
|
22
|
+
| `temperature` | float | 0.5 | 评估过程中的温度参数 |
|
23
|
+
| `n_rounds` | int | 5 | 评估的轮数 |
|
24
|
+
| `max_concurrency` | int | 10 | 最大并发请求数 |
|
25
|
+
| `api_key` | str | OPENAI_API_KEY | 用于评估的 API 密钥 |
|
26
|
+
| `base_url` | str | OPENAI_BASE_URL | 评估所用的服务商 URL |
|
27
|
+
|
28
|
+
默认情况下,`api_key` 与 `base_url` 会使用环境变量中的值,其他选项配置如上表所示。您可以通过以下方式自定义设置:
|
29
|
+
|
30
|
+
<PirateCustomEval />
|
31
|
+
|
32
|
+
## 注意事项
|
33
|
+
|
34
|
+
<Warning>当前评估功能依赖于 OpenAI 的[结构化输出](https://platform.openai.com/docs/guides/structured-outputs),请确保您所选择的[模型](https://platform.openai.com/docs/models)支持该功能,我们强烈建议使用 `gpt-4o` 或更新版本的模型以确保评估效果和兼容性。</Warning>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
title: '追踪'
|
3
|
+
description: '5 分钟内开启智能体追踪'
|
4
|
+
---
|
5
|
+
|
6
|
+
import PirateExample from '/snippets/pirate-example.mdx';
|
7
|
+
|
8
|
+
<img className="block dark:hidden" src="/images/pirate-example.png" />
|
9
|
+
<img className="hidden dark:block" src="/images/pirate-example-dark.png" />
|
10
|
+
|
11
|
+
<Steps>
|
12
|
+
<Step title="创建账户">
|
13
|
+
在 [Divine Agent](https://www.divine-agent.com/signup?source=docs) 上创建一个账户。
|
14
|
+
</Step>
|
15
|
+
<Step title="安装 Divi">
|
16
|
+
安装 Divine Agent Python 包:
|
17
|
+
```shell
|
18
|
+
pip install divi
|
19
|
+
```
|
20
|
+
</Step>
|
21
|
+
<Step title="获取 API Key">
|
22
|
+
从 [Web](https://www.divine-agent.com/dashboard/api-keys) 获取 API Key。
|
23
|
+
</Step>
|
24
|
+
<Step title="设置环境">
|
25
|
+
创建一个 `.env` 文件并添加以下行:
|
26
|
+
```env
|
27
|
+
DIVI_API_KEY=your_api_key
|
28
|
+
OPENAI_BASE_URL=https://api.openai.com/v1
|
29
|
+
OPENAI_API_KEY=your_llm_api_key
|
30
|
+
```
|
31
|
+
</Step>
|
32
|
+
<Step title="追踪 Pirate Agent">
|
33
|
+
运行以下代码:
|
34
|
+
<PirateExample />
|
35
|
+
</Step>
|
36
|
+
</Steps>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import atexit
|
1
2
|
import os
|
2
3
|
import time
|
3
4
|
from enum import Enum
|
@@ -62,6 +63,8 @@ class Span:
|
|
62
63
|
"""Start the span by recording the current time in nanoseconds."""
|
63
64
|
self.start_time_unix_nano = time.time_ns()
|
64
65
|
self.upsert_span()
|
66
|
+
# Register the end method to be called at exit
|
67
|
+
atexit.register(self.end)
|
65
68
|
|
66
69
|
def end(self):
|
67
70
|
"""End the span by recording the end time in nanoseconds."""
|
@@ -69,6 +72,8 @@ class Span:
|
|
69
72
|
raise ValueError("Span must be started before ending.")
|
70
73
|
self.end_time_unix_nano = time.time_ns()
|
71
74
|
self.upsert_span()
|
75
|
+
# Unregister the end method
|
76
|
+
atexit.unregister(self.end)
|
72
77
|
|
73
78
|
def _add_node(self, trace_id: UUID4, parent_id: Optional[bytes] = None):
|
74
79
|
"""Add node for obs tree."""
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import atexit
|
1
2
|
from datetime import UTC, datetime
|
2
3
|
from typing import Optional
|
3
4
|
from uuid import uuid4
|
@@ -63,6 +64,8 @@ class Trace:
|
|
63
64
|
"""Start the trace by recording the current time in nanoseconds."""
|
64
65
|
self.start_time = datetime.now(UTC).isoformat()
|
65
66
|
self.upsert_trace()
|
67
|
+
# Register the end method to be called on exit
|
68
|
+
atexit.register(self.end)
|
66
69
|
|
67
70
|
def end(self):
|
68
71
|
"""End the trace by recording the end time in nanoseconds."""
|
@@ -70,6 +73,8 @@ class Trace:
|
|
70
73
|
raise ValueError("Span must be started before ending.")
|
71
74
|
self.end_time = datetime.now(UTC).isoformat()
|
72
75
|
self.upsert_trace()
|
76
|
+
# Unregister the end method to prevent multiple calls
|
77
|
+
atexit.unregister(self.end)
|
73
78
|
|
74
79
|
def upsert_trace(self):
|
75
80
|
"""Upsert trace with datapark."""
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
10
|
+
and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
26
|
+
overall community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
31
|
+
advances of any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email
|
35
|
+
address, without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
jikaifang2002@gmail.com.
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
86
|
+
of actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
93
|
+
permanent ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
113
|
+
the community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.0, available at
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
123
|
+
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
125
|
+
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
128
|
+
https://www.contributor-covenant.org/translations.
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<p align="center">
|
2
|
+
<a href="https://divine-agent.com/"><img width="128" height="128" src="https://raw.githubusercontent.com/Kaikaikaifang/divine-agent/main/docs/images/thinking-angel.png" alt='Divine Agent'></a>
|
3
|
+
</p>
|
4
|
+
|
5
|
+
<p align="center"><strong>神明代理人</strong> <em>– 全栈开源的智能体可观测方案,简单、清晰。</em></p>
|
6
|
+
|
7
|
+
<p align="center">
|
8
|
+
<a href="https://pypi.org/project/divi/">
|
9
|
+
<img src="https://img.shields.io/pypi/v/divi.svg" alt="Package version">
|
10
|
+
</a>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p align="center">
|
14
|
+
中文 / <a href="./docs/README.md">English</a>
|
15
|
+
</p>
|
16
|
+
|
17
|
+
神明代理人 (Divine Agent) 是一个智能体可观测工具,提供追踪、评估和用量统计功能。
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
> [!IMPORTANT]
|
22
|
+
> **神明代理人目前处于实验性阶段**,随时可能进行重大变更。本项目正处于活跃开发阶段,接口和功能模块可能在没有事先通知的情况下发生变更。
|
23
|
+
>
|
24
|
+
> 在正式稳定版本发布前,不建议在生产环境中使用该组件。
|
25
|
+
|
26
|
+
## 安装
|
27
|
+
|
28
|
+
建议 Python 版本 3.11+
|
29
|
+
|
30
|
+
```shell
|
31
|
+
pip install divi
|
32
|
+
```
|
33
|
+
|
34
|
+
## 追踪
|
35
|
+
|
36
|
+
1. 从[官网](https://www.divine-agent.com/dashboard/api-keys)获取 API Key.
|
37
|
+
2. 创建 `.env` 文件并添加以下行:
|
38
|
+
```env
|
39
|
+
DIVI_API_KEY=your_divi_api_key
|
40
|
+
OPENAI_BASE_URL=https://api.deepseek.com
|
41
|
+
OPENAI_API_KEY=your_llm_api_key
|
42
|
+
```
|
43
|
+
3. 运行以下代码:
|
44
|
+
```python
|
45
|
+
from divi import obs_openai, observable
|
46
|
+
from dotenv import load_dotenv
|
47
|
+
from openai import OpenAI
|
48
|
+
|
49
|
+
load_dotenv()
|
50
|
+
|
51
|
+
|
52
|
+
class Wukong:
|
53
|
+
def __init__(self):
|
54
|
+
self.client = obs_openai(
|
55
|
+
OpenAI(),
|
56
|
+
name="Wukong",
|
57
|
+
)
|
58
|
+
|
59
|
+
@observable(name="Talk with Wukong")
|
60
|
+
def talk(self, message: str):
|
61
|
+
"""Talk like Wukong."""
|
62
|
+
res = self.client.chat.completions.create(
|
63
|
+
model="deepseek-chat",
|
64
|
+
messages=[
|
65
|
+
{"role": "system", "content": "像孙悟空一样说话。"},
|
66
|
+
{
|
67
|
+
"role": "user",
|
68
|
+
"content": message,
|
69
|
+
},
|
70
|
+
],
|
71
|
+
)
|
72
|
+
return res.choices[0].message.content
|
73
|
+
|
74
|
+
|
75
|
+
wukong = Wukong()
|
76
|
+
wukong.talk("如何检查一个 Python 对象是否是某个类的实例?")
|
77
|
+
```
|