divi 0.0.1b0__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.1b0 → divi-0.0.1b2}/PKG-INFO +1 -1
- divi-0.0.1b2/README.md +75 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/README.md +0 -4
- divi-0.0.1b2/apps/docs/README.md +3 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/docs.json +10 -10
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/en/introduction.mdx +2 -0
- 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/images/pirate-example.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.1b0 → divi-0.0.1b2}/apps/docs/zh/development/roadmap.mdx +2 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/zh/introduction.mdx +2 -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.1b2/apps/graphql/README.md +3 -0
- divi-0.0.1b2/apps/web/README.md +3 -0
- divi-0.0.1b2/divi/README.md +3 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/__init__.py +3 -4
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/decorators/obs_openai.py +7 -6
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/decorators/observable.py +6 -1
- divi-0.0.1b2/divi/evaluation/__init__.py +4 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/evaluation/evaluator.py +20 -6
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/signals/span.py +5 -0
- {divi-0.0.1b0 → 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.1b2/docs/images/thinking-angel.png +0 -0
- divi-0.0.1b2/packages/README.md +15 -0
- divi-0.0.1b0/README.md +0 -14
- divi-0.0.1b0/apps/docs/README.md +0 -32
- divi-0.0.1b0/apps/docs/en/quickstart/trace.mdx +0 -4
- divi-0.0.1b0/apps/docs/zh/quickstart/trace.mdx +0 -4
- divi-0.0.1b0/apps/graphql/README.md +0 -3
- divi-0.0.1b0/apps/web/README.md +0 -36
- divi-0.0.1b0/divi/evaluation/__init__.py +0 -4
- divi-0.0.1b0/docs/README.md +0 -3
- divi-0.0.1b0/packages/README.md +0 -15
- {divi-0.0.1b0 → divi-0.0.1b2}/.dockerignore +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/.github/dependabot.yml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/.gitignore +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/LICENSE +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/en/concepts/score.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/en/concepts/session.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/en/development/roadmap.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/en/tutorials/self-refine.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/favicon.ico +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/images/researcher-angel.png +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/images/scholar-angel.png +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/package.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/snippets/snippet-intro.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/zh/concepts/score.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/zh/concepts/session.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/docs/zh/tutorials/self-refine.mdx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/Dockerfile +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/codegen.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/package.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/datasources/auth-api.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/datasources/datapark-api.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/index.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/resolvers.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/schema.graphql +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/types/context.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/types/response.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/src/types/types.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/graphql/tsconfig.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/.gitignore +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/@modal/(.)traces/[id]/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/@modal/default.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/actions.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/columns.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/create-dialog.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/data-table-cell-viewer.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/data-table-toolbar.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/data-table.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/components/delete-dialog.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/data/data.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/data/schema.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/layout.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/api-keys/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/components/app-sidebar.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/components/nav-main.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/components/nav-secondary.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/components/nav-user.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/components/site-header.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/layout.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/account/components/account-form.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/account/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/appearance/components/appearance-form.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/appearance/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/components/profile-form.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/components/sidebar-nav.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/layout.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/settings/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/Span.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/responsive-resizable.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/trace-board.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/components/trace-chart.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(children)/[id]/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/columns.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/data-table-row-action.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/data-table-toolbar.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/components/data-table.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/data/data.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/data/schema.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/layout.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/traces/(overview)/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/usages/actions.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/usages/components/usage-board.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/usages/components/usage-chart.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/usages/layout.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/dashboard/usages/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/favicon.ico +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/home/components/home-header.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/home/components/home-hero.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/home/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/layout.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/login/components/login-form.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/login/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/signup/components/signup-form.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/app/signup/page.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/ApolloWrapper.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/Highter.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/Modal.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/calendar.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/data-table-column-header.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/data-table-faceted-filter.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/data-table-pagination.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/data-table-row.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/data-table-view-options.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/date-picker.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/mode-switcher.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components/theme-provider.tsx +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/components.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/hooks/actionState.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/hooks/apolloClient.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/callback/toast-callback.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/callback/with-callback.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/server/README.md +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/server/auth.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/server/cookies.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/server/evaluation.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/server/openai.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/server/span.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/types/span.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/types/state.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/types/usage.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/lib/utils.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/middleware.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/next-env.d.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/next.config.ts +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/package.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/postcss.config.mjs +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/public/peeking-angel.png +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/public/thinking-angel.png +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/tsconfig.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/apps/web/vercel.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/biome.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/compose-dev.yml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/decorators/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/decorators/collect.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/decorators/observe.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/evaluation/evaluate.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/evaluation/prompts.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/evaluation/scores.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/common/v1/common.proto +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/common/v1/common_pb2.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/common/v1/common_pb2.pyi +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service.proto +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service_pb2.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service_pb2.pyi +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/core/health/v1/health_service_pb2_grpc.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/metric/v1/metric.proto +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/metric/v1/metric_pb2.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/metric/v1/metric_pb2.pyi +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/trace/v1/trace.proto +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/trace/v1/trace_pb2.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/proto/trace/v1/trace_pb2.pyi +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/auth/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/auth/auth.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/auth/init.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/auth/tokman.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/core/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/core/core.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/core/finish.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/core/init.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/datapark/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/datapark/datapark.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/datapark/init.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/finish.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/init.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/services/service.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/session/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/session/session.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/session/setup.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/session/teardown.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/signals/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/divi/utils.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docker-compose.yml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docs/developer_tools.md +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docs/images/architecture.svg +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docs/images/favicon.ico +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docs/images/og-image.png +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docs/images/storage.svg +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/docs/package_readme.md +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/go.work +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/go.work.sum +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/hatch.toml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/package.json +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/pnpm-lock.yaml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/pnpm-workspace.yaml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/pyproject.toml +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/scripts/README.md +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/scripts/hatch_build.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/scripts/image_build.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/scripts/key_build.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/scripts/proto_build.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/README.md +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/go.mod +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/go.sum +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/auth/handler/api.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/auth/handler/api_key.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/auth/handler/auth.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/auth/handler/user.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/auth/router/router.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/core/.keep +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/api.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/evaluation.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/metric.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/openai.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/session.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/trace.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/handler/usage.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/app/datapark/router/router.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/auth/auth.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/auth/middleware.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/config/config.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/database/connect.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/database/database.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/api_key.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/openai.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/score.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/session.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/trace.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/usage.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/internal/pkg/model/user.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/pb/common.pb.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/pb/health_service.pb.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/pb/health_service_grpc.pb.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/pb/metric.pb.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/services/pb/trace.pb.go +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/tests/__init__.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/tests/unit_tests/decorators/test_obs_openai.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/tests/unit_tests/decorators/test_observable.py +0 -0
- {divi-0.0.1b0 → divi-0.0.1b2}/turbo.json +0 -0
- {divi-0.0.1b0 → 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.
|
divi-0.0.1b2/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
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>Divine Agent</strong> <em>– Fully open-source agent observability. Simple. Clear.</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_ZH.md">中文</a> / English
|
15
|
+
</p>
|
16
|
+
|
17
|
+
divine-agent is an observability tool for LLM-based agents, offering tracing, evaluation, and usage statistics.
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
> [!IMPORTANT]
|
22
|
+
> **divine-agent is currently experimental** and may undergo significant changes at any time. This project is in active development, which means APIs and features might change without prior notice.
|
23
|
+
>
|
24
|
+
> We do not recommend using divine-agent in production environments until a stable release is available.
|
25
|
+
|
26
|
+
## Install
|
27
|
+
|
28
|
+
Requires Python 3.11+
|
29
|
+
|
30
|
+
```shell
|
31
|
+
pip install divi
|
32
|
+
```
|
33
|
+
|
34
|
+
## Trace
|
35
|
+
|
36
|
+
1. Get API Key from [Web](https://www.divine-agent.com/dashboard/api-keys).
|
37
|
+
2. Create a `.env` file and add the following line:
|
38
|
+
```env
|
39
|
+
DIVI_API_KEY=your_api_key
|
40
|
+
```
|
41
|
+
3. Run the following code:
|
42
|
+
```python
|
43
|
+
from divi import obs_openai, observable
|
44
|
+
from dotenv import load_dotenv
|
45
|
+
from openai import OpenAI
|
46
|
+
|
47
|
+
load_dotenv()
|
48
|
+
|
49
|
+
|
50
|
+
class Pirate:
|
51
|
+
def __init__(self):
|
52
|
+
self.client = obs_openai(
|
53
|
+
OpenAI(),
|
54
|
+
name="Pirate",
|
55
|
+
)
|
56
|
+
|
57
|
+
@observable(name="Talk with pirate")
|
58
|
+
def talk(self, message: str):
|
59
|
+
"""Talk like a pirate."""
|
60
|
+
res = self.client.chat.completions.create(
|
61
|
+
model="gpt-4o",
|
62
|
+
messages=[
|
63
|
+
{"role": "developer", "content": "Talk like a pirate."},
|
64
|
+
{
|
65
|
+
"role": "user",
|
66
|
+
"content": message,
|
67
|
+
},
|
68
|
+
],
|
69
|
+
)
|
70
|
+
return res.choices[0].message.content
|
71
|
+
|
72
|
+
|
73
|
+
pirate = Pirate()
|
74
|
+
pirate.talk("How do I check if a Python object is an instance of a class?")
|
75
|
+
```
|
@@ -9,7 +9,3 @@
|
|
9
9
|
| graphql | A GraphQL server | 4000 |
|
10
10
|
| web | A Next.js web server | 4001 |
|
11
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)
|
@@ -15,11 +15,11 @@
|
|
15
15
|
"groups": [
|
16
16
|
{
|
17
17
|
"group": "Get Started",
|
18
|
-
"pages": [
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
"pages": [
|
19
|
+
"en/introduction",
|
20
|
+
"en/quickstart/trace",
|
21
|
+
"en/quickstart/evaluation"
|
22
|
+
]
|
23
23
|
}
|
24
24
|
]
|
25
25
|
},
|
@@ -28,11 +28,11 @@
|
|
28
28
|
"groups": [
|
29
29
|
{
|
30
30
|
"group": "快速开始",
|
31
|
-
"pages": [
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
"pages": [
|
32
|
+
"zh/introduction",
|
33
|
+
"zh/quickstart/trace",
|
34
|
+
"zh/quickstart/evaluation"
|
35
|
+
]
|
36
36
|
}
|
37
37
|
]
|
38
38
|
}
|
@@ -13,3 +13,5 @@ description: "Welcome to the docs of Divine Agent"
|
|
13
13
|
src="/images/scholar-angel.png"
|
14
14
|
alt="Hero Dark"
|
15
15
|
/>
|
16
|
+
|
17
|
+
**Divine-Agent** is an observability tool for agents, offering tracing, evaluation, and usage statistics to help users observe the performance and behavior of their agents.
|
@@ -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
|
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,10 +1,9 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
3
|
from .decorators import obs_openai, observable
|
4
|
-
from .evaluation import Evaluator
|
4
|
+
from .evaluation import Evaluator
|
5
5
|
from .services import Auth, Core, DataPark
|
6
6
|
from .session import Session
|
7
|
-
from .signals import Kind
|
8
7
|
|
9
8
|
name: str = "divi"
|
10
9
|
|
@@ -14,5 +13,5 @@ _auth: Optional[Auth] = None
|
|
14
13
|
_datapark: Optional[DataPark] = None
|
15
14
|
_evaluator: Optional[Evaluator] = None
|
16
15
|
|
17
|
-
__version__ = "0.0.
|
18
|
-
__all__ = ["obs_openai", "observable"
|
16
|
+
__version__ = "0.0.1b2"
|
17
|
+
__all__ = ["obs_openai", "observable"]
|
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, TypeVar, Union
|
|
5
5
|
from typing_extensions import Optional
|
6
6
|
|
7
7
|
from divi.decorators.observable import observable
|
8
|
+
from divi.evaluation.evaluator import EvaluatorConfig
|
8
9
|
from divi.evaluation.scores import Score
|
9
10
|
from divi.signals.span import Kind
|
10
11
|
from divi.utils import is_async
|
@@ -19,10 +20,13 @@ def _get_observable_create(
|
|
19
20
|
create: Callable,
|
20
21
|
name: Optional[str] = None,
|
21
22
|
scores: Optional[list[Score]] = None,
|
23
|
+
eval: Optional[EvaluatorConfig] = None,
|
22
24
|
) -> Callable:
|
23
25
|
@functools.wraps(create)
|
24
26
|
def observable_create(*args, stream: bool = False, **kwargs):
|
25
|
-
decorator = observable(
|
27
|
+
decorator = observable(
|
28
|
+
kind=Kind.llm, name=name, scores=scores, eval=eval
|
29
|
+
)
|
26
30
|
return decorator(create)(*args, stream=stream, **kwargs)
|
27
31
|
|
28
32
|
# TODO Async Observable Create
|
@@ -33,16 +37,13 @@ def obs_openai(
|
|
33
37
|
client: C,
|
34
38
|
name: Optional[str] = "Agent",
|
35
39
|
scores: Optional[list[Score]] = None,
|
40
|
+
eval: Optional[EvaluatorConfig] = None,
|
36
41
|
) -> C:
|
37
42
|
"""Make OpenAI client observable."""
|
38
43
|
client.chat.completions.create = _get_observable_create(
|
39
44
|
client.chat.completions.create,
|
40
45
|
name=name,
|
41
46
|
scores=scores,
|
42
|
-
|
43
|
-
client.completions.create = _get_observable_create(
|
44
|
-
client.completions.create,
|
45
|
-
name=name,
|
46
|
-
scores=scores,
|
47
|
+
eval=eval,
|
47
48
|
)
|
48
49
|
return client
|
@@ -15,6 +15,7 @@ from typing import (
|
|
15
15
|
|
16
16
|
from divi.decorators.observe import observe
|
17
17
|
from divi.evaluation.evaluate import evaluate_scores
|
18
|
+
from divi.evaluation.evaluator import EvaluatorConfig
|
18
19
|
from divi.evaluation.scores import Score
|
19
20
|
from divi.session import SessionExtra
|
20
21
|
from divi.signals.span import Kind, Span
|
@@ -43,6 +44,7 @@ def observable(
|
|
43
44
|
*,
|
44
45
|
name: Optional[str] = None,
|
45
46
|
scores: Optional[list[Score]] = None,
|
47
|
+
eval: Optional[EvaluatorConfig] = None,
|
46
48
|
metadata: Optional[Mapping[str, Any]] = None,
|
47
49
|
) -> Callable[[Callable[P, R]], WithSessionExtra[P, R]]: ...
|
48
50
|
|
@@ -56,6 +58,7 @@ def observable(
|
|
56
58
|
name = kwargs.pop("name", None)
|
57
59
|
metadata = kwargs.pop("metadata", None)
|
58
60
|
scores: list[Score] = kwargs.pop("scores", None)
|
61
|
+
eval: EvaluatorConfig = kwargs.pop("eval", None)
|
59
62
|
|
60
63
|
def decorator(func):
|
61
64
|
@functools.wraps(func)
|
@@ -78,7 +81,9 @@ def observable(
|
|
78
81
|
|
79
82
|
# 3. evaluate the scores if they are provided
|
80
83
|
messages = kwargs.get("messages", [])
|
81
|
-
evaluate_scores(
|
84
|
+
evaluate_scores(
|
85
|
+
messages, outputs=result, scores=scores, config=eval
|
86
|
+
)
|
82
87
|
|
83
88
|
return result
|
84
89
|
|