@nocobase/plugin-ai 2.2.0-beta.1 → 2.2.0-beta.10
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.
- package/dist/ai/docs/nocobase/ai/ai-quick-start.md +1 -1
- package/dist/ai/docs/nocobase/ai/claude-code/index.md +2 -2
- package/dist/ai/docs/nocobase/ai/codex/index.md +2 -2
- package/dist/ai/docs/nocobase/ai/hermes-agent/index.md +2 -2
- package/dist/ai/docs/nocobase/ai/index.md +1 -1
- package/dist/ai/docs/nocobase/ai/install-nocobase-app.md +117 -0
- package/dist/ai/docs/nocobase/ai/local-development-setup.md +94 -0
- package/dist/ai/docs/nocobase/ai/openclaw/index.md +2 -2
- package/dist/ai/docs/nocobase/ai/opencode/index.md +2 -2
- package/dist/ai/docs/nocobase/ai/quick-start.mdx +22 -15
- package/dist/ai/docs/nocobase/ai/upgrade-from-2-0-to-2-1.md +57 -0
- package/dist/ai/docs/nocobase/ai/upgrade-nocobase-app.md +111 -0
- package/dist/ai/docs/nocobase/ai/windows-wsl.md +409 -0
- package/dist/ai/docs/nocobase/ai/workbuddy/index.md +2 -2
- package/dist/ai/docs/nocobase/ai-builder/index.md +17 -2
- package/dist/ai/docs/nocobase/ai-builder/version-control.md +120 -0
- package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/dev/external-knowledge-base.md +318 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/documents.md +76 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/hit-tests.md +66 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/index.md +73 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/segments.md +93 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/settings.md +77 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/rag.md +1 -1
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/create-document.md +79 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/delete-document.md +71 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/index.md +92 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/retrieve-document.md +87 -0
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/update-document.md +70 -0
- package/dist/ai/docs/nocobase/api/app/env.md +28 -1
- package/dist/ai/docs/nocobase/api/cli/app/restart.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/app/start.md +7 -0
- package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +6 -0
- package/dist/ai/docs/nocobase/api/cli/config/delete.md +9 -6
- package/dist/ai/docs/nocobase/api/cli/config/get.md +8 -6
- package/dist/ai/docs/nocobase/api/cli/config/index.md +40 -26
- package/dist/ai/docs/nocobase/api/cli/config/set.md +15 -8
- package/dist/ai/docs/nocobase/api/cli/env/auth.md +53 -5
- package/dist/ai/docs/nocobase/api/cli/init.md +41 -4
- package/dist/ai/docs/nocobase/api/cli/plugin/import.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/self/check.md +19 -2
- package/dist/ai/docs/nocobase/api/cli/self/index.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/self/update.md +17 -3
- package/dist/ai/docs/nocobase/api/cli/skills/install.md +1 -0
- package/dist/ai/docs/nocobase/api/cli/skills/update.md +1 -0
- package/dist/ai/docs/nocobase/api/cli/source/download.md +19 -0
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/validation.md +11 -8
- package/dist/ai/docs/nocobase/development/index.md +9 -2
- package/dist/ai/docs/nocobase/file-manager/field-attachment.md +6 -0
- package/dist/ai/docs/nocobase/file-manager/file-preview/index.md +3 -12
- package/dist/ai/docs/nocobase/file-manager/storage/aliyun-oss.md +9 -0
- package/dist/ai/docs/nocobase/file-manager/storage/amazon-s3.md +9 -0
- package/dist/ai/docs/nocobase/file-manager/storage/index.md +23 -0
- package/dist/ai/docs/nocobase/file-manager/storage/local.md +12 -1
- package/dist/ai/docs/nocobase/file-manager/storage/migrate-to-s3-pro.md +269 -0
- package/dist/ai/docs/nocobase/file-manager/storage/tencent-cos.md +9 -0
- package/dist/ai/docs/nocobase/get-started/deployment/how-to-deploy-nocobase-faster.mdx +2 -2
- package/dist/ai/docs/nocobase/get-started/how-nocobase-works.mdx +8 -1
- package/dist/ai/docs/nocobase/get-started/installation/docker-caddy.mdx +175 -0
- package/dist/ai/docs/nocobase/get-started/installation/docker-nginx.mdx +176 -0
- package/dist/ai/docs/nocobase/get-started/installation/docker.mdx +94 -1
- package/dist/ai/docs/nocobase/get-started/installation/env.md +14 -4
- package/dist/ai/docs/nocobase/get-started/quickstart.md +6 -1
- package/dist/ai/docs/nocobase/get-started/system-requirements.md +9 -1
- package/dist/ai/docs/nocobase/index.md +7 -10
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/gantt.md +204 -0
- package/dist/ai/docs/nocobase/interface-builder/blocks/data-blocks/map.md +105 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/scan-input.md +43 -0
- package/dist/ai/docs/nocobase/interface-builder/fields/field-settings/validation-rules.md +6 -2
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/index.md +6 -6
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/installation/cli.md +5 -9
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/installation/env.md +3 -3
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/installation/migration.md +1 -1
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/production/index.md +1 -1
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/production/reverse-proxy/caddy.md +1 -1
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/production/reverse-proxy/index.md +1 -1
- package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/production/reverse-proxy/nginx.md +1 -1
- package/dist/ai/docs/nocobase/ops-management/backup-manager/index.mdx +9 -7
- package/dist/ai/docs/nocobase/ops-management/migration-manager/built-in-tables.md +423 -0
- package/dist/ai/docs/nocobase/ops-management/migration-manager/index.md +12 -9
- package/dist/ai/docs/nocobase/ops-management/release-management/index.md +111 -24
- package/dist/ai/docs/nocobase/ops-management/version-control/index.md +22 -6
- package/dist/ai/docs/nocobase/plugin-development/client/index.md +1 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-acl/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-edit/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-update/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-custom-request/index.md +5 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-duplicate/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-export/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-export-pro/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-import/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-import-pro/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-print/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-template-print/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai/index.md +6 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai-gigachat/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai-knowledge-base/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-doc/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-keys/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-app-sso/index.md +16 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-app-supervisor/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-async-task-manager/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-audit-logger/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-audit-logs/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-cas/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-dingtalk/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-ldap/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-oidc/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-saml/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-sms/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-wecom/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backup-restore/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backups/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-grid-card/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-iframe/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-list/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-markdown/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-multi-step-form/index.md +6 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-template/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-tree/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-workbench/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-calendar/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-charts/index.md +5 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-client/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-fdw/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-sql/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-tree/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-comments/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-custom-brand/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-custom-variables/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-clickhouse/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-doris/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-mariadb/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-mssql/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-mysql/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-nocobase/index.md +16 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-oracle/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-external-postgres/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-kingbase/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-main/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-manager/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-rest-api/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization-echarts/index.md +8 -4
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-departments/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-email-manager/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-embed/index.md +4 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-environment-variables/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-error-handler/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-attachment-url/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-china-region/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-code/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-component-mask/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-encryption/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-formula/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-m2m-array/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-markdown-vditor/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sequence/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-signature/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sort/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-manager/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-previewer-office/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-storage-s3-pro/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-flow-engine/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-form-drafts/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-gantt/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-graph-collection-manager/index.md +8 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-idp-oauth/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ip-restriction/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-kanban/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-license/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-locale-tester/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-localization/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-lock-adapter-redis/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-logger/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-map/index.md +87 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mcp-server/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-migration-manager/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile/index.md +8 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile-client/index.md +7 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-manager/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-share-collection/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-keyword-filter/index.md +4 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-portal/index.md +16 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-space/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-email/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-in-app-message/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-manager/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-password-policy/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-public-forms/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-pubsub-adapter-redis/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-queue-adapter-rabbitmq/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-queue-adapter-redis/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-record-history/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-request-encryption/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-snapshot-field/index.md +6 -4
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-system-settings/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-telemetry/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-telemetry-prometheus/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-text-copy/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-theme-editor/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-two-factor-authentication/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-layout/index.md +14 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-schema-storage/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-templates/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-user-data-sync/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-users/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-verification/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-verification-totp-authenticator/index.md +2 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-version-control/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workerid-allocator-redis/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-action-trigger/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-aggregate/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-approval/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-cc/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-custom-action-trigger/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-date-calculation/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-delay/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-dynamic-calculation/index.md +6 -4
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-javascript/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-json-query/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-json-variable-mapping/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-loop/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-mailer/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-manual/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-notification/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-parallel/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request-interceptor/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-response-message/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-sql/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-subflow/index.md +3 -1
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-test/index.md +4 -2
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-transaction/index.md +16 -0
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-variable/index.md +5 -3
- package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-webhook/index.md +4 -2
- package/dist/ai/docs/nocobase/security/guide.md +23 -0
- package/dist/ai/docs/nocobase/shared-components/create-form-registry.md +38 -0
- package/dist/ai/docs/nocobase/shared-components/filter/collection-filter-panel.md +44 -0
- package/dist/ai/docs/nocobase/shared-components/filter/index.md +44 -0
- package/dist/ai/docs/nocobase/shared-components/form/code-scanner.md +34 -0
- package/dist/ai/docs/nocobase/shared-components/form/dialog-form-layout.md +45 -0
- package/dist/ai/docs/nocobase/shared-components/form/drawer-form-layout.md +45 -0
- package/dist/ai/docs/nocobase/shared-components/form/env-variable-input.md +30 -0
- package/dist/ai/docs/nocobase/shared-components/form/file-size-input.md +24 -0
- package/dist/ai/docs/nocobase/shared-components/form/json-text-area.md +28 -0
- package/dist/ai/docs/nocobase/shared-components/form/password-input.md +23 -0
- package/dist/ai/docs/nocobase/shared-components/form/remote-select.md +34 -0
- package/dist/ai/docs/nocobase/shared-components/form/scan-input.md +27 -0
- package/dist/ai/docs/nocobase/shared-components/form/typed-variable-input.md +30 -0
- package/dist/ai/docs/nocobase/shared-components/form/variable-input.md +35 -0
- package/dist/ai/docs/nocobase/shared-components/form/variable-json-text-area.md +33 -0
- package/dist/ai/docs/nocobase/shared-components/form/variable-text-area.md +33 -0
- package/dist/ai/docs/nocobase/shared-components/icon.md +21 -0
- package/dist/ai/docs/nocobase/shared-components/index.md +70 -0
- package/dist/ai/docs/nocobase/shared-components/table/index.md +39 -0
- package/dist/ai/docs/nocobase/shared-components/table/sort-handle.md +37 -0
- package/dist/ai/docs/nocobase/shared-components/table/sortable-row.md +36 -0
- package/dist/ai/docs/nocobase/workflow/nodes/index.md +2 -1
- package/dist/ai/docs/nocobase/workflow/nodes/transaction.md +81 -0
- package/dist/client/{406.9a530334eae8cede.js → 406.15c09d98faa2ccf1.js} +1 -1
- package/dist/client/{428.fdd0cc3cfd1632ef.js → 428.5eb4f53ddbb6a3b8.js} +1 -1
- package/dist/client/559.959c46d0056ccdc8.js +10 -0
- package/dist/client/561.7ec804ef39ec7dcd.js +10 -0
- package/dist/client/580.35ba54ff91b7fe6d.js +10 -0
- package/dist/client/{604.de96f3ec4d471afd.js → 604.89c674f35b52b4ef.js} +1 -1
- package/dist/client/{646.b0ed728921b007d4.js → 646.2e395a514c511084.js} +1 -1
- package/dist/client/ai-employees/ProfileCard.d.ts +1 -0
- package/dist/client/ai-employees/admin/mcp/schemas.d.ts +46 -18
- package/dist/client/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +2 -3
- package/dist/client/ai-employees/form-filler/tools/index.d.ts +8 -0
- package/dist/client/components/ListCollapse.d.ts +2 -1
- package/dist/client/features/components.d.ts +9 -0
- package/dist/client/features/feature-manager.d.ts +1 -9
- package/dist/client/features/index.d.ts +1 -9
- package/dist/client/features/vector-database-provider.d.ts +1 -10
- package/dist/client/features/vector-store-provider.d.ts +9 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +3 -3
- package/dist/client/llm-providers/mistral/ModelSettings.d.ts +10 -0
- package/dist/client/llm-providers/mistral/index.d.ts +10 -0
- package/dist/client/llm-providers/orcarouter/ModelSettings.d.ts +10 -0
- package/dist/client/llm-providers/orcarouter/ProviderSettings.d.ts +10 -0
- package/dist/client/llm-providers/orcarouter/index.d.ts +10 -0
- package/dist/client/llm-services/utils.d.ts +5 -0
- package/dist/client/manager/ai-feature-manager.d.ts +1 -6
- package/dist/client-v2/features/components.d.ts +14 -0
- package/dist/client-v2/features/feature-manager.d.ts +19 -0
- package/dist/client-v2/features/index.d.ts +22 -0
- package/dist/client-v2/features/vector-database-provider.d.ts +18 -0
- package/dist/client-v2/features/vector-store-provider.d.ts +38 -0
- package/dist/client-v2/index.d.ts +5 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/client-v2/manager/ai-feature-manager.d.ts +15 -0
- package/dist/collections/ai-mcp-clients.js +5 -0
- package/dist/externalVersion.js +22 -22
- package/dist/locale/en-US.json +13 -3
- package/dist/locale/zh-CN.json +13 -3
- package/dist/node_modules/@langchain/mistralai/LICENSE +21 -0
- package/dist/node_modules/@langchain/mistralai/dist/chat_models.cjs +859 -0
- package/dist/node_modules/@langchain/mistralai/dist/chat_models.d.cts +541 -0
- package/dist/node_modules/@langchain/mistralai/dist/chat_models.d.ts +541 -0
- package/dist/node_modules/@langchain/mistralai/dist/chat_models.js +857 -0
- package/dist/node_modules/@langchain/mistralai/dist/embeddings.cjs +140 -0
- package/dist/node_modules/@langchain/mistralai/dist/embeddings.d.cts +116 -0
- package/dist/node_modules/@langchain/mistralai/dist/embeddings.d.ts +116 -0
- package/dist/node_modules/@langchain/mistralai/dist/embeddings.js +139 -0
- package/dist/node_modules/@langchain/mistralai/dist/index.cjs +21 -0
- package/dist/node_modules/@langchain/mistralai/dist/index.d.cts +4 -0
- package/dist/node_modules/@langchain/mistralai/dist/index.d.ts +4 -0
- package/dist/node_modules/@langchain/mistralai/dist/index.js +5 -0
- package/dist/node_modules/@langchain/mistralai/dist/llms.cjs +275 -0
- package/dist/node_modules/@langchain/mistralai/dist/llms.d.cts +147 -0
- package/dist/node_modules/@langchain/mistralai/dist/llms.d.ts +147 -0
- package/dist/node_modules/@langchain/mistralai/dist/llms.js +274 -0
- package/dist/node_modules/@langchain/mistralai/dist/utils.cjs +61 -0
- package/dist/node_modules/@langchain/mistralai/dist/utils.js +59 -0
- package/dist/node_modules/@langchain/mistralai/package.json +1 -0
- package/dist/node_modules/@langchain/xai/dist/chat_models/completions.cjs +25 -34
- package/dist/node_modules/@langchain/xai/dist/chat_models/completions.d.cts +10 -22
- package/dist/node_modules/@langchain/xai/dist/chat_models/completions.d.ts +10 -22
- package/dist/node_modules/@langchain/xai/dist/chat_models/completions.js +17 -25
- package/dist/node_modules/@langchain/xai/dist/chat_models/index.cjs +2 -2
- package/dist/node_modules/@langchain/xai/dist/chat_models/index.d.cts +3 -0
- package/dist/node_modules/@langchain/xai/dist/chat_models/index.js +3 -2
- package/dist/node_modules/@langchain/xai/dist/chat_models/responses-types.d.cts +5 -12
- package/dist/node_modules/@langchain/xai/dist/chat_models/responses-types.d.ts +5 -12
- package/dist/node_modules/@langchain/xai/dist/chat_models/responses.cjs +18 -19
- package/dist/node_modules/@langchain/xai/dist/chat_models/responses.d.cts +1 -1
- package/dist/node_modules/@langchain/xai/dist/chat_models/responses.d.ts +1 -1
- package/dist/node_modules/@langchain/xai/dist/chat_models/responses.js +13 -13
- package/dist/node_modules/@langchain/xai/dist/converters/responses.cjs +16 -22
- package/dist/node_modules/@langchain/xai/dist/converters/responses.js +7 -12
- package/dist/node_modules/@langchain/xai/dist/index.cjs +2 -2
- package/dist/node_modules/@langchain/xai/dist/index.d.ts +0 -1
- package/dist/node_modules/@langchain/xai/dist/index.js +1 -2
- package/dist/node_modules/@langchain/xai/dist/live_search.cjs +4 -5
- package/dist/node_modules/@langchain/xai/dist/live_search.js +4 -4
- package/dist/node_modules/@langchain/xai/dist/profiles.cjs +81 -97
- package/dist/node_modules/@langchain/xai/dist/profiles.js +81 -96
- package/dist/node_modules/@langchain/xai/dist/tools/code_execution.cjs +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/code_execution.js +1 -1
- package/dist/node_modules/@langchain/xai/dist/tools/collections_search.cjs +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/collections_search.js +1 -1
- package/dist/node_modules/@langchain/xai/dist/tools/index.cjs +6 -7
- package/dist/node_modules/@langchain/xai/dist/tools/index.d.cts +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/index.d.ts +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/index.js +6 -7
- package/dist/node_modules/@langchain/xai/dist/tools/live_search.cjs +3 -7
- package/dist/node_modules/@langchain/xai/dist/tools/live_search.d.cts +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/live_search.d.ts +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/live_search.js +3 -6
- package/dist/node_modules/@langchain/xai/dist/tools/web_search.cjs +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/web_search.js +1 -1
- package/dist/node_modules/@langchain/xai/dist/tools/x_search.cjs +1 -2
- package/dist/node_modules/@langchain/xai/dist/tools/x_search.js +1 -1
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.mts +1 -1
- package/dist/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.ts +1 -1
- package/dist/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.mts +1 -1
- package/dist/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.ts +1 -1
- package/dist/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.mts +1 -1
- package/dist/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.ts +1 -1
- package/dist/node_modules/openai/api-promise.d.mts +1 -0
- package/dist/node_modules/openai/api-promise.d.ts +1 -0
- package/dist/node_modules/openai/auth/index.d.mts +4 -0
- package/dist/node_modules/openai/auth/index.d.ts +4 -0
- package/dist/node_modules/openai/auth/index.js +11 -0
- package/dist/node_modules/openai/auth/subject-token-providers.d.mts +20 -0
- package/dist/node_modules/openai/auth/subject-token-providers.d.ts +20 -0
- package/dist/node_modules/openai/auth/subject-token-providers.js +127 -0
- package/dist/node_modules/openai/auth/types.d.mts +23 -0
- package/dist/node_modules/openai/auth/types.d.ts +23 -0
- package/dist/node_modules/openai/auth/types.js +3 -0
- package/dist/node_modules/openai/auth/workload-identity-auth.d.mts +16 -0
- package/dist/node_modules/openai/auth/workload-identity-auth.d.ts +16 -0
- package/dist/node_modules/openai/auth/workload-identity-auth.js +95 -0
- package/dist/node_modules/openai/azure.d.mts +6 -2
- package/dist/node_modules/openai/azure.d.ts +6 -2
- package/dist/node_modules/openai/azure.js +4 -3
- package/dist/node_modules/openai/beta/realtime/websocket.js +7 -2
- package/dist/node_modules/openai/beta/realtime/ws.js +5 -1
- package/dist/node_modules/openai/bin/migration-config.json +1120 -0
- package/dist/node_modules/openai/client.d.mts +72 -10
- package/dist/node_modules/openai/client.d.ts +72 -10
- package/dist/node_modules/openai/client.js +207 -28
- package/dist/node_modules/openai/core/EventEmitter.d.mts +56 -0
- package/dist/node_modules/openai/core/EventEmitter.d.ts +56 -0
- package/dist/node_modules/openai/core/EventEmitter.js +93 -0
- package/dist/node_modules/openai/core/error.d.mts +15 -0
- package/dist/node_modules/openai/core/error.d.ts +15 -0
- package/dist/node_modules/openai/core/error.js +34 -1
- package/dist/node_modules/openai/core/pagination.d.mts +18 -0
- package/dist/node_modules/openai/core/pagination.d.ts +18 -0
- package/dist/node_modules/openai/core/pagination.js +32 -1
- package/dist/node_modules/openai/core/streaming.d.mts +1 -1
- package/dist/node_modules/openai/core/streaming.d.ts +1 -1
- package/dist/node_modules/openai/core/streaming.js +2 -2
- package/dist/node_modules/openai/error.d.mts +1 -0
- package/dist/node_modules/openai/error.d.ts +1 -0
- package/dist/node_modules/openai/index.d.mts +1 -1
- package/dist/node_modules/openai/index.d.ts +1 -1
- package/dist/node_modules/openai/index.js +1 -1
- package/dist/node_modules/openai/internal/parse.js +2 -2
- package/dist/node_modules/openai/internal/qs/index.d.mts +2 -2
- package/dist/node_modules/openai/internal/qs/index.d.ts +2 -2
- package/dist/node_modules/openai/internal/request-options.d.mts +5 -0
- package/dist/node_modules/openai/internal/request-options.d.ts +5 -0
- package/dist/node_modules/openai/internal/shims.d.mts +6 -0
- package/dist/node_modules/openai/internal/shims.d.ts +6 -0
- package/dist/node_modules/openai/internal/types.d.mts +17 -11
- package/dist/node_modules/openai/internal/types.d.ts +17 -11
- package/dist/node_modules/openai/internal/utils/env.js +2 -2
- package/dist/node_modules/openai/internal/utils/log.js +2 -0
- package/dist/node_modules/openai/internal/utils/query.d.mts +2 -0
- package/dist/node_modules/openai/internal/utils/query.d.ts +2 -0
- package/dist/node_modules/openai/internal/utils/query.js +10 -0
- package/dist/node_modules/openai/internal/utils.d.mts +1 -0
- package/dist/node_modules/openai/internal/utils.d.ts +1 -0
- package/dist/node_modules/openai/internal/utils.js +1 -0
- package/dist/node_modules/openai/internal/ws-adapter-browser.d.mts +34 -0
- package/dist/node_modules/openai/internal/ws-adapter-browser.d.ts +34 -0
- package/dist/node_modules/openai/internal/ws-adapter-browser.js +88 -0
- package/dist/node_modules/openai/internal/ws-adapter-node.d.mts +27 -0
- package/dist/node_modules/openai/internal/ws-adapter-node.d.ts +27 -0
- package/dist/node_modules/openai/internal/ws-adapter-node.js +90 -0
- package/dist/node_modules/openai/internal/ws-adapter.d.mts +24 -0
- package/dist/node_modules/openai/internal/ws-adapter.d.ts +24 -0
- package/dist/node_modules/openai/internal/ws-adapter.js +11 -0
- package/dist/node_modules/openai/internal/ws.d.mts +80 -0
- package/dist/node_modules/openai/internal/ws.d.ts +80 -0
- package/dist/node_modules/openai/internal/ws.js +153 -0
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/openai/pagination.d.mts +1 -0
- package/dist/node_modules/openai/pagination.d.ts +1 -0
- package/dist/node_modules/openai/realtime/websocket.js +7 -2
- package/dist/node_modules/openai/realtime/ws.js +5 -1
- package/dist/node_modules/openai/resource.d.mts +1 -0
- package/dist/node_modules/openai/resource.d.ts +1 -0
- package/dist/node_modules/openai/resources/admin/admin.d.mts +10 -0
- package/dist/node_modules/openai/resources/admin/admin.d.ts +10 -0
- package/dist/node_modules/openai/resources/admin/admin.js +17 -0
- package/dist/node_modules/openai/resources/admin/index.d.mts +3 -0
- package/dist/node_modules/openai/resources/admin/index.d.ts +3 -0
- package/dist/node_modules/openai/resources/admin/index.js +9 -0
- package/dist/node_modules/openai/resources/admin/organization/admin-api-keys.d.mts +140 -0
- package/dist/node_modules/openai/resources/admin/organization/admin-api-keys.d.ts +140 -0
- package/dist/node_modules/openai/resources/admin/organization/admin-api-keys.js +81 -0
- package/dist/node_modules/openai/resources/admin/organization/audit-logs.d.mts +1267 -0
- package/dist/node_modules/openai/resources/admin/organization/audit-logs.d.ts +1267 -0
- package/dist/node_modules/openai/resources/admin/organization/audit-logs.js +31 -0
- package/dist/node_modules/openai/resources/admin/organization/certificates.d.mts +322 -0
- package/dist/node_modules/openai/resources/admin/organization/certificates.d.ts +322 -0
- package/dist/node_modules/openai/resources/admin/organization/certificates.js +144 -0
- package/dist/node_modules/openai/resources/admin/organization/data-retention.d.mts +50 -0
- package/dist/node_modules/openai/resources/admin/organization/data-retention.d.ts +50 -0
- package/dist/node_modules/openai/resources/admin/organization/data-retention.js +42 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/groups.d.mts +160 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/groups.d.ts +160 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/groups.js +109 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/index.d.mts +4 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/index.d.ts +4 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/index.js +11 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/roles.d.mts +275 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/roles.d.ts +275 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/roles.js +84 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/users.d.mts +164 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/users.d.ts +164 -0
- package/dist/node_modules/openai/resources/admin/organization/groups/users.js +84 -0
- package/dist/node_modules/openai/resources/admin/organization/groups.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/groups.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/groups.js +6 -0
- package/dist/node_modules/openai/resources/admin/organization/index.d.mts +13 -0
- package/dist/node_modules/openai/resources/admin/organization/index.d.ts +13 -0
- package/dist/node_modules/openai/resources/admin/organization/index.js +29 -0
- package/dist/node_modules/openai/resources/admin/organization/invites.d.mts +153 -0
- package/dist/node_modules/openai/resources/admin/organization/invites.d.ts +153 -0
- package/dist/node_modules/openai/resources/admin/organization/invites.js +83 -0
- package/dist/node_modules/openai/resources/admin/organization/organization.d.mts +50 -0
- package/dist/node_modules/openai/resources/admin/organization/organization.d.ts +50 -0
- package/dist/node_modules/openai/resources/admin/organization/organization.js +57 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/api-keys.d.mts +167 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/api-keys.d.ts +167 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/api-keys.js +68 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/certificates.d.mts +186 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/certificates.d.ts +186 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/certificates.js +64 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/data-retention.d.mts +53 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/data-retention.d.ts +53 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/data-retention.js +46 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/groups.d.mts +142 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/groups.d.ts +142 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/groups.js +93 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/index.d.mts +3 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/index.d.ts +3 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/index.js +9 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/roles.d.mts +292 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/roles.d.ts +292 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups/roles.js +87 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/groups.js +6 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.d.mts +174 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.d.ts +174 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +45 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/index.d.mts +13 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/index.d.ts +13 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/index.js +29 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/model-permissions.d.mts +86 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/model-permissions.d.ts +86 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/model-permissions.js +63 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/projects.d.mts +188 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/projects.d.ts +188 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/projects.js +149 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/rate-limits.d.mts +120 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/rate-limits.d.ts +120 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/rate-limits.js +47 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/roles.d.mts +146 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/roles.d.ts +146 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/roles.js +108 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/service-accounts.d.mts +168 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/service-accounts.d.ts +168 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/service-accounts.js +101 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/spend-alerts.d.mts +241 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/spend-alerts.d.ts +241 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +102 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/index.d.mts +3 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/index.d.ts +3 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/index.js +9 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/roles.d.mts +266 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/roles.d.ts +266 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/roles.js +87 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/users.d.mts +157 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/users.d.ts +157 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users/users.js +116 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/projects/users.js +6 -0
- package/dist/node_modules/openai/resources/admin/organization/projects.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/projects.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/projects.js +6 -0
- package/dist/node_modules/openai/resources/admin/organization/roles.d.mts +153 -0
- package/dist/node_modules/openai/resources/admin/organization/roles.d.ts +153 -0
- package/dist/node_modules/openai/resources/admin/organization/roles.js +96 -0
- package/dist/node_modules/openai/resources/admin/organization/spend-alerts.d.mts +224 -0
- package/dist/node_modules/openai/resources/admin/organization/spend-alerts.d.ts +224 -0
- package/dist/node_modules/openai/resources/admin/organization/spend-alerts.js +93 -0
- package/dist/node_modules/openai/resources/admin/organization/usage.d.mts +5123 -0
- package/dist/node_modules/openai/resources/admin/organization/usage.d.ts +5123 -0
- package/dist/node_modules/openai/resources/admin/organization/usage.js +207 -0
- package/dist/node_modules/openai/resources/admin/organization/users/index.d.mts +3 -0
- package/dist/node_modules/openai/resources/admin/organization/users/index.d.ts +3 -0
- package/dist/node_modules/openai/resources/admin/organization/users/index.js +9 -0
- package/dist/node_modules/openai/resources/admin/organization/users/roles.d.mts +249 -0
- package/dist/node_modules/openai/resources/admin/organization/users/roles.d.ts +249 -0
- package/dist/node_modules/openai/resources/admin/organization/users/roles.js +84 -0
- package/dist/node_modules/openai/resources/admin/organization/users/users.d.mts +185 -0
- package/dist/node_modules/openai/resources/admin/organization/users/users.d.ts +185 -0
- package/dist/node_modules/openai/resources/admin/organization/users/users.js +84 -0
- package/dist/node_modules/openai/resources/admin/organization/users.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/users.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin/organization/users.js +6 -0
- package/dist/node_modules/openai/resources/admin/organization.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin/organization.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin/organization.js +6 -0
- package/dist/node_modules/openai/resources/admin.d.mts +2 -0
- package/dist/node_modules/openai/resources/admin.d.ts +2 -0
- package/dist/node_modules/openai/resources/admin.js +6 -0
- package/dist/node_modules/openai/resources/audio/speech.d.mts +22 -5
- package/dist/node_modules/openai/resources/audio/speech.d.ts +22 -5
- package/dist/node_modules/openai/resources/audio/speech.js +8 -2
- package/dist/node_modules/openai/resources/audio/transcriptions.d.mts +6 -0
- package/dist/node_modules/openai/resources/audio/transcriptions.d.ts +6 -0
- package/dist/node_modules/openai/resources/audio/transcriptions.js +4 -0
- package/dist/node_modules/openai/resources/audio/translations.d.mts +3 -0
- package/dist/node_modules/openai/resources/audio/translations.d.ts +3 -0
- package/dist/node_modules/openai/resources/audio/translations.js +4 -1
- package/dist/node_modules/openai/resources/batches.d.mts +8 -4
- package/dist/node_modules/openai/resources/batches.d.ts +8 -4
- package/dist/node_modules/openai/resources/batches.js +14 -4
- package/dist/node_modules/openai/resources/beta/assistants.d.mts +6 -2
- package/dist/node_modules/openai/resources/beta/assistants.d.ts +6 -2
- package/dist/node_modules/openai/resources/beta/assistants.js +8 -0
- package/dist/node_modules/openai/resources/beta/chatkit/sessions.d.mts +4 -2
- package/dist/node_modules/openai/resources/beta/chatkit/sessions.d.ts +4 -2
- package/dist/node_modules/openai/resources/beta/chatkit/sessions.js +6 -2
- package/dist/node_modules/openai/resources/beta/chatkit/threads.d.mts +4 -4
- package/dist/node_modules/openai/resources/beta/chatkit/threads.d.ts +4 -4
- package/dist/node_modules/openai/resources/beta/chatkit/threads.js +13 -5
- package/dist/node_modules/openai/resources/beta/realtime/sessions.js +1 -0
- package/dist/node_modules/openai/resources/beta/realtime/transcription-sessions.js +1 -0
- package/dist/node_modules/openai/resources/beta/threads/messages.d.mts +2 -0
- package/dist/node_modules/openai/resources/beta/threads/messages.d.ts +2 -0
- package/dist/node_modules/openai/resources/beta/threads/messages.js +7 -0
- package/dist/node_modules/openai/resources/beta/threads/runs/runs.d.mts +2 -0
- package/dist/node_modules/openai/resources/beta/threads/runs/runs.d.ts +2 -0
- package/dist/node_modules/openai/resources/beta/threads/runs/runs.js +10 -0
- package/dist/node_modules/openai/resources/beta/threads/runs/steps.d.mts +2 -0
- package/dist/node_modules/openai/resources/beta/threads/runs/steps.d.ts +2 -0
- package/dist/node_modules/openai/resources/beta/threads/runs/steps.js +4 -0
- package/dist/node_modules/openai/resources/beta/threads/threads.d.mts +8 -4
- package/dist/node_modules/openai/resources/beta/threads/threads.d.ts +8 -4
- package/dist/node_modules/openai/resources/beta/threads/threads.js +8 -0
- package/dist/node_modules/openai/resources/chat/completions/completions.d.mts +37 -18
- package/dist/node_modules/openai/resources/chat/completions/completions.d.ts +37 -18
- package/dist/node_modules/openai/resources/chat/completions/completions.js +27 -5
- package/dist/node_modules/openai/resources/chat/completions/messages.d.mts +3 -0
- package/dist/node_modules/openai/resources/chat/completions/messages.d.ts +3 -0
- package/dist/node_modules/openai/resources/chat/completions/messages.js +4 -1
- package/dist/node_modules/openai/resources/completions.d.mts +9 -3
- package/dist/node_modules/openai/resources/completions.d.ts +9 -3
- package/dist/node_modules/openai/resources/completions.js +9 -1
- package/dist/node_modules/openai/resources/containers/containers.js +11 -3
- package/dist/node_modules/openai/resources/containers/files/content.js +1 -0
- package/dist/node_modules/openai/resources/containers/files/files.js +7 -2
- package/dist/node_modules/openai/resources/conversations/conversations.d.mts +15 -0
- package/dist/node_modules/openai/resources/conversations/conversations.d.ts +15 -0
- package/dist/node_modules/openai/resources/conversations/conversations.js +17 -4
- package/dist/node_modules/openai/resources/conversations/items.d.mts +4 -1
- package/dist/node_modules/openai/resources/conversations/items.d.ts +4 -1
- package/dist/node_modules/openai/resources/conversations/items.js +14 -3
- package/dist/node_modules/openai/resources/embeddings.d.mts +3 -0
- package/dist/node_modules/openai/resources/embeddings.d.ts +3 -0
- package/dist/node_modules/openai/resources/embeddings.js +4 -0
- package/dist/node_modules/openai/resources/evals/evals.d.mts +3 -0
- package/dist/node_modules/openai/resources/evals/evals.d.ts +3 -0
- package/dist/node_modules/openai/resources/evals/evals.js +12 -5
- package/dist/node_modules/openai/resources/evals/runs/output-items.d.mts +3 -0
- package/dist/node_modules/openai/resources/evals/runs/output-items.d.ts +3 -0
- package/dist/node_modules/openai/resources/evals/runs/output-items.js +8 -2
- package/dist/node_modules/openai/resources/evals/runs/runs.d.mts +3 -0
- package/dist/node_modules/openai/resources/evals/runs/runs.d.ts +3 -0
- package/dist/node_modules/openai/resources/evals/runs/runs.js +21 -4
- package/dist/node_modules/openai/resources/files.d.mts +11 -1
- package/dist/node_modules/openai/resources/files.d.ts +11 -1
- package/dist/node_modules/openai/resources/files.js +20 -5
- package/dist/node_modules/openai/resources/fine-tuning/alpha/graders.d.mts +3 -0
- package/dist/node_modules/openai/resources/fine-tuning/alpha/graders.d.ts +3 -0
- package/dist/node_modules/openai/resources/fine-tuning/alpha/graders.js +13 -2
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.d.mts +2 -2
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.d.ts +2 -2
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/index.d.mts +1 -1
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/index.d.ts +1 -1
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/permissions.d.mts +54 -7
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/permissions.d.ts +54 -7
- package/dist/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +26 -9
- package/dist/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.mts +3 -0
- package/dist/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts +3 -0
- package/dist/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +4 -1
- package/dist/node_modules/openai/resources/fine-tuning/jobs/jobs.d.mts +3 -0
- package/dist/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts +3 -0
- package/dist/node_modules/openai/resources/fine-tuning/jobs/jobs.js +26 -7
- package/dist/node_modules/openai/resources/images.d.mts +56 -24
- package/dist/node_modules/openai/resources/images.d.ts +56 -24
- package/dist/node_modules/openai/resources/images.js +11 -3
- package/dist/node_modules/openai/resources/index.d.mts +2 -1
- package/dist/node_modules/openai/resources/index.d.ts +2 -1
- package/dist/node_modules/openai/resources/index.js +3 -1
- package/dist/node_modules/openai/resources/models.d.mts +3 -0
- package/dist/node_modules/openai/resources/models.d.ts +3 -0
- package/dist/node_modules/openai/resources/models.js +6 -3
- package/dist/node_modules/openai/resources/moderations.d.mts +3 -0
- package/dist/node_modules/openai/resources/moderations.d.ts +3 -0
- package/dist/node_modules/openai/resources/moderations.js +4 -1
- package/dist/node_modules/openai/resources/realtime/calls.d.mts +13 -3
- package/dist/node_modules/openai/resources/realtime/calls.d.ts +13 -3
- package/dist/node_modules/openai/resources/realtime/calls.js +4 -0
- package/dist/node_modules/openai/resources/realtime/client-secrets.d.mts +45 -39
- package/dist/node_modules/openai/resources/realtime/client-secrets.d.ts +45 -39
- package/dist/node_modules/openai/resources/realtime/client-secrets.js +19 -1
- package/dist/node_modules/openai/resources/realtime/index.d.mts +1 -1
- package/dist/node_modules/openai/resources/realtime/index.d.ts +1 -1
- package/dist/node_modules/openai/resources/realtime/realtime.d.mts +592 -21
- package/dist/node_modules/openai/resources/realtime/realtime.d.ts +592 -21
- package/dist/node_modules/openai/resources/responses/index.d.mts +2 -0
- package/dist/node_modules/openai/resources/responses/index.d.ts +2 -0
- package/dist/node_modules/openai/resources/responses/input-items.js +1 -1
- package/dist/node_modules/openai/resources/responses/input-tokens.d.mts +4 -1
- package/dist/node_modules/openai/resources/responses/input-tokens.d.ts +4 -1
- package/dist/node_modules/openai/resources/responses/input-tokens.js +9 -2
- package/dist/node_modules/openai/resources/responses/internal-base.d.mts +71 -0
- package/dist/node_modules/openai/resources/responses/internal-base.d.ts +71 -0
- package/dist/node_modules/openai/resources/responses/internal-base.js +48 -0
- package/dist/node_modules/openai/resources/responses/responses.d.mts +956 -64
- package/dist/node_modules/openai/resources/responses/responses.d.ts +956 -64
- package/dist/node_modules/openai/resources/responses/responses.js +20 -5
- package/dist/node_modules/openai/resources/responses/ws-base.d.mts +106 -0
- package/dist/node_modules/openai/resources/responses/ws-base.d.ts +106 -0
- package/dist/node_modules/openai/resources/responses/ws-base.js +476 -0
- package/dist/node_modules/openai/resources/responses/ws.d.mts +13 -0
- package/dist/node_modules/openai/resources/responses/ws.d.ts +13 -0
- package/dist/node_modules/openai/resources/responses/ws.js +31 -0
- package/dist/node_modules/openai/resources/shared.d.mts +3 -2
- package/dist/node_modules/openai/resources/shared.d.ts +3 -2
- package/dist/node_modules/openai/resources/skills/content.d.mts +1 -1
- package/dist/node_modules/openai/resources/skills/content.d.ts +1 -1
- package/dist/node_modules/openai/resources/skills/content.js +2 -1
- package/dist/node_modules/openai/resources/skills/skills.d.mts +5 -5
- package/dist/node_modules/openai/resources/skills/skills.d.ts +5 -5
- package/dist/node_modules/openai/resources/skills/skills.js +18 -10
- package/dist/node_modules/openai/resources/skills/versions/content.d.mts +1 -1
- package/dist/node_modules/openai/resources/skills/versions/content.d.ts +1 -1
- package/dist/node_modules/openai/resources/skills/versions/content.js +2 -1
- package/dist/node_modules/openai/resources/skills/versions/versions.d.mts +4 -4
- package/dist/node_modules/openai/resources/skills/versions/versions.d.ts +4 -4
- package/dist/node_modules/openai/resources/skills/versions/versions.js +14 -7
- package/dist/node_modules/openai/resources/uploads/parts.d.mts +3 -0
- package/dist/node_modules/openai/resources/uploads/parts.d.ts +3 -0
- package/dist/node_modules/openai/resources/uploads/parts.js +4 -1
- package/dist/node_modules/openai/resources/uploads/uploads.d.mts +10 -1
- package/dist/node_modules/openai/resources/uploads/uploads.d.ts +10 -1
- package/dist/node_modules/openai/resources/uploads/uploads.js +20 -4
- package/dist/node_modules/openai/resources/vector-stores/file-batches.d.mts +9 -3
- package/dist/node_modules/openai/resources/vector-stores/file-batches.d.ts +9 -3
- package/dist/node_modules/openai/resources/vector-stores/file-batches.js +9 -1
- package/dist/node_modules/openai/resources/vector-stores/files.d.mts +3 -1
- package/dist/node_modules/openai/resources/vector-stores/files.d.ts +3 -1
- package/dist/node_modules/openai/resources/vector-stores/files.js +10 -1
- package/dist/node_modules/openai/resources/vector-stores/vector-stores.js +6 -0
- package/dist/node_modules/openai/resources/videos.d.mts +123 -11
- package/dist/node_modules/openai/resources/videos.d.ts +123 -11
- package/dist/node_modules/openai/resources/videos.js +46 -11
- package/dist/node_modules/openai/src/auth/index.ts +9 -0
- package/dist/node_modules/openai/src/auth/subject-token-providers.ts +185 -0
- package/dist/node_modules/openai/src/auth/types.ts +28 -0
- package/dist/node_modules/openai/src/auth/workload-identity-auth.ts +122 -0
- package/dist/node_modules/openai/src/azure.ts +9 -4
- package/dist/node_modules/openai/src/beta/realtime/websocket.ts +7 -2
- package/dist/node_modules/openai/src/beta/realtime/ws.ts +5 -1
- package/dist/node_modules/openai/src/client.ts +312 -35
- package/dist/node_modules/openai/src/core/EventEmitter.ts +114 -0
- package/dist/node_modules/openai/src/core/error.ts +40 -0
- package/dist/node_modules/openai/src/core/pagination.ts +62 -0
- package/dist/node_modules/openai/src/core/streaming.ts +2 -1
- package/dist/node_modules/openai/src/index.ts +2 -0
- package/dist/node_modules/openai/src/internal/parse.ts +12 -2
- package/dist/node_modules/openai/src/internal/request-options.ts +2 -0
- package/dist/node_modules/openai/src/internal/types.ts +14 -8
- package/dist/node_modules/openai/src/internal/utils/env.ts +2 -2
- package/dist/node_modules/openai/src/internal/utils/log.ts +2 -0
- package/dist/node_modules/openai/src/internal/utils/query.ts +7 -0
- package/dist/node_modules/openai/src/internal/utils.ts +1 -0
- package/dist/node_modules/openai/src/internal/ws-adapter-browser.ts +123 -0
- package/dist/node_modules/openai/src/internal/ws-adapter-node.ts +105 -0
- package/dist/node_modules/openai/src/internal/ws-adapter.ts +30 -0
- package/dist/node_modules/openai/src/internal/ws.ts +193 -0
- package/dist/node_modules/openai/src/realtime/websocket.ts +7 -2
- package/dist/node_modules/openai/src/realtime/ws.ts +5 -1
- package/dist/node_modules/openai/src/resources/admin/admin.ts +15 -0
- package/dist/node_modules/openai/src/resources/admin/index.ts +4 -0
- package/dist/node_modules/openai/src/resources/admin/organization/admin-api-keys.ts +199 -0
- package/dist/node_modules/openai/src/resources/admin/organization/audit-logs.ts +1597 -0
- package/dist/node_modules/openai/src/resources/admin/organization/certificates.ts +458 -0
- package/dist/node_modules/openai/src/resources/admin/organization/data-retention.ts +79 -0
- package/dist/node_modules/openai/src/resources/admin/organization/groups/groups.ts +277 -0
- package/dist/node_modules/openai/src/resources/admin/organization/groups/index.ts +36 -0
- package/dist/node_modules/openai/src/resources/admin/organization/groups/roles.ts +359 -0
- package/dist/node_modules/openai/src/resources/admin/organization/groups/users.ts +232 -0
- package/dist/node_modules/openai/src/resources/admin/organization/groups.ts +3 -0
- package/dist/node_modules/openai/src/resources/admin/organization/index.ts +117 -0
- package/dist/node_modules/openai/src/resources/admin/organization/invites.ts +215 -0
- package/dist/node_modules/openai/src/resources/admin/organization/organization.ts +272 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/api-keys.ts +239 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/certificates.ts +269 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/data-retention.ts +91 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/groups/groups.ts +231 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/groups/index.ts +24 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/groups/roles.ts +386 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/groups.ts +3 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/hosted-tool-permissions.ts +217 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/index.ts +102 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/model-permissions.ts +123 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/projects.ts +445 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/rate-limits.ts +173 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/roles.ts +210 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/service-accounts.ts +266 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/spend-alerts.ts +332 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/users/index.ts +25 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/users/roles.ts +351 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/users/users.ts +256 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects/users.ts +3 -0
- package/dist/node_modules/openai/src/resources/admin/organization/projects.ts +3 -0
- package/dist/node_modules/openai/src/resources/admin/organization/roles.ts +217 -0
- package/dist/node_modules/openai/src/resources/admin/organization/spend-alerts.ts +301 -0
- package/dist/node_modules/openai/src/resources/admin/organization/usage.ts +6427 -0
- package/dist/node_modules/openai/src/resources/admin/organization/users/index.ts +22 -0
- package/dist/node_modules/openai/src/resources/admin/organization/users/roles.ts +328 -0
- package/dist/node_modules/openai/src/resources/admin/organization/users/users.ts +291 -0
- package/dist/node_modules/openai/src/resources/admin/organization/users.ts +3 -0
- package/dist/node_modules/openai/src/resources/admin/organization.ts +3 -0
- package/dist/node_modules/openai/src/resources/admin.ts +3 -0
- package/dist/node_modules/openai/src/resources/audio/speech.ts +26 -6
- package/dist/node_modules/openai/src/resources/audio/transcriptions.ts +7 -0
- package/dist/node_modules/openai/src/resources/audio/translations.ts +7 -1
- package/dist/node_modules/openai/src/resources/batches.ts +20 -8
- package/dist/node_modules/openai/src/resources/beta/assistants.ts +11 -2
- package/dist/node_modules/openai/src/resources/beta/chatkit/sessions.ts +6 -2
- package/dist/node_modules/openai/src/resources/beta/chatkit/threads.ts +13 -5
- package/dist/node_modules/openai/src/resources/beta/realtime/sessions.ts +1 -0
- package/dist/node_modules/openai/src/resources/beta/realtime/transcription-sessions.ts +1 -0
- package/dist/node_modules/openai/src/resources/beta/threads/messages.ts +7 -0
- package/dist/node_modules/openai/src/resources/beta/threads/runs/runs.ts +10 -0
- package/dist/node_modules/openai/src/resources/beta/threads/runs/steps.ts +4 -0
- package/dist/node_modules/openai/src/resources/beta/threads/threads.ts +14 -4
- package/dist/node_modules/openai/src/resources/chat/completions/completions.ts +64 -27
- package/dist/node_modules/openai/src/resources/chat/completions/messages.ts +4 -1
- package/dist/node_modules/openai/src/resources/completions.ts +15 -6
- package/dist/node_modules/openai/src/resources/containers/containers.ts +11 -3
- package/dist/node_modules/openai/src/resources/containers/files/content.ts +1 -0
- package/dist/node_modules/openai/src/resources/containers/files/files.ts +7 -2
- package/dist/node_modules/openai/src/resources/conversations/conversations.ts +31 -4
- package/dist/node_modules/openai/src/resources/conversations/items.ts +17 -3
- package/dist/node_modules/openai/src/resources/embeddings.ts +4 -0
- package/dist/node_modules/openai/src/resources/evals/evals.ts +12 -5
- package/dist/node_modules/openai/src/resources/evals/runs/output-items.ts +8 -2
- package/dist/node_modules/openai/src/resources/evals/runs/runs.ts +21 -4
- package/dist/node_modules/openai/src/resources/files.ts +23 -5
- package/dist/node_modules/openai/src/resources/fine-tuning/alpha/graders.ts +13 -2
- package/dist/node_modules/openai/src/resources/fine-tuning/checkpoints/checkpoints.ts +6 -0
- package/dist/node_modules/openai/src/resources/fine-tuning/checkpoints/index.ts +3 -0
- package/dist/node_modules/openai/src/resources/fine-tuning/checkpoints/permissions.ts +84 -10
- package/dist/node_modules/openai/src/resources/fine-tuning/jobs/checkpoints.ts +4 -1
- package/dist/node_modules/openai/src/resources/fine-tuning/jobs/jobs.ts +26 -7
- package/dist/node_modules/openai/src/resources/images.ts +74 -27
- package/dist/node_modules/openai/src/resources/index.ts +7 -0
- package/dist/node_modules/openai/src/resources/models.ts +6 -3
- package/dist/node_modules/openai/src/resources/moderations.ts +4 -1
- package/dist/node_modules/openai/src/resources/realtime/calls.ts +21 -2
- package/dist/node_modules/openai/src/resources/realtime/client-secrets.ts +54 -40
- package/dist/node_modules/openai/src/resources/realtime/index.ts +0 -1
- package/dist/node_modules/openai/src/resources/realtime/realtime.ts +705 -20
- package/dist/node_modules/openai/src/resources/responses/index.ts +2 -0
- package/dist/node_modules/openai/src/resources/responses/input-items.ts +1 -1
- package/dist/node_modules/openai/src/resources/responses/input-tokens.ts +9 -2
- package/dist/node_modules/openai/src/resources/responses/internal-base.ts +113 -0
- package/dist/node_modules/openai/src/resources/responses/responses.ts +1314 -143
- package/dist/node_modules/openai/src/resources/responses/ws-base.ts +611 -0
- package/dist/node_modules/openai/src/resources/responses/ws.ts +38 -0
- package/dist/node_modules/openai/src/resources/shared.ts +9 -1
- package/dist/node_modules/openai/src/resources/skills/content.ts +2 -1
- package/dist/node_modules/openai/src/resources/skills/skills.ts +21 -10
- package/dist/node_modules/openai/src/resources/skills/versions/content.ts +2 -1
- package/dist/node_modules/openai/src/resources/skills/versions/versions.ts +14 -7
- package/dist/node_modules/openai/src/resources/uploads/parts.ts +4 -1
- package/dist/node_modules/openai/src/resources/uploads/uploads.ts +20 -4
- package/dist/node_modules/openai/src/resources/vector-stores/file-batches.ts +18 -4
- package/dist/node_modules/openai/src/resources/vector-stores/files.ts +13 -2
- package/dist/node_modules/openai/src/resources/vector-stores/vector-stores.ts +6 -0
- package/dist/node_modules/openai/src/resources/videos.ts +186 -16
- package/dist/node_modules/openai/src/version.ts +1 -1
- package/dist/node_modules/openai/streaming.d.mts +1 -0
- package/dist/node_modules/openai/streaming.d.ts +1 -0
- package/dist/node_modules/openai/uploads.d.mts +1 -0
- package/dist/node_modules/openai/uploads.d.ts +1 -0
- package/dist/node_modules/openai/version.d.mts +1 -1
- package/dist/node_modules/openai/version.d.ts +1 -1
- package/dist/node_modules/openai/version.js +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-employee.d.ts +1 -10
- package/dist/server/ai-employees/ai-employee.js +27 -93
- package/dist/server/ai-employees/ai-knowledge-base.d.ts +0 -4
- package/dist/server/ai-employees/ai-knowledge-base.js +25 -89
- package/dist/server/ai-employees/checkpoints/cleaner.d.ts +2 -0
- package/dist/server/ai-employees/checkpoints/cleaner.js +11 -1
- package/dist/server/ai-employees/middleware/conversation.d.ts +2 -0
- package/dist/server/ai-employees/middleware/conversation.js +2 -1
- package/dist/server/ai-employees/middleware/index.d.ts +1 -0
- package/dist/server/ai-employees/middleware/index.js +2 -0
- package/dist/server/ai-employees/middleware/tool-call-sanitizer.d.ts +16 -0
- package/dist/server/ai-employees/middleware/tool-call-sanitizer.js +90 -0
- package/dist/server/ai-employees/tool-call-sanitizer.d.ts +26 -0
- package/dist/server/ai-employees/tool-call-sanitizer.js +84 -0
- package/dist/server/ai-employees/utils.d.ts +3 -1
- package/dist/server/ai-employees/utils.js +16 -2
- package/dist/server/collections/ai-usage-events.d.ts +10 -0
- package/dist/server/collections/ai-usage-events.js +183 -0
- package/dist/server/collections/lc-checkpoint-blobs.js +1 -1
- package/dist/server/collections/lc-checkpoint-writes.js +1 -1
- package/dist/server/collections/lc-checkpoints.js +1 -1
- package/dist/server/features/feature-manager.d.ts +2 -2
- package/dist/server/features/index.d.ts +1 -1
- package/dist/server/features/knowledge-base.d.ts +2 -1
- package/dist/server/features/vector-store-provider.d.ts +2 -9
- package/dist/server/llm-providers/dashscope.js +2 -2
- package/dist/server/llm-providers/kimi/provider.js +2 -2
- package/dist/server/llm-providers/mimo.js +2 -2
- package/dist/server/llm-providers/mistral.d.ts +62 -0
- package/dist/server/llm-providers/mistral.js +265 -0
- package/dist/server/llm-providers/openai/completions.js +2 -2
- package/dist/server/llm-providers/openai/responses.js +8 -4
- package/dist/server/llm-providers/orcarouter.d.ts +35 -0
- package/dist/server/llm-providers/orcarouter.js +155 -0
- package/dist/server/llm-providers/provider.d.ts +8 -4
- package/dist/server/llm-providers/provider.js +28 -14
- package/dist/server/manager/ai-chat-conversation.js +2 -0
- package/dist/server/manager/ai-usage-events.d.ts +49 -0
- package/dist/server/manager/ai-usage-events.js +195 -0
- package/dist/server/plugin.d.ts +3 -0
- package/dist/server/plugin.js +65 -0
- package/dist/server/resource/aiConversations.js +1 -1
- package/dist/server/resource/aiMcpClients.js +2 -2
- package/dist/server/resource/aiTools.js +14 -9
- package/dist/server/types/knowledge-base.type.d.ts +15 -1
- package/dist/server/workflow/nodes/employee/index.js +92 -46
- package/dist/server/workflow/nodes/employee/tools.js +8 -1
- package/dist/server/workflow/nodes/llm/index.js +3 -0
- package/package.json +15 -13
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base.md +0 -82
- package/dist/client/559.a0f2f1cc2be3c039.js +0 -10
- package/dist/client/561.776886c5308e3c26.js +0 -10
- package/dist/client/580.e75f97fb883ad042.js +0 -10
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/cli-design/nb-app-design-intent.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/cli-design/nb-proxy-design-intent.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/installation/airgap.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/installation/docker-compose.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/operations/backup-restore.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/operations/manage-app.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/operations/multi-environment.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/plugins/third-party.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/production/autostart.md +0 -0
- /package/dist/ai/docs/nocobase/{quickstart → nocobase-cli}/release-management.md +0 -0
- /package/dist/node_modules/@langchain/{xai → mistralai}/dist/_virtual/rolldown_runtime.cjs +0 -0
|
@@ -0,0 +1,857 @@
|
|
|
1
|
+
import { _convertToolCallIdToMistralCompatible, _mistralContentChunkToMessageContentComplex } from "./utils.js";
|
|
2
|
+
import { v4 } from "uuid";
|
|
3
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
4
|
+
import { HTTPClient } from "@mistralai/mistralai/lib/http.js";
|
|
5
|
+
import { AIMessage, AIMessageChunk, ChatMessageChunk, FunctionMessageChunk, HumanMessage, HumanMessageChunk, ToolMessageChunk, isAIMessage } from "@langchain/core/messages";
|
|
6
|
+
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
7
|
+
import { ChatGenerationChunk } from "@langchain/core/outputs";
|
|
8
|
+
import { AsyncCaller } from "@langchain/core/utils/async_caller";
|
|
9
|
+
import { getEnvironmentVariable } from "@langchain/core/utils/env";
|
|
10
|
+
import { JsonOutputParser, StructuredOutputParser } from "@langchain/core/output_parsers";
|
|
11
|
+
import { JsonOutputKeyToolsParser, convertLangChainToolCallToOpenAI, makeInvalidToolCall, parseToolCall } from "@langchain/core/output_parsers/openai_tools";
|
|
12
|
+
import { RunnableBinding, RunnablePassthrough, RunnableSequence } from "@langchain/core/runnables";
|
|
13
|
+
import { toJsonSchema } from "@langchain/core/utils/json_schema";
|
|
14
|
+
import { isLangChainTool } from "@langchain/core/utils/function_calling";
|
|
15
|
+
import { isInteropZodSchema } from "@langchain/core/utils/types";
|
|
16
|
+
|
|
17
|
+
//#region src/chat_models.ts
|
|
18
|
+
function convertMessagesToMistralMessages(messages) {
|
|
19
|
+
const getRole = (role) => {
|
|
20
|
+
switch (role) {
|
|
21
|
+
case "human": return "user";
|
|
22
|
+
case "ai": return "assistant";
|
|
23
|
+
case "system": return "system";
|
|
24
|
+
case "tool": return "tool";
|
|
25
|
+
case "function": return "assistant";
|
|
26
|
+
default: throw new Error(`Unknown message type: ${role}`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getContent = (content, type) => {
|
|
30
|
+
const _generateContentChunk = (complex, role) => {
|
|
31
|
+
if (complex.type === "image_url" && (role === "user" || role === "assistant")) return {
|
|
32
|
+
type: complex.type,
|
|
33
|
+
imageUrl: complex?.image_url
|
|
34
|
+
};
|
|
35
|
+
if (complex.type === "text") return {
|
|
36
|
+
type: complex.type,
|
|
37
|
+
text: complex?.text
|
|
38
|
+
};
|
|
39
|
+
throw new Error(`ChatMistralAI only supports messages of "image_url" for roles "user" and "assistant", and "text" for all others.\n\nReceived: ${JSON.stringify(content, null, 2)}`);
|
|
40
|
+
};
|
|
41
|
+
if (typeof content === "string") return content;
|
|
42
|
+
if (Array.isArray(content)) {
|
|
43
|
+
const mistralRole = getRole(type);
|
|
44
|
+
const newContent = [];
|
|
45
|
+
content.forEach((messageContentComplex) => {
|
|
46
|
+
if (messageContentComplex.type === "text" || messageContentComplex.type === "image_url") newContent.push(_generateContentChunk(messageContentComplex, mistralRole));
|
|
47
|
+
else throw new Error(`Mistral only supports types "text" or "image_url" for complex message types.`);
|
|
48
|
+
});
|
|
49
|
+
return newContent;
|
|
50
|
+
}
|
|
51
|
+
throw new Error(`Message content must be a string or an array.\n\nReceived: ${JSON.stringify(content, null, 2)}`);
|
|
52
|
+
};
|
|
53
|
+
const getTools = (message) => {
|
|
54
|
+
if (isAIMessage(message) && !!message.tool_calls?.length) return message.tool_calls.map((toolCall) => ({
|
|
55
|
+
...toolCall,
|
|
56
|
+
id: _convertToolCallIdToMistralCompatible(toolCall.id ?? "")
|
|
57
|
+
})).map(convertLangChainToolCallToOpenAI);
|
|
58
|
+
return void 0;
|
|
59
|
+
};
|
|
60
|
+
const toolResponseIds = /* @__PURE__ */ new Set();
|
|
61
|
+
for (const m of messages) if ("tool_call_id" in m && typeof m.tool_call_id === "string") toolResponseIds.add(_convertToolCallIdToMistralCompatible(m.tool_call_id));
|
|
62
|
+
return messages.flatMap((message) => {
|
|
63
|
+
const toolCalls = getTools(message);
|
|
64
|
+
const content = getContent(message.content, message.getType());
|
|
65
|
+
if ("tool_call_id" in message && typeof message.tool_call_id === "string") return [{
|
|
66
|
+
role: getRole(message.getType()),
|
|
67
|
+
content,
|
|
68
|
+
name: message.name,
|
|
69
|
+
toolCallId: _convertToolCallIdToMistralCompatible(message.tool_call_id)
|
|
70
|
+
}];
|
|
71
|
+
else if (isAIMessage(message)) if (toolCalls === void 0) return [{
|
|
72
|
+
role: getRole(message.getType()),
|
|
73
|
+
content
|
|
74
|
+
}];
|
|
75
|
+
else {
|
|
76
|
+
const filteredToolCalls = toolCalls.filter((tc) => toolResponseIds.has(_convertToolCallIdToMistralCompatible(tc.id ?? "")));
|
|
77
|
+
if (filteredToolCalls.length === 0) {
|
|
78
|
+
const isEmptyContent = typeof content === "string" && content.trim() === "" || Array.isArray(content) && content.length === 0;
|
|
79
|
+
if (isEmptyContent) return [];
|
|
80
|
+
return [{
|
|
81
|
+
role: getRole(message.getType()),
|
|
82
|
+
content
|
|
83
|
+
}];
|
|
84
|
+
}
|
|
85
|
+
return [{
|
|
86
|
+
role: getRole(message.getType()),
|
|
87
|
+
toolCalls: filteredToolCalls
|
|
88
|
+
}];
|
|
89
|
+
}
|
|
90
|
+
return [{
|
|
91
|
+
role: getRole(message.getType()),
|
|
92
|
+
content
|
|
93
|
+
}];
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function mistralAIResponseToChatMessage(choice, usage) {
|
|
97
|
+
const { message } = choice;
|
|
98
|
+
if (message === void 0) throw new Error("No message found in response");
|
|
99
|
+
let rawToolCalls = [];
|
|
100
|
+
if ("toolCalls" in message && Array.isArray(message.toolCalls)) rawToolCalls = message.toolCalls;
|
|
101
|
+
const content = _mistralContentChunkToMessageContentComplex(message.content);
|
|
102
|
+
switch (message.role) {
|
|
103
|
+
case "assistant": {
|
|
104
|
+
const toolCalls = [];
|
|
105
|
+
const invalidToolCalls = [];
|
|
106
|
+
for (const rawToolCall of rawToolCalls) try {
|
|
107
|
+
const parsed = parseToolCall(rawToolCall, { returnId: true });
|
|
108
|
+
toolCalls.push({
|
|
109
|
+
...parsed,
|
|
110
|
+
id: parsed.id ?? v4().replace(/-/g, "")
|
|
111
|
+
});
|
|
112
|
+
} catch (e) {
|
|
113
|
+
invalidToolCalls.push(makeInvalidToolCall(rawToolCall, e.message));
|
|
114
|
+
}
|
|
115
|
+
return new AIMessage({
|
|
116
|
+
content,
|
|
117
|
+
tool_calls: toolCalls,
|
|
118
|
+
invalid_tool_calls: invalidToolCalls,
|
|
119
|
+
additional_kwargs: {},
|
|
120
|
+
usage_metadata: usage ? {
|
|
121
|
+
input_tokens: usage.promptTokens,
|
|
122
|
+
output_tokens: usage.completionTokens,
|
|
123
|
+
total_tokens: usage.totalTokens
|
|
124
|
+
} : void 0
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
default: return new HumanMessage({ content });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function _convertDeltaToMessageChunk(delta, usage) {
|
|
131
|
+
if (!delta.content && !delta.toolCalls) {
|
|
132
|
+
if (usage) return new AIMessageChunk({
|
|
133
|
+
content: "",
|
|
134
|
+
usage_metadata: usage ? {
|
|
135
|
+
input_tokens: usage.promptTokens,
|
|
136
|
+
output_tokens: usage.completionTokens,
|
|
137
|
+
total_tokens: usage.totalTokens
|
|
138
|
+
} : void 0
|
|
139
|
+
});
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const rawToolCallChunksWithIndex = delta.toolCalls?.length ? delta.toolCalls?.map((toolCall, index) => ({
|
|
143
|
+
...toolCall,
|
|
144
|
+
index,
|
|
145
|
+
id: toolCall.id ?? v4().replace(/-/g, ""),
|
|
146
|
+
type: "function"
|
|
147
|
+
})) : void 0;
|
|
148
|
+
let role = "assistant";
|
|
149
|
+
if (delta.role) role = delta.role;
|
|
150
|
+
const content = _mistralContentChunkToMessageContentComplex(delta.content);
|
|
151
|
+
let additional_kwargs;
|
|
152
|
+
const toolCallChunks = [];
|
|
153
|
+
if (rawToolCallChunksWithIndex !== void 0) for (const rawToolCallChunk of rawToolCallChunksWithIndex) {
|
|
154
|
+
const rawArgs = rawToolCallChunk.function?.arguments;
|
|
155
|
+
const args = rawArgs === void 0 || typeof rawArgs === "string" ? rawArgs : JSON.stringify(rawArgs);
|
|
156
|
+
toolCallChunks.push({
|
|
157
|
+
name: rawToolCallChunk.function?.name,
|
|
158
|
+
args,
|
|
159
|
+
id: rawToolCallChunk.id,
|
|
160
|
+
index: rawToolCallChunk.index,
|
|
161
|
+
type: "tool_call_chunk"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
else additional_kwargs = {};
|
|
165
|
+
if (role === "user") return new HumanMessageChunk({ content });
|
|
166
|
+
else if (role === "assistant") return new AIMessageChunk({
|
|
167
|
+
content,
|
|
168
|
+
tool_call_chunks: toolCallChunks,
|
|
169
|
+
additional_kwargs,
|
|
170
|
+
usage_metadata: usage ? {
|
|
171
|
+
input_tokens: usage.promptTokens,
|
|
172
|
+
output_tokens: usage.completionTokens,
|
|
173
|
+
total_tokens: usage.totalTokens
|
|
174
|
+
} : void 0
|
|
175
|
+
});
|
|
176
|
+
else if (role === "tool") return new ToolMessageChunk({
|
|
177
|
+
content,
|
|
178
|
+
additional_kwargs,
|
|
179
|
+
tool_call_id: rawToolCallChunksWithIndex?.[0].id ?? ""
|
|
180
|
+
});
|
|
181
|
+
else if (role === "function") return new FunctionMessageChunk({
|
|
182
|
+
content,
|
|
183
|
+
additional_kwargs
|
|
184
|
+
});
|
|
185
|
+
else return new ChatMessageChunk({
|
|
186
|
+
content,
|
|
187
|
+
role
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function _convertToolToMistralTool(tools) {
|
|
191
|
+
if (!tools || !tools.length) return void 0;
|
|
192
|
+
return tools.map((tool) => {
|
|
193
|
+
if ("function" in tool) return {
|
|
194
|
+
type: tool.type ?? "function",
|
|
195
|
+
function: tool.function
|
|
196
|
+
};
|
|
197
|
+
if (isLangChainTool(tool)) {
|
|
198
|
+
const description = tool.description ?? `Tool: ${tool.name}`;
|
|
199
|
+
return {
|
|
200
|
+
type: "function",
|
|
201
|
+
function: {
|
|
202
|
+
name: tool.name,
|
|
203
|
+
description,
|
|
204
|
+
parameters: isInteropZodSchema(tool.schema) ? toJsonSchema(tool.schema) : tool.schema
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
throw new Error(`Unknown tool type passed to ChatMistral: ${JSON.stringify(tool, null, 2)}`);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Mistral AI chat model integration.
|
|
213
|
+
*
|
|
214
|
+
* Setup:
|
|
215
|
+
* Install `@langchain/mistralai` and set an environment variable named `MISTRAL_API_KEY`.
|
|
216
|
+
*
|
|
217
|
+
* ```bash
|
|
218
|
+
* npm install @langchain/mistralai
|
|
219
|
+
* export MISTRAL_API_KEY="your-api-key"
|
|
220
|
+
* ```
|
|
221
|
+
*
|
|
222
|
+
* ## [Constructor args](https://api.js.langchain.com/classes/_langchain_mistralai.ChatMistralAI.html#constructor)
|
|
223
|
+
*
|
|
224
|
+
* ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_mistralai.ChatMistralAICallOptions.html)
|
|
225
|
+
*
|
|
226
|
+
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
|
|
227
|
+
* They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
|
|
228
|
+
*
|
|
229
|
+
* ```typescript
|
|
230
|
+
* // When calling `.withConfig`, call options should be passed via the first argument
|
|
231
|
+
* const llmWithArgsBound = llm.bindTools([...]) // tools array
|
|
232
|
+
* .withConfig({
|
|
233
|
+
* stop: ["\n"], // other call options
|
|
234
|
+
* });
|
|
235
|
+
*
|
|
236
|
+
* // You can also bind tools and call options like this
|
|
237
|
+
* const llmWithTools = llm.bindTools([...], {
|
|
238
|
+
* tool_choice: "auto",
|
|
239
|
+
* });
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* ## Examples
|
|
243
|
+
*
|
|
244
|
+
* <details open>
|
|
245
|
+
* <summary><strong>Instantiate</strong></summary>
|
|
246
|
+
*
|
|
247
|
+
* ```typescript
|
|
248
|
+
* import { ChatMistralAI } from '@langchain/mistralai';
|
|
249
|
+
*
|
|
250
|
+
* const llm = new ChatMistralAI({
|
|
251
|
+
* model: "mistral-large-2402",
|
|
252
|
+
* temperature: 0,
|
|
253
|
+
* // other params...
|
|
254
|
+
* });
|
|
255
|
+
* ```
|
|
256
|
+
* </details>
|
|
257
|
+
*
|
|
258
|
+
* <br />
|
|
259
|
+
*
|
|
260
|
+
* <details>
|
|
261
|
+
* <summary><strong>Invoking</strong></summary>
|
|
262
|
+
*
|
|
263
|
+
* ```typescript
|
|
264
|
+
* const input = `Translate "I love programming" into French.`;
|
|
265
|
+
*
|
|
266
|
+
* // Models also accept a list of chat messages or a formatted prompt
|
|
267
|
+
* const result = await llm.invoke(input);
|
|
268
|
+
* console.log(result);
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* ```txt
|
|
272
|
+
* AIMessage {
|
|
273
|
+
* "content": "The translation of \"I love programming\" into French is \"J'aime la programmation\". Here's the breakdown:\n\n- \"I\" translates to \"Je\"\n- \"love\" translates to \"aime\"\n- \"programming\" translates to \"la programmation\"\n\nSo, \"J'aime la programmation\" means \"I love programming\" in French.",
|
|
274
|
+
* "additional_kwargs": {},
|
|
275
|
+
* "response_metadata": {
|
|
276
|
+
* "tokenUsage": {
|
|
277
|
+
* "completionTokens": 89,
|
|
278
|
+
* "promptTokens": 13,
|
|
279
|
+
* "totalTokens": 102
|
|
280
|
+
* },
|
|
281
|
+
* "finish_reason": "stop"
|
|
282
|
+
* },
|
|
283
|
+
* "tool_calls": [],
|
|
284
|
+
* "invalid_tool_calls": [],
|
|
285
|
+
* "usage_metadata": {
|
|
286
|
+
* "input_tokens": 13,
|
|
287
|
+
* "output_tokens": 89,
|
|
288
|
+
* "total_tokens": 102
|
|
289
|
+
* }
|
|
290
|
+
* }
|
|
291
|
+
* ```
|
|
292
|
+
* </details>
|
|
293
|
+
*
|
|
294
|
+
* <br />
|
|
295
|
+
*
|
|
296
|
+
* <details>
|
|
297
|
+
* <summary><strong>Streaming Chunks</strong></summary>
|
|
298
|
+
*
|
|
299
|
+
* ```typescript
|
|
300
|
+
* for await (const chunk of await llm.stream(input)) {
|
|
301
|
+
* console.log(chunk);
|
|
302
|
+
* }
|
|
303
|
+
* ```
|
|
304
|
+
*
|
|
305
|
+
* ```txt
|
|
306
|
+
* AIMessageChunk {
|
|
307
|
+
* "content": "The",
|
|
308
|
+
* "additional_kwargs": {},
|
|
309
|
+
* "response_metadata": {
|
|
310
|
+
* "prompt": 0,
|
|
311
|
+
* "completion": 0
|
|
312
|
+
* },
|
|
313
|
+
* "tool_calls": [],
|
|
314
|
+
* "tool_call_chunks": [],
|
|
315
|
+
* "invalid_tool_calls": []
|
|
316
|
+
* }
|
|
317
|
+
* AIMessageChunk {
|
|
318
|
+
* "content": " translation",
|
|
319
|
+
* "additional_kwargs": {},
|
|
320
|
+
* "response_metadata": {
|
|
321
|
+
* "prompt": 0,
|
|
322
|
+
* "completion": 0
|
|
323
|
+
* },
|
|
324
|
+
* "tool_calls": [],
|
|
325
|
+
* "tool_call_chunks": [],
|
|
326
|
+
* "invalid_tool_calls": []
|
|
327
|
+
* }
|
|
328
|
+
* AIMessageChunk {
|
|
329
|
+
* "content": " of",
|
|
330
|
+
* "additional_kwargs": {},
|
|
331
|
+
* "response_metadata": {
|
|
332
|
+
* "prompt": 0,
|
|
333
|
+
* "completion": 0
|
|
334
|
+
* },
|
|
335
|
+
* "tool_calls": [],
|
|
336
|
+
* "tool_call_chunks": [],
|
|
337
|
+
* "invalid_tool_calls": []
|
|
338
|
+
* }
|
|
339
|
+
* AIMessageChunk {
|
|
340
|
+
* "content": " \"",
|
|
341
|
+
* "additional_kwargs": {},
|
|
342
|
+
* "response_metadata": {
|
|
343
|
+
* "prompt": 0,
|
|
344
|
+
* "completion": 0
|
|
345
|
+
* },
|
|
346
|
+
* "tool_calls": [],
|
|
347
|
+
* "tool_call_chunks": [],
|
|
348
|
+
* "invalid_tool_calls": []
|
|
349
|
+
* }
|
|
350
|
+
* AIMessageChunk {
|
|
351
|
+
* "content": "I",
|
|
352
|
+
* "additional_kwargs": {},
|
|
353
|
+
* "response_metadata": {
|
|
354
|
+
* "prompt": 0,
|
|
355
|
+
* "completion": 0
|
|
356
|
+
* },
|
|
357
|
+
* "tool_calls": [],
|
|
358
|
+
* "tool_call_chunks": [],
|
|
359
|
+
* "invalid_tool_calls": []
|
|
360
|
+
* }
|
|
361
|
+
* AIMessageChunk {
|
|
362
|
+
* "content": ".",
|
|
363
|
+
* "additional_kwargs": {},
|
|
364
|
+
* "response_metadata": {
|
|
365
|
+
* "prompt": 0,
|
|
366
|
+
* "completion": 0
|
|
367
|
+
* },
|
|
368
|
+
* "tool_calls": [],
|
|
369
|
+
* "tool_call_chunks": [],
|
|
370
|
+
* "invalid_tool_calls": []
|
|
371
|
+
*}
|
|
372
|
+
*AIMessageChunk {
|
|
373
|
+
* "content": "",
|
|
374
|
+
* "additional_kwargs": {},
|
|
375
|
+
* "response_metadata": {
|
|
376
|
+
* "prompt": 0,
|
|
377
|
+
* "completion": 0
|
|
378
|
+
* },
|
|
379
|
+
* "tool_calls": [],
|
|
380
|
+
* "tool_call_chunks": [],
|
|
381
|
+
* "invalid_tool_calls": [],
|
|
382
|
+
* "usage_metadata": {
|
|
383
|
+
* "input_tokens": 13,
|
|
384
|
+
* "output_tokens": 89,
|
|
385
|
+
* "total_tokens": 102
|
|
386
|
+
* }
|
|
387
|
+
*}
|
|
388
|
+
* ```
|
|
389
|
+
* </details>
|
|
390
|
+
*
|
|
391
|
+
* <br />
|
|
392
|
+
*
|
|
393
|
+
* <details>
|
|
394
|
+
* <summary><strong>Aggregate Streamed Chunks</strong></summary>
|
|
395
|
+
*
|
|
396
|
+
* ```typescript
|
|
397
|
+
* import { AIMessageChunk } from '@langchain/core/messages';
|
|
398
|
+
* import { concat } from '@langchain/core/utils/stream';
|
|
399
|
+
*
|
|
400
|
+
* const stream = await llm.stream(input);
|
|
401
|
+
* let full: AIMessageChunk | undefined;
|
|
402
|
+
* for await (const chunk of stream) {
|
|
403
|
+
* full = !full ? chunk : concat(full, chunk);
|
|
404
|
+
* }
|
|
405
|
+
* console.log(full);
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* ```txt
|
|
409
|
+
* AIMessageChunk {
|
|
410
|
+
* "content": "The translation of \"I love programming\" into French is \"J'aime la programmation\". Here's the breakdown:\n\n- \"I\" translates to \"Je\"\n- \"love\" translates to \"aime\"\n- \"programming\" translates to \"la programmation\"\n\nSo, \"J'aime la programmation\" means \"I love programming\" in French.",
|
|
411
|
+
* "additional_kwargs": {},
|
|
412
|
+
* "response_metadata": {
|
|
413
|
+
* "prompt": 0,
|
|
414
|
+
* "completion": 0
|
|
415
|
+
* },
|
|
416
|
+
* "tool_calls": [],
|
|
417
|
+
* "tool_call_chunks": [],
|
|
418
|
+
* "invalid_tool_calls": [],
|
|
419
|
+
* "usage_metadata": {
|
|
420
|
+
* "input_tokens": 13,
|
|
421
|
+
* "output_tokens": 89,
|
|
422
|
+
* "total_tokens": 102
|
|
423
|
+
* }
|
|
424
|
+
* }
|
|
425
|
+
* ```
|
|
426
|
+
* </details>
|
|
427
|
+
*
|
|
428
|
+
* <br />
|
|
429
|
+
*
|
|
430
|
+
* <details>
|
|
431
|
+
* <summary><strong>Bind tools</strong></summary>
|
|
432
|
+
*
|
|
433
|
+
* ```typescript
|
|
434
|
+
* import { z } from 'zod';
|
|
435
|
+
*
|
|
436
|
+
* const GetWeather = {
|
|
437
|
+
* name: "GetWeather",
|
|
438
|
+
* description: "Get the current weather in a given location",
|
|
439
|
+
* schema: z.object({
|
|
440
|
+
* location: z.string().describe("The city and state, e.g. San Francisco, CA")
|
|
441
|
+
* }),
|
|
442
|
+
* }
|
|
443
|
+
*
|
|
444
|
+
* const GetPopulation = {
|
|
445
|
+
* name: "GetPopulation",
|
|
446
|
+
* description: "Get the current population in a given location",
|
|
447
|
+
* schema: z.object({
|
|
448
|
+
* location: z.string().describe("The city and state, e.g. San Francisco, CA")
|
|
449
|
+
* }),
|
|
450
|
+
* }
|
|
451
|
+
*
|
|
452
|
+
* const llmWithTools = llm.bindTools([GetWeather, GetPopulation]);
|
|
453
|
+
* const aiMsg = await llmWithTools.invoke(
|
|
454
|
+
* "Which city is hotter today and which is bigger: LA or NY?"
|
|
455
|
+
* );
|
|
456
|
+
* console.log(aiMsg.tool_calls);
|
|
457
|
+
* ```
|
|
458
|
+
*
|
|
459
|
+
* ```txt
|
|
460
|
+
* [
|
|
461
|
+
* {
|
|
462
|
+
* name: 'GetWeather',
|
|
463
|
+
* args: { location: 'Los Angeles, CA' },
|
|
464
|
+
* type: 'tool_call',
|
|
465
|
+
* id: '47i216yko'
|
|
466
|
+
* },
|
|
467
|
+
* {
|
|
468
|
+
* name: 'GetWeather',
|
|
469
|
+
* args: { location: 'New York, NY' },
|
|
470
|
+
* type: 'tool_call',
|
|
471
|
+
* id: 'nb3v8Fpcn'
|
|
472
|
+
* },
|
|
473
|
+
* {
|
|
474
|
+
* name: 'GetPopulation',
|
|
475
|
+
* args: { location: 'Los Angeles, CA' },
|
|
476
|
+
* type: 'tool_call',
|
|
477
|
+
* id: 'EedWzByIB'
|
|
478
|
+
* },
|
|
479
|
+
* {
|
|
480
|
+
* name: 'GetPopulation',
|
|
481
|
+
* args: { location: 'New York, NY' },
|
|
482
|
+
* type: 'tool_call',
|
|
483
|
+
* id: 'jLdLia7zC'
|
|
484
|
+
* }
|
|
485
|
+
* ]
|
|
486
|
+
* ```
|
|
487
|
+
* </details>
|
|
488
|
+
*
|
|
489
|
+
* <br />
|
|
490
|
+
*
|
|
491
|
+
* <details>
|
|
492
|
+
* <summary><strong>Structured Output</strong></summary>
|
|
493
|
+
*
|
|
494
|
+
* ```typescript
|
|
495
|
+
* import { z } from 'zod';
|
|
496
|
+
*
|
|
497
|
+
* const Joke = z.object({
|
|
498
|
+
* setup: z.string().describe("The setup of the joke"),
|
|
499
|
+
* punchline: z.string().describe("The punchline to the joke"),
|
|
500
|
+
* rating: z.number().optional().describe("How funny the joke is, from 1 to 10")
|
|
501
|
+
* }).describe('Joke to tell user.');
|
|
502
|
+
*
|
|
503
|
+
* const structuredLlm = llm.withStructuredOutput(Joke, { name: "Joke" });
|
|
504
|
+
* const jokeResult = await structuredLlm.invoke("Tell me a joke about cats");
|
|
505
|
+
* console.log(jokeResult);
|
|
506
|
+
* ```
|
|
507
|
+
*
|
|
508
|
+
* ```txt
|
|
509
|
+
* {
|
|
510
|
+
* setup: "Why don't cats play poker in the jungle?",
|
|
511
|
+
* punchline: 'Too many cheetahs!',
|
|
512
|
+
* rating: 7
|
|
513
|
+
* }
|
|
514
|
+
* ```
|
|
515
|
+
* </details>
|
|
516
|
+
*
|
|
517
|
+
* <br />
|
|
518
|
+
*
|
|
519
|
+
* <details>
|
|
520
|
+
* <summary><strong>Usage Metadata</strong></summary>
|
|
521
|
+
*
|
|
522
|
+
* ```typescript
|
|
523
|
+
* const aiMsgForMetadata = await llm.invoke(input);
|
|
524
|
+
* console.log(aiMsgForMetadata.usage_metadata);
|
|
525
|
+
* ```
|
|
526
|
+
*
|
|
527
|
+
* ```txt
|
|
528
|
+
* { input_tokens: 13, output_tokens: 89, total_tokens: 102 }
|
|
529
|
+
* ```
|
|
530
|
+
* </details>
|
|
531
|
+
*
|
|
532
|
+
* <br />
|
|
533
|
+
*/
|
|
534
|
+
var ChatMistralAI = class extends BaseChatModel {
|
|
535
|
+
static lc_name() {
|
|
536
|
+
return "ChatMistralAI";
|
|
537
|
+
}
|
|
538
|
+
lc_namespace = [
|
|
539
|
+
"langchain",
|
|
540
|
+
"chat_models",
|
|
541
|
+
"mistralai"
|
|
542
|
+
];
|
|
543
|
+
model = "mistral-small-latest";
|
|
544
|
+
apiKey;
|
|
545
|
+
/**
|
|
546
|
+
* @deprecated use serverURL instead
|
|
547
|
+
*/
|
|
548
|
+
endpoint;
|
|
549
|
+
serverURL;
|
|
550
|
+
temperature = .7;
|
|
551
|
+
streaming = false;
|
|
552
|
+
topP = 1;
|
|
553
|
+
maxTokens;
|
|
554
|
+
/**
|
|
555
|
+
* @deprecated use safePrompt instead
|
|
556
|
+
*/
|
|
557
|
+
safeMode = false;
|
|
558
|
+
safePrompt = false;
|
|
559
|
+
randomSeed;
|
|
560
|
+
seed;
|
|
561
|
+
maxRetries;
|
|
562
|
+
lc_serializable = true;
|
|
563
|
+
streamUsage = true;
|
|
564
|
+
beforeRequestHooks;
|
|
565
|
+
requestErrorHooks;
|
|
566
|
+
responseHooks;
|
|
567
|
+
httpClient;
|
|
568
|
+
presencePenalty;
|
|
569
|
+
frequencyPenalty;
|
|
570
|
+
numCompletions;
|
|
571
|
+
constructor(fields) {
|
|
572
|
+
super(fields ?? {});
|
|
573
|
+
const apiKey = fields?.apiKey ?? getEnvironmentVariable("MISTRAL_API_KEY");
|
|
574
|
+
if (!apiKey) throw new Error("API key MISTRAL_API_KEY is missing for MistralAI, but it is required.");
|
|
575
|
+
this.apiKey = apiKey;
|
|
576
|
+
this.streaming = fields?.streaming ?? this.streaming;
|
|
577
|
+
this.serverURL = fields?.serverURL ?? this.serverURL;
|
|
578
|
+
this.temperature = fields?.temperature ?? this.temperature;
|
|
579
|
+
this.topP = fields?.topP ?? this.topP;
|
|
580
|
+
this.maxTokens = fields?.maxTokens ?? this.maxTokens;
|
|
581
|
+
this.safePrompt = fields?.safePrompt ?? this.safePrompt;
|
|
582
|
+
this.randomSeed = fields?.seed ?? fields?.randomSeed ?? this.seed;
|
|
583
|
+
this.seed = this.randomSeed;
|
|
584
|
+
this.maxRetries = fields?.maxRetries;
|
|
585
|
+
this.httpClient = fields?.httpClient;
|
|
586
|
+
this.model = fields?.model ?? fields?.modelName ?? this.model;
|
|
587
|
+
this.streamUsage = fields?.streamUsage ?? this.streamUsage;
|
|
588
|
+
this.beforeRequestHooks = fields?.beforeRequestHooks ?? this.beforeRequestHooks;
|
|
589
|
+
this.requestErrorHooks = fields?.requestErrorHooks ?? this.requestErrorHooks;
|
|
590
|
+
this.responseHooks = fields?.responseHooks ?? this.responseHooks;
|
|
591
|
+
this.presencePenalty = fields?.presencePenalty ?? this.presencePenalty;
|
|
592
|
+
this.frequencyPenalty = fields?.frequencyPenalty ?? this.frequencyPenalty;
|
|
593
|
+
this.numCompletions = fields?.numCompletions ?? this.numCompletions;
|
|
594
|
+
this.addAllHooksToHttpClient();
|
|
595
|
+
}
|
|
596
|
+
get lc_secrets() {
|
|
597
|
+
return { apiKey: "MISTRAL_API_KEY" };
|
|
598
|
+
}
|
|
599
|
+
get lc_aliases() {
|
|
600
|
+
return { apiKey: "mistral_api_key" };
|
|
601
|
+
}
|
|
602
|
+
getLsParams(options) {
|
|
603
|
+
const params = this.invocationParams(options);
|
|
604
|
+
return {
|
|
605
|
+
ls_provider: "mistral",
|
|
606
|
+
ls_model_name: this.model,
|
|
607
|
+
ls_model_type: "chat",
|
|
608
|
+
ls_temperature: params.temperature ?? void 0,
|
|
609
|
+
ls_max_tokens: params.maxTokens ?? void 0
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
_llmType() {
|
|
613
|
+
return "mistral_ai";
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Get the parameters used to invoke the model
|
|
617
|
+
*/
|
|
618
|
+
invocationParams(options) {
|
|
619
|
+
const { response_format, tools, tool_choice } = options ?? {};
|
|
620
|
+
const mistralAITools = tools?.length ? _convertToolToMistralTool(tools) : void 0;
|
|
621
|
+
const params = {
|
|
622
|
+
model: this.model,
|
|
623
|
+
tools: mistralAITools,
|
|
624
|
+
temperature: this.temperature,
|
|
625
|
+
maxTokens: this.maxTokens,
|
|
626
|
+
topP: this.topP,
|
|
627
|
+
randomSeed: this.seed,
|
|
628
|
+
safePrompt: this.safePrompt,
|
|
629
|
+
toolChoice: tool_choice,
|
|
630
|
+
responseFormat: response_format,
|
|
631
|
+
presencePenalty: this.presencePenalty,
|
|
632
|
+
frequencyPenalty: this.frequencyPenalty,
|
|
633
|
+
n: this.numCompletions
|
|
634
|
+
};
|
|
635
|
+
return params;
|
|
636
|
+
}
|
|
637
|
+
bindTools(tools, kwargs) {
|
|
638
|
+
const mistralTools = _convertToolToMistralTool(tools);
|
|
639
|
+
return new RunnableBinding({
|
|
640
|
+
bound: this,
|
|
641
|
+
kwargs: {
|
|
642
|
+
...kwargs ?? {},
|
|
643
|
+
tools: mistralTools
|
|
644
|
+
},
|
|
645
|
+
config: {}
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
async completionWithRetry(input, streaming) {
|
|
649
|
+
const caller = new AsyncCaller({ maxRetries: this.maxRetries });
|
|
650
|
+
const client = new Mistral({
|
|
651
|
+
apiKey: this.apiKey,
|
|
652
|
+
serverURL: this.serverURL,
|
|
653
|
+
...this.httpClient ? { httpClient: this.httpClient } : {}
|
|
654
|
+
});
|
|
655
|
+
return caller.call(async () => {
|
|
656
|
+
try {
|
|
657
|
+
let res;
|
|
658
|
+
if (streaming) res = await client.chat.stream(input);
|
|
659
|
+
else res = await client.chat.complete(input);
|
|
660
|
+
return res;
|
|
661
|
+
} catch (e) {
|
|
662
|
+
if (e.message?.includes("status: 400") || e.message?.toLowerCase().includes("status 400") || e.message?.includes("validation failed")) e.status = 400;
|
|
663
|
+
throw e;
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
/** @ignore */
|
|
668
|
+
async _generate(messages, options, runManager) {
|
|
669
|
+
const tokenUsage = {};
|
|
670
|
+
const params = this.invocationParams(options);
|
|
671
|
+
const mistralMessages = convertMessagesToMistralMessages(messages);
|
|
672
|
+
const input = {
|
|
673
|
+
...params,
|
|
674
|
+
messages: mistralMessages
|
|
675
|
+
};
|
|
676
|
+
const shouldStream = options.signal ?? !!options.timeout;
|
|
677
|
+
if (this.streaming || shouldStream) {
|
|
678
|
+
const stream = this._streamResponseChunks(messages, options, runManager);
|
|
679
|
+
const finalChunks = {};
|
|
680
|
+
for await (const chunk of stream) {
|
|
681
|
+
const index = chunk.generationInfo?.completion ?? 0;
|
|
682
|
+
if (finalChunks[index] === void 0) finalChunks[index] = chunk;
|
|
683
|
+
else finalChunks[index] = finalChunks[index].concat(chunk);
|
|
684
|
+
}
|
|
685
|
+
const generations$1 = Object.entries(finalChunks).sort(([aKey], [bKey]) => parseInt(aKey, 10) - parseInt(bKey, 10)).map(([_, value]) => value);
|
|
686
|
+
return {
|
|
687
|
+
generations: generations$1,
|
|
688
|
+
llmOutput: { estimatedTokenUsage: tokenUsage }
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
const response = await this.completionWithRetry(input, false);
|
|
692
|
+
const { completionTokens, promptTokens, totalTokens } = response?.usage ?? {};
|
|
693
|
+
if (completionTokens) tokenUsage.completionTokens = (tokenUsage.completionTokens ?? 0) + completionTokens;
|
|
694
|
+
if (promptTokens) tokenUsage.promptTokens = (tokenUsage.promptTokens ?? 0) + promptTokens;
|
|
695
|
+
if (totalTokens) tokenUsage.totalTokens = (tokenUsage.totalTokens ?? 0) + totalTokens;
|
|
696
|
+
const generations = [];
|
|
697
|
+
for (const part of response?.choices ?? []) {
|
|
698
|
+
if ("delta" in part) throw new Error("Delta not supported in non-streaming mode.");
|
|
699
|
+
if (!("message" in part)) throw new Error("No message found in the choice.");
|
|
700
|
+
let text = part.message?.content ?? "";
|
|
701
|
+
if (Array.isArray(text)) text = text[0].type === "text" ? text[0].text : "";
|
|
702
|
+
const generation = {
|
|
703
|
+
text,
|
|
704
|
+
message: mistralAIResponseToChatMessage(part, response?.usage)
|
|
705
|
+
};
|
|
706
|
+
if (part.finishReason) generation.generationInfo = { finishReason: part.finishReason };
|
|
707
|
+
generations.push(generation);
|
|
708
|
+
}
|
|
709
|
+
return {
|
|
710
|
+
generations,
|
|
711
|
+
llmOutput: { tokenUsage }
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
async *_streamResponseChunks(messages, options, runManager) {
|
|
715
|
+
const mistralMessages = convertMessagesToMistralMessages(messages);
|
|
716
|
+
const params = this.invocationParams(options);
|
|
717
|
+
const input = {
|
|
718
|
+
...params,
|
|
719
|
+
messages: mistralMessages
|
|
720
|
+
};
|
|
721
|
+
const streamIterable = await this.completionWithRetry(input, true);
|
|
722
|
+
for await (const { data } of streamIterable) {
|
|
723
|
+
if (options.signal?.aborted) throw new Error("AbortError");
|
|
724
|
+
const choice = data?.choices[0];
|
|
725
|
+
if (!choice || !("delta" in choice)) continue;
|
|
726
|
+
const { delta } = choice;
|
|
727
|
+
if (!delta) continue;
|
|
728
|
+
const newTokenIndices = {
|
|
729
|
+
prompt: 0,
|
|
730
|
+
completion: choice.index ?? 0
|
|
731
|
+
};
|
|
732
|
+
const shouldStreamUsage = this.streamUsage || options.streamUsage;
|
|
733
|
+
const message = _convertDeltaToMessageChunk(delta, shouldStreamUsage ? data.usage : null);
|
|
734
|
+
if (message === null) continue;
|
|
735
|
+
let text = delta.content ?? "";
|
|
736
|
+
if (Array.isArray(text)) text = text[0].type === "text" ? text[0].text : "";
|
|
737
|
+
const generationChunk = new ChatGenerationChunk({
|
|
738
|
+
message,
|
|
739
|
+
text,
|
|
740
|
+
generationInfo: newTokenIndices
|
|
741
|
+
});
|
|
742
|
+
yield generationChunk;
|
|
743
|
+
runManager?.handleLLMNewToken(generationChunk.text ?? "", newTokenIndices, void 0, void 0, void 0, { chunk: generationChunk });
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
addAllHooksToHttpClient() {
|
|
747
|
+
try {
|
|
748
|
+
this.removeAllHooksFromHttpClient();
|
|
749
|
+
const hasHooks = [
|
|
750
|
+
this.beforeRequestHooks,
|
|
751
|
+
this.requestErrorHooks,
|
|
752
|
+
this.responseHooks
|
|
753
|
+
].some((hook) => hook && hook.length > 0);
|
|
754
|
+
if (hasHooks && !this.httpClient) this.httpClient = new HTTPClient();
|
|
755
|
+
if (this.beforeRequestHooks) for (const hook of this.beforeRequestHooks) this.httpClient?.addHook("beforeRequest", hook);
|
|
756
|
+
if (this.requestErrorHooks) for (const hook of this.requestErrorHooks) this.httpClient?.addHook("requestError", hook);
|
|
757
|
+
if (this.responseHooks) for (const hook of this.responseHooks) this.httpClient?.addHook("response", hook);
|
|
758
|
+
} catch {
|
|
759
|
+
throw new Error("Error in adding all hooks");
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
removeAllHooksFromHttpClient() {
|
|
763
|
+
try {
|
|
764
|
+
if (this.beforeRequestHooks) for (const hook of this.beforeRequestHooks) this.httpClient?.removeHook("beforeRequest", hook);
|
|
765
|
+
if (this.requestErrorHooks) for (const hook of this.requestErrorHooks) this.httpClient?.removeHook("requestError", hook);
|
|
766
|
+
if (this.responseHooks) for (const hook of this.responseHooks) this.httpClient?.removeHook("response", hook);
|
|
767
|
+
} catch {
|
|
768
|
+
throw new Error("Error in removing hooks");
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
removeHookFromHttpClient(hook) {
|
|
772
|
+
try {
|
|
773
|
+
this.httpClient?.removeHook("beforeRequest", hook);
|
|
774
|
+
this.httpClient?.removeHook("requestError", hook);
|
|
775
|
+
this.httpClient?.removeHook("response", hook);
|
|
776
|
+
} catch {
|
|
777
|
+
throw new Error("Error in removing hook");
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
/** @ignore */
|
|
781
|
+
_combineLLMOutput() {
|
|
782
|
+
return [];
|
|
783
|
+
}
|
|
784
|
+
withStructuredOutput(outputSchema, config) {
|
|
785
|
+
const schema = outputSchema;
|
|
786
|
+
const name = config?.name;
|
|
787
|
+
const method = config?.method;
|
|
788
|
+
const includeRaw = config?.includeRaw;
|
|
789
|
+
let llm;
|
|
790
|
+
let outputParser;
|
|
791
|
+
if (method === "jsonMode") {
|
|
792
|
+
let outputSchema$1;
|
|
793
|
+
if (isInteropZodSchema(schema)) {
|
|
794
|
+
outputParser = StructuredOutputParser.fromZodSchema(schema);
|
|
795
|
+
outputSchema$1 = toJsonSchema(schema);
|
|
796
|
+
} else outputParser = new JsonOutputParser();
|
|
797
|
+
llm = this.withConfig({
|
|
798
|
+
response_format: { type: "json_object" },
|
|
799
|
+
ls_structured_output_format: {
|
|
800
|
+
kwargs: { method: "jsonMode" },
|
|
801
|
+
schema: outputSchema$1
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
} else {
|
|
805
|
+
let functionName = name ?? "extract";
|
|
806
|
+
if (isInteropZodSchema(schema)) {
|
|
807
|
+
const asJsonSchema = toJsonSchema(schema);
|
|
808
|
+
llm = this.bindTools([{
|
|
809
|
+
type: "function",
|
|
810
|
+
function: {
|
|
811
|
+
name: functionName,
|
|
812
|
+
description: asJsonSchema.description,
|
|
813
|
+
parameters: asJsonSchema
|
|
814
|
+
}
|
|
815
|
+
}]).withConfig({
|
|
816
|
+
tool_choice: "any",
|
|
817
|
+
ls_structured_output_format: {
|
|
818
|
+
kwargs: { method: "functionCalling" },
|
|
819
|
+
schema: asJsonSchema
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
outputParser = new JsonOutputKeyToolsParser({
|
|
823
|
+
returnSingle: true,
|
|
824
|
+
keyName: functionName,
|
|
825
|
+
zodSchema: schema
|
|
826
|
+
});
|
|
827
|
+
} else {
|
|
828
|
+
let openAIFunctionDefinition;
|
|
829
|
+
if (typeof schema.name === "string" && typeof schema.parameters === "object" && schema.parameters != null) {
|
|
830
|
+
openAIFunctionDefinition = schema;
|
|
831
|
+
functionName = schema.name;
|
|
832
|
+
} else openAIFunctionDefinition = {
|
|
833
|
+
name: functionName,
|
|
834
|
+
description: schema.description ?? "",
|
|
835
|
+
parameters: schema
|
|
836
|
+
};
|
|
837
|
+
llm = this.bindTools([{
|
|
838
|
+
type: "function",
|
|
839
|
+
function: openAIFunctionDefinition
|
|
840
|
+
}]).withConfig({ tool_choice: "any" });
|
|
841
|
+
outputParser = new JsonOutputKeyToolsParser({
|
|
842
|
+
returnSingle: true,
|
|
843
|
+
keyName: functionName
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if (!includeRaw) return llm.pipe(outputParser);
|
|
848
|
+
const parserAssign = RunnablePassthrough.assign({ parsed: (input, config$1) => outputParser.invoke(input.raw, config$1) });
|
|
849
|
+
const parserNone = RunnablePassthrough.assign({ parsed: () => null });
|
|
850
|
+
const parsedWithFallback = parserAssign.withFallbacks({ fallbacks: [parserNone] });
|
|
851
|
+
return RunnableSequence.from([{ raw: llm }, parsedWithFallback]);
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
//#endregion
|
|
856
|
+
export { ChatMistralAI, convertMessagesToMistralMessages };
|
|
857
|
+
//# sourceMappingURL=chat_models.js.map
|