drizzle-cube 0.5.7 → 0.6.0
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/README.md +2 -0
- package/dist/adapters/adapters/hono/agent-handler.d.ts +9 -0
- package/dist/adapters/adapters/hono/mcp-handler.d.ts +37 -0
- package/dist/adapters/adapters/mcp-tools-handlers.d.ts +18 -0
- package/dist/adapters/adapters/nextjs/mcp-handler.d.ts +36 -0
- package/dist/adapters/{utils.d.ts → adapters/utils.d.ts} +6 -81
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +50 -50
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +78 -78
- package/dist/adapters/google-BOnRIN1w.cjs +2 -0
- package/dist/{server/google-CFYljAOF.js → adapters/google-CvKM9yVM.js} +83 -71
- package/dist/adapters/{handler-Dz1F4iwf.js → handler-CfgE0JSL.js} +515 -578
- package/dist/adapters/handler-Cn0dOctE.cjs +25 -0
- package/dist/adapters/hono/index.cjs +2 -2
- package/dist/adapters/hono/index.js +208 -178
- package/dist/adapters/locale-DDvZDFVn.js +8114 -0
- package/dist/adapters/locale-ZLUUNUxr.cjs +166 -0
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +49 -38
- package/dist/adapters/mcp-transport-Chiaj4ll.cjs +40 -0
- package/dist/adapters/mcp-transport-H96VG3WY.js +591 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +190 -197
- package/dist/{server/openai-y7GhJNdn.js → adapters/openai-B5jEiqiB.js} +776 -719
- package/dist/adapters/openai-D0musiYP.cjs +17 -0
- package/dist/{server/openai-DiVskd89.js → adapters/openai-cDlFSTk6.js} +61 -59
- package/dist/adapters/openai-vXvLni8v.cjs +1 -0
- package/dist/adapters/{utils-DosuoabY.js → utils-BPWZsX7k.js} +1285 -1220
- package/dist/adapters/utils-_whV4fXL.cjs +128 -0
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.js +2 -2
- package/dist/client/charts/ChartLoader.d.ts +3 -17
- package/dist/client/charts/chartComponentRegistry.d.ts +46 -0
- package/dist/client/charts/chartConfigHelpers.d.ts +38 -0
- package/dist/client/charts.js +14 -13
- package/dist/client/chunks/{DashboardEditModal-6KRE36mm.js → DashboardEditModal-okVfH8ZK.js} +5446 -4486
- package/dist/client/chunks/DashboardEditModal-okVfH8ZK.js.map +1 -0
- package/dist/client/chunks/{RetentionCombinedChart-CCpu0C-s.js → RetentionCombinedChart-BgbDhsPz.js} +10 -10
- package/dist/client/chunks/{RetentionCombinedChart-CCpu0C-s.js.map → RetentionCombinedChart-BgbDhsPz.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-B24PiIfr.js → RetentionHeatmap-DjXZaTPq.js} +5 -5
- package/dist/client/chunks/{RetentionHeatmap-B24PiIfr.js.map → RetentionHeatmap-DjXZaTPq.js.map} +1 -1
- package/dist/client/chunks/analysis-builder-DB88FojM.js +5674 -0
- package/dist/client/chunks/analysis-builder-DB88FojM.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-x576-O5p.js → analysis-builder-shared-BVK4TYfR.js} +1578 -1292
- package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-CiHrLH6Y.js → chart-activity-grid-DX0SJbxs.js} +642 -494
- package/dist/client/chunks/chart-activity-grid-DX0SJbxs.js.map +1 -0
- package/dist/client/chunks/chart-area-of01_62R.js +775 -0
- package/dist/client/chunks/chart-area-of01_62R.js.map +1 -0
- package/dist/client/chunks/chart-bar-BqelQE_I.js +194 -0
- package/dist/client/chunks/chart-bar-BqelQE_I.js.map +1 -0
- package/dist/client/chunks/{chart-box-plot-Bu9hy-17.js → chart-box-plot-kkBixZ27.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-Bu9hy-17.js.map → chart-box-plot-kkBixZ27.js.map} +1 -1
- package/dist/client/chunks/chart-bubble-B2he1--4.js +221 -0
- package/dist/client/chunks/chart-bubble-B2he1--4.js.map +1 -0
- package/dist/client/chunks/{chart-candlestick-Dau5AF4E.js → chart-candlestick-DZp19Tzh.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-Dau5AF4E.js.map → chart-candlestick-DZp19Tzh.js.map} +1 -1
- package/dist/client/chunks/chart-config-area-BNigHUy8.js +124 -0
- package/dist/client/chunks/chart-config-area-BNigHUy8.js.map +1 -0
- package/dist/client/chunks/chart-config-bar-DSO_LRTx.js +54 -0
- package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +1 -0
- package/dist/client/chunks/{chart-config-box-plot-DJ-dWWXA.js → chart-config-box-plot-oW8axV2q.js} +5 -10
- package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +1 -0
- package/dist/client/chunks/{chart-config-gauge-DSwC04l0.js → chart-config-gauge-Dq-_H9UN.js} +5 -7
- package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-delta-D6BIkHL3.js → chart-config-kpi-delta-DSQbvqu_.js} +5 -10
- package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-number-Bx-V9a62.js → chart-config-kpi-number-EFSWY1We.js} +5 -7
- package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-text-CcqC1u-8.js → chart-config-kpi-text-KM3V5X2u.js} +5 -7
- package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +1 -0
- package/dist/client/chunks/{chart-config-line-Db3jDsWc.js → chart-config-line-D6jG8PCH.js} +9 -36
- package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +1 -0
- package/dist/client/chunks/{chart-config-pie-DD4SmRTF.js → chart-config-pie-BhzW-fdn.js} +6 -16
- package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +1 -0
- package/dist/client/chunks/{chart-config-radar-CC2XAaGr.js → chart-config-radar-D7REP1q_.js} +6 -16
- package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +1 -0
- package/dist/client/chunks/{chart-config-radial-bar-DmxKx1R0.js → chart-config-radial-bar-Byx6qOPU.js} +6 -16
- package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +1 -0
- package/dist/client/chunks/{chart-config-tree-map-BI-oQStO.js → chart-config-tree-map-DVrvf3yQ.js} +6 -16
- package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +1 -0
- package/dist/client/chunks/{chart-config-waterfall-DSnyixbI.js → chart-config-waterfall-DmFeQdIk.js} +5 -10
- package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-Cm5jrpaw.js → chart-data-table-CKauQXme.js} +1046 -1121
- package/dist/client/chunks/chart-data-table-CKauQXme.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-Eke8IPtG.js → chart-funnel-CToKSBaL.js} +184 -222
- package/dist/client/chunks/chart-funnel-CToKSBaL.js.map +1 -0
- package/dist/client/chunks/chart-gauge-DTVezSk7.js +403 -0
- package/dist/client/chunks/chart-gauge-DTVezSk7.js.map +1 -0
- package/dist/client/chunks/chart-heat-map-DTuUl0BR.js +236 -0
- package/dist/client/chunks/chart-heat-map-DTuUl0BR.js.map +1 -0
- package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js +408 -0
- package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js.map +1 -0
- package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js +244 -0
- package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js.map +1 -0
- package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js +185 -0
- package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js.map +1 -0
- package/dist/client/chunks/chart-line-DKgrQA6c.js +101 -0
- package/dist/client/chunks/chart-line-DKgrQA6c.js.map +1 -0
- package/dist/client/chunks/{chart-markdown-BPW-EAm9.js → chart-markdown-CV75S_zL.js} +1359 -1240
- package/dist/client/chunks/chart-markdown-CV75S_zL.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-BI3kADCp.js → chart-measure-profile-Ket8fJyf.js} +7 -7
- package/dist/client/chunks/{chart-measure-profile-BI3kADCp.js.map → chart-measure-profile-Ket8fJyf.js.map} +1 -1
- package/dist/client/chunks/chart-pie-ByieAX5H.js +119 -0
- package/dist/client/chunks/chart-pie-ByieAX5H.js.map +1 -0
- package/dist/client/chunks/chart-radar-CiSwHWp4.js +138 -0
- package/dist/client/chunks/chart-radar-CiSwHWp4.js.map +1 -0
- package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js +122 -0
- package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js.map +1 -0
- package/dist/client/chunks/{chart-sankey-CFzjGvZX.js → chart-sankey-DjrvKw6K.js} +36 -39
- package/dist/client/chunks/{chart-sankey-CFzjGvZX.js.map → chart-sankey-DjrvKw6K.js.map} +1 -1
- package/dist/client/chunks/chart-scatter-Dd9WFqnS.js +258 -0
- package/dist/client/chunks/chart-scatter-Dd9WFqnS.js.map +1 -0
- package/dist/client/chunks/{chart-sunburst-91Q2tzaB.js → chart-sunburst-leGpuDj7.js} +3 -3
- package/dist/client/chunks/{chart-sunburst-91Q2tzaB.js.map → chart-sunburst-leGpuDj7.js.map} +1 -1
- package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js +323 -0
- package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js.map +1 -0
- package/dist/client/chunks/{chart-waterfall-DcHbbPaG.js → chart-waterfall-DyvQReN5.js} +7 -7
- package/dist/client/chunks/{chart-waterfall-DcHbbPaG.js.map → chart-waterfall-DyvQReN5.js.map} +1 -1
- package/dist/client/chunks/{charts-core-CrBDYN6N.js → charts-core-DaXSt1Dd.js} +2 -2
- package/dist/client/chunks/{charts-core-CrBDYN6N.js.map → charts-core-DaXSt1Dd.js.map} +1 -1
- package/dist/client/chunks/charts-loader-DdTeCeNo.js +84 -0
- package/dist/client/chunks/charts-loader-DdTeCeNo.js.map +1 -0
- package/dist/client/chunks/{core-DsAWNRRv.js → core-D7vPfUIe.js} +2 -2
- package/dist/client/chunks/{core-DsAWNRRv.js.map → core-D7vPfUIe.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-oyr2wENY.js → nl-NL-2zTAWTej.js} +8 -2
- package/dist/client/chunks/{nl-NL-oyr2wENY.js.map → nl-NL-2zTAWTej.js.map} +1 -1
- package/dist/client/chunks/retention-ChW9jYdy.js.map +1 -1
- package/dist/client/chunks/{schema-visualization-BszcrmZX.js → schema-visualization-Cb_E9_Gd.js} +12 -12
- package/dist/client/chunks/{schema-visualization-BszcrmZX.js.map → schema-visualization-Cb_E9_Gd.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-B5wCDJSj.js → useDirtyStateTracking-MbpxH_v6.js} +95 -84
- package/dist/client/chunks/useDirtyStateTracking-MbpxH_v6.js.map +1 -0
- package/dist/client/chunks/{useExplainAI-CCeCYzDm.js → useExplainAI-evnZkjCY.js} +14 -14
- package/dist/client/chunks/{useExplainAI-CCeCYzDm.js.map → useExplainAI-evnZkjCY.js.map} +1 -1
- package/dist/client/chunks/{utils-kqa-JIMg.js → utils-3P6z1vz5.js} +3 -3
- package/dist/client/chunks/{utils-kqa-JIMg.js.map → utils-3P6z1vz5.js.map} +1 -1
- package/dist/client/chunks/{vendor-0hJNlZXQ.js → vendor-DSpR0IW6.js} +43 -43
- package/dist/client/chunks/{vendor-0hJNlZXQ.js.map → vendor-DSpR0IW6.js.map} +1 -1
- package/dist/client/components/AgenticNotebook/agentChatParts.d.ts +34 -0
- package/dist/client/components/AgenticNotebook/chatMessageParts.d.ts +39 -0
- package/dist/client/components/AgenticNotebook/useAgentChatController.d.ts +25 -0
- package/dist/client/components/AgenticNotebook/useNotebookAutosave.d.ts +12 -0
- package/dist/client/components/AnalysisBuilder/AnalysisAIPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisAxisDropZone.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisChartConfigPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisFilterGroup.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisFilterItem.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisFilterSection.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisModeErrorBoundary.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisQueryPanelParts.d.ts +64 -0
- package/dist/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +67 -0
- package/dist/client/components/AnalysisBuilder/BreakdownComparisonToggle.d.ts +13 -0
- package/dist/client/components/AnalysisBuilder/BreakdownRow.d.ts +26 -0
- package/dist/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/ExecutionPlanPanelParts.d.ts +22 -0
- package/dist/client/components/AnalysisBuilder/ExplainAIPanel.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/FieldDetailPanel.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/FieldSearchItem.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/FieldSearchModal.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/FieldSearchResults.d.ts +16 -0
- package/dist/client/components/AnalysisBuilder/FilterConfigModal.d.ts +2 -1
- package/dist/client/components/AnalysisBuilder/FilterValueInput.d.ts +63 -0
- package/dist/client/components/AnalysisBuilder/FlowDepthControls.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/FlowVisualizationPicker.d.ts +7 -0
- package/dist/client/components/AnalysisBuilder/LegacyBooleanOptions.d.ts +8 -0
- package/dist/client/components/AnalysisBuilder/LimitSection.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/MetricRow.d.ts +23 -0
- package/dist/client/components/AnalysisBuilder/SectionHeading.d.ts +1 -1
- package/dist/client/components/AnalysisBuilder/SortToggleButton.d.ts +13 -0
- package/dist/client/components/AnalysisBuilder/StringArrayInput.d.ts +17 -0
- package/dist/client/components/AnalysisBuilder/filterConfigModalUtils.d.ts +30 -0
- package/dist/client/components/AnalysisBuilder/hooks/useAnalysisBuilderImperativeHandle.d.ts +13 -0
- package/dist/client/components/AnalysisBuilder/hooks/useDragReorder.d.ts +25 -0
- package/dist/client/components/AnalysisBuilder/hooks/useFieldSearchKeyboard.d.ts +11 -0
- package/dist/client/components/AnalysisBuilder/utils/axisConfigUtils.d.ts +23 -0
- package/dist/client/components/AnalysisBuilder/utils/executionPlanMarkdown.d.ts +8 -0
- package/dist/client/components/AnalysisBuilder/utils/fieldUtils.d.ts +5 -0
- package/dist/client/components/AnalysisBuilder/utils/resultsPanelDerive.d.ts +68 -0
- package/dist/client/components/AnalysisBuilder/utils/shareStateUtils.d.ts +68 -0
- package/dist/client/components/AnalysisBuilder/utils/sortUtils.d.ts +7 -0
- package/dist/client/components/AnalyticsDashboard.d.ts +1 -1
- package/dist/client/components/AnalyticsPage.d.ts +1 -1
- package/dist/client/components/ChartErrorBoundary.d.ts +1 -1
- package/dist/client/components/ChartTypeSelector.d.ts +1 -1
- package/dist/client/components/ColorPaletteSelector.d.ts +1 -1
- package/dist/client/components/DashboardEditModal.d.ts +2 -1
- package/dist/client/components/DashboardFilters/CompactFilterBarParts.d.ts +26 -0
- package/dist/client/components/DashboardFilters/DashboardFilterConfigModal.d.ts +1 -1
- package/dist/client/components/DashboardFilters/DashboardFilterConfigModalParts.d.ts +27 -0
- package/dist/client/components/DashboardFilters/DashboardFilterItem.d.ts +1 -1
- package/dist/client/components/DashboardFilters/DashboardFilterValueInput.d.ts +39 -0
- package/dist/client/components/DashboardFilters/dashboardFilterConfigModalUtils.d.ts +21 -0
- package/dist/client/components/DashboardFilters/useCompactFilterBar.d.ts +19 -0
- package/dist/client/components/DashboardFilters/useDashboardFilterConfigModal.d.ts +69 -0
- package/dist/client/components/DashboardFilters/useDateRangeState.d.ts +19 -0
- package/dist/client/components/DashboardFilters/useFilterDropdowns.d.ts +21 -0
- package/dist/client/components/DashboardFilters/useFilterValueFetch.d.ts +23 -0
- package/dist/client/components/DashboardGrid.d.ts +1 -1
- package/dist/client/components/DashboardPortletCard.d.ts +2 -57
- package/dist/client/components/DashboardThumbnailPlaceholder.d.ts +1 -1
- package/dist/client/components/DataBrowser/DataBrowserSidebar.d.ts +1 -1
- package/dist/client/components/DataBrowser/DataBrowserToolbar.d.ts +1 -1
- package/dist/client/components/DataBrowser/index.d.ts +1 -1
- package/dist/client/components/DataHistogram.d.ts +1 -1
- package/dist/client/components/DebugModal.d.ts +1 -1
- package/dist/client/components/DrillBreadcrumb.d.ts +2 -1
- package/dist/client/components/LoadingIndicator.d.ts +1 -1
- package/dist/client/components/MobileStackedLayout.d.ts +1 -1
- package/dist/client/components/PortletAnalysisModal.d.ts +1 -1
- package/dist/client/components/PortletContainer.d.ts +1 -1
- package/dist/client/components/PortletFilterConfigModal.d.ts +6 -4
- package/dist/client/components/RowManagedLayout.d.ts +1 -1
- package/dist/client/components/ScaledGridWrapper.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/CubeNode.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/FieldDetailPanel.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/RelationshipEdge.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/SchemaVisualizationLazy.d.ts +1 -1
- package/dist/client/components/SchemaVisualization/index.d.ts +1 -1
- package/dist/client/components/TextPortletModal.d.ts +1 -1
- package/dist/client/components/analyticsPortlet/PortletChart.d.ts +31 -0
- package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +35 -0
- package/dist/client/components/analyticsPortlet/PortletStates.d.ts +65 -0
- package/dist/client/components/analyticsPortlet/parsePortletQuery.d.ts +22 -0
- package/dist/client/components/analyticsPortlet/portletRenderState.d.ts +31 -0
- package/dist/client/components/analyticsPortlet/usePortletDebugData.d.ts +37 -0
- package/dist/client/components/analyticsPortlet/usePortletDrillState.d.ts +17 -0
- package/dist/client/components/analyticsPortlet/usePortletQueryResults.d.ts +37 -0
- package/dist/client/components/charts/ActivityGridChart.helpers.d.ts +33 -0
- package/dist/client/components/charts/ActivityGridChart.render.d.ts +31 -0
- package/dist/client/components/charts/AxisFormatControls.d.ts +5 -3
- package/dist/client/components/charts/BarChart.helpers.d.ts +23 -0
- package/dist/client/components/charts/BarSeries.d.ts +29 -0
- package/dist/client/components/charts/BubbleChart.helpers.d.ts +43 -0
- package/dist/client/components/charts/BubbleChart.render.d.ts +21 -0
- package/dist/client/components/charts/ChartContainer.d.ts +1 -1
- package/dist/client/components/charts/ChartLegend.d.ts +1 -1
- package/dist/client/components/charts/ChartStates.d.ts +38 -0
- package/dist/client/components/charts/ChartTooltip.d.ts +1 -1
- package/dist/client/components/charts/FunnelChart.helpers.d.ts +25 -0
- package/dist/client/components/charts/FunnelViews.d.ts +16 -0
- package/dist/client/components/charts/HeatMapCanvas.d.ts +25 -0
- package/dist/client/components/charts/HeatMapChart.helpers.d.ts +64 -0
- package/dist/client/components/charts/KpiDelta.helpers.d.ts +20 -0
- package/dist/client/components/charts/KpiNumber.helpers.d.ts +30 -0
- package/dist/client/components/charts/KpiStates.d.ts +19 -0
- package/dist/client/components/charts/MissingDependencyFallback.d.ts +1 -1
- package/dist/client/components/charts/ScatterChart.helpers.d.ts +43 -0
- package/dist/client/components/charts/ScatterSeries.d.ts +17 -0
- package/dist/client/components/charts/ScatterTooltip.d.ts +21 -0
- package/dist/client/components/charts/TreeMapChart.helpers.d.ts +37 -0
- package/dist/client/components/charts/TreeMapContent.d.ts +24 -0
- package/dist/client/components/charts/TreeMapLegend.d.ts +13 -0
- package/dist/client/components/charts/cartesianChartHelpers.d.ts +126 -0
- package/dist/client/components/charts/chartAxisResolution.d.ts +32 -0
- package/dist/client/components/charts/chartScaffolding.d.ts +77 -0
- package/dist/client/components/charts/gaugeChartHelpers.d.ts +36 -0
- package/dist/client/components/charts/kpiTextHelpers.d.ts +46 -0
- package/dist/client/components/charts/radarChartHelpers.d.ts +14 -0
- package/dist/client/components/charts/radialBarChartHelpers.d.ts +22 -0
- package/dist/client/components/charts/useChartDimensions.d.ts +20 -0
- package/dist/client/components/charts/useKpiDimensions.d.ts +30 -0
- package/dist/client/components/dashboard/DashboardContext.d.ts +2 -2
- package/dist/client/components/dashboard/DashboardCoordinator.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardEditBar.d.ts +5 -0
- package/dist/client/components/dashboard/DashboardFilterBar.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardGridSurface.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardModals.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardProvider.d.ts +1 -1
- package/dist/client/components/dashboard/DashboardToolbar.d.ts +1 -1
- package/dist/client/components/dashboard/LayoutModeToggle.d.ts +10 -0
- package/dist/client/components/dashboard/dashboardGridUtils.d.ts +1 -1
- package/dist/client/components/dashboardPortletCard/FilterFieldChip.d.ts +12 -0
- package/dist/client/components/dashboardPortletCard/PortletCardHeader.d.ts +43 -0
- package/dist/client/components/dashboardPortletCard/cardStyles.d.ts +33 -0
- package/dist/client/components/dashboardPortletCard/filterField.d.ts +12 -0
- package/dist/client/components/dashboardPortletCard/propsEqual.d.ts +55 -0
- package/dist/client/components/dashboardPortletCard/usePortletCardActions.d.ts +16 -0
- package/dist/client/components/portletAnalysisModal/saveValidation.d.ts +8 -0
- package/dist/client/components/shared/dateRangeUtils.d.ts +40 -0
- package/dist/client/components/shared/filterDisplayUtils.d.ts +10 -0
- package/dist/client/components/shared/filterItem/FilterDateRangeSelector.d.ts +17 -0
- package/dist/client/components/shared/filterItem/FilterFieldDropdown.d.ts +16 -0
- package/dist/client/components/shared/filterItem/dateRangeSync.d.ts +14 -0
- package/dist/client/components/shared/filterItem/fieldVisuals.d.ts +5 -0
- package/dist/client/components/shared/filterValueSelector/FilterValueInputs.d.ts +55 -0
- package/dist/client/components/shared/filterValueSelector/useFilterValueSelectorState.d.ts +25 -0
- package/dist/client/components/shared/queryFieldUtils.d.ts +21 -0
- package/dist/client/components/shared/utils.d.ts +4 -43
- package/dist/client/components.js +3 -3
- package/dist/client/hooks/agentChatStream.d.ts +39 -0
- package/dist/client/hooks/analysisQueryExecutionModes.d.ts +133 -0
- package/dist/client/hooks/dashboard/useDashboardController.d.ts +2 -2
- package/dist/client/hooks/drillNavigation.d.ts +25 -0
- package/dist/client/hooks/useDashboardHook.d.ts +2 -2
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons.d.ts +1 -1
- package/dist/client/icons.js +2 -2
- package/dist/client/index.js +816 -669
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers/CubeApiProvider.d.ts +1 -1
- package/dist/client/providers/CubeFeaturesProvider.d.ts +1 -1
- package/dist/client/providers/CubeMetaProvider.d.ts +1 -1
- package/dist/client/providers/CubeProvider.d.ts +1 -1
- package/dist/client/providers/I18nProvider.d.ts +1 -1
- package/dist/client/providers.js +3 -3
- package/dist/client/schema.js +1 -1
- package/dist/client/shared/chartConfigBuilders.d.ts +18 -0
- package/dist/client/shared/components/QueryAnalysisPanel.sections.d.ts +41 -0
- package/dist/client/shared/queryTransforms.d.ts +20 -0
- package/dist/client/shared/utils.d.ts +2 -4
- package/dist/client/stores/analysisBuilderStore.d.ts +1 -1
- package/dist/client/stores/dashboardStore.d.ts +1 -1
- package/dist/client/stores/dataBrowserStore.d.ts +1 -1
- package/dist/client/stores/notebookStore.d.ts +1 -1
- package/dist/client/stores/optionsToAnalysisConfig.d.ts +17 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/types/drill.d.ts +1 -1
- package/dist/client/types.d.ts +7 -2
- package/dist/client/utils/axisValueFormatting.d.ts +32 -0
- package/dist/client/utils/drillQueryBuilder.d.ts +2 -2
- package/dist/client/utils/filterUtils.d.ts +33 -5
- package/dist/client/utils/joinReachability.d.ts +27 -0
- package/dist/client/utils/timeValueFormatting.d.ts +32 -0
- package/dist/client/utils.js +6 -6
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +55 -55
- package/dist/server/google-BOnRIN1w.cjs +2 -0
- package/dist/{adapters/google-CFYljAOF.js → server/google-CvKM9yVM.js} +83 -71
- package/dist/server/index.cjs +179 -211
- package/dist/server/index.d.ts +2 -5050
- package/dist/server/index.js +6360 -6462
- package/dist/{adapters/openai-y7GhJNdn.js → server/openai-B5jEiqiB.js} +776 -719
- package/dist/server/openai-D0musiYP.cjs +17 -0
- package/dist/{adapters/openai-DiVskd89.js → server/openai-cDlFSTk6.js} +61 -59
- package/dist/server/openai-vXvLni8v.cjs +1 -0
- package/dist/server/server/adapters/base-adapter.d.ts +332 -0
- package/dist/server/server/adapters/databend-adapter.d.ts +63 -0
- package/dist/server/server/adapters/duckdb-adapter.d.ts +68 -0
- package/dist/server/server/adapters/mysql-adapter.d.ts +65 -0
- package/dist/server/server/adapters/postgres-adapter.d.ts +55 -0
- package/dist/server/server/adapters/singlestore-adapter.d.ts +4 -0
- package/dist/server/server/adapters/snowflake-adapter.d.ts +53 -0
- package/dist/server/server/adapters/sqlite-adapter.d.ts +120 -0
- package/dist/server/server/adapters/window-function-builder.d.ts +11 -0
- package/dist/server/server/agent/chart-validation.d.ts +22 -0
- package/dist/server/server/agent/handler-steps.d.ts +37 -0
- package/dist/server/server/agent/handler.d.ts +25 -0
- package/dist/server/server/agent/index.d.ts +11 -0
- package/dist/server/server/agent/providers/anthropic.d.ts +24 -0
- package/dist/server/server/agent/providers/factory.d.ts +12 -0
- package/dist/server/server/agent/providers/google.d.ts +23 -0
- package/dist/server/server/agent/providers/index.d.ts +6 -0
- package/dist/server/server/agent/providers/openai.d.ts +26 -0
- package/dist/server/server/agent/providers/types.d.ts +95 -0
- package/dist/server/server/agent/system-prompt.d.ts +5 -0
- package/dist/server/server/agent/tools.d.ts +28 -0
- package/dist/server/server/agent/types.d.ts +192 -0
- package/dist/server/server/ai/discovery-helpers.d.ts +29 -0
- package/dist/server/server/ai/discovery.d.ts +66 -0
- package/dist/server/server/ai/index.d.ts +10 -0
- package/dist/server/server/ai/mcp-prompts.d.ts +83 -0
- package/dist/server/server/ai/query-schema.d.ts +258 -0
- package/dist/server/server/ai/schemas.d.ts +63 -0
- package/dist/server/server/ai/suggestion-helpers.d.ts +33 -0
- package/dist/server/server/ai/suggestion.d.ts +16 -0
- package/dist/server/server/ai/validation-helpers.d.ts +21 -0
- package/dist/server/server/ai/validation.d.ts +31 -0
- package/dist/server/server/builders/analysis-utils.d.ts +106 -0
- package/dist/server/server/builders/comparison-query-builder.d.ts +70 -0
- package/dist/server/server/builders/cte-builder.d.ts +108 -0
- package/dist/server/server/builders/date-time-builder.d.ts +34 -0
- package/dist/server/server/builders/date-time-helpers.d.ts +34 -0
- package/dist/server/server/builders/filter-builder.d.ts +25 -0
- package/dist/server/server/builders/filter-operators.d.ts +23 -0
- package/dist/server/server/builders/flow-query-builder.d.ts +136 -0
- package/dist/server/server/builders/funnel-query-builder.d.ts +145 -0
- package/dist/server/server/builders/group-by-builder.d.ts +38 -0
- package/dist/server/server/builders/index.d.ts +13 -0
- package/dist/server/server/builders/measure-builder.d.ts +185 -0
- package/dist/server/server/builders/retention-query-builder.d.ts +98 -0
- package/dist/server/server/cache-providers/index.d.ts +5 -0
- package/dist/server/server/cache-providers/memory.d.ts +105 -0
- package/dist/server/server/cache-utils.d.ts +85 -0
- package/dist/server/server/compiler-metadata.d.ts +11 -0
- package/dist/server/server/compiler.d.ts +212 -0
- package/dist/server/server/cube-utils.d.ts +158 -0
- package/dist/server/server/database-utils.d.ts +18 -0
- package/dist/server/server/execution/annotation-builder.d.ts +12 -0
- package/dist/server/server/execution/filter-cache-preloader.d.ts +19 -0
- package/dist/server/server/execution/mode-router.d.ts +25 -0
- package/dist/server/server/execution/query-result-cache.d.ts +21 -0
- package/dist/server/server/execution/result-post-processor.d.ts +10 -0
- package/dist/server/server/executor.d.ts +186 -0
- package/dist/server/server/executors/base-executor.d.ts +16 -0
- package/dist/server/server/executors/databend-executor.d.ts +33 -0
- package/dist/server/server/executors/duckdb-executor.d.ts +33 -0
- package/dist/server/server/executors/explain-utils.d.ts +28 -0
- package/dist/server/server/executors/index.d.ts +21 -0
- package/dist/server/server/executors/mysql-executor.d.ts +27 -0
- package/dist/server/server/executors/postgres-executor.d.ts +27 -0
- package/dist/server/server/executors/singlestore-executor.d.ts +9 -0
- package/dist/server/server/executors/snowflake-executor.d.ts +33 -0
- package/dist/server/server/executors/sqlite-executor.d.ts +28 -0
- package/dist/server/server/explain/databend-parser.d.ts +16 -0
- package/dist/server/server/explain/duckdb-parser.d.ts +28 -0
- package/dist/server/server/explain/explain-tree.d.ts +20 -0
- package/dist/server/server/explain/index.d.ts +9 -0
- package/dist/server/server/explain/mysql-parser.d.ts +38 -0
- package/dist/server/server/explain/postgres-parser.d.ts +18 -0
- package/dist/server/server/explain/snowflake-parser.d.ts +17 -0
- package/dist/server/server/explain/sqlite-parser.d.ts +23 -0
- package/dist/server/server/filter-cache.d.ts +73 -0
- package/dist/server/server/gap-filler.d.ts +48 -0
- package/dist/server/server/index.d.ts +38 -0
- package/dist/server/server/logical-plan/cte-planner-helpers.d.ts +37 -0
- package/dist/server/server/logical-plan/cte-planner.d.ts +104 -0
- package/dist/server/server/logical-plan/filter-propagation.d.ts +44 -0
- package/dist/server/server/logical-plan/index.d.ts +19 -0
- package/dist/server/server/logical-plan/join-planner.d.ts +27 -0
- package/dist/server/server/logical-plan/logical-plan-builder.d.ts +58 -0
- package/dist/server/server/logical-plan/logical-planner.d.ts +39 -0
- package/dist/server/server/logical-plan/optimiser.d.ts +34 -0
- package/dist/server/server/logical-plan/plan-analysis-reporter.d.ts +59 -0
- package/dist/server/server/logical-plan/planner-utils.d.ts +20 -0
- package/dist/server/server/logical-plan/types.d.ts +199 -0
- package/dist/server/server/measure-classification.d.ts +40 -0
- package/dist/server/server/physical-plan/drizzle-plan-builder.d.ts +50 -0
- package/dist/server/server/physical-plan/drizzle-sql-builder.d.ts +118 -0
- package/dist/server/server/physical-plan/index.d.ts +2 -0
- package/dist/server/server/physical-plan/processors/cte-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/index.d.ts +8 -0
- package/dist/server/server/physical-plan/processors/joins-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/keys-dedup-processor.d.ts +13 -0
- package/dist/server/server/physical-plan/processors/multi-fact-processor.d.ts +13 -0
- package/dist/server/server/physical-plan/processors/predicates-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/selection-processor.d.ts +6 -0
- package/dist/server/server/physical-plan/processors/shared.d.ts +38 -0
- package/dist/server/server/physical-plan/processors/window-processor.d.ts +6 -0
- package/dist/server/server/prompts/explain-analysis-prompt.d.ts +47 -0
- package/dist/server/server/prompts/index.d.ts +27 -0
- package/dist/server/server/prompts/single-step-prompt.d.ts +31 -0
- package/dist/server/server/prompts/step0-validation-prompt.d.ts +39 -0
- package/dist/server/server/prompts/step1-shape-prompt.d.ts +29 -0
- package/dist/server/server/prompts/step2-complete-prompt.d.ts +19 -0
- package/dist/server/server/prompts/types.d.ts +37 -0
- package/dist/server/server/query-handlers.d.ts +79 -0
- package/dist/server/server/query-modes.d.ts +28 -0
- package/dist/server/server/query-validator.d.ts +9 -0
- package/dist/server/server/resolvers/calculated-measure-resolver.d.ts +98 -0
- package/dist/server/server/resolvers/index.d.ts +6 -0
- package/dist/server/server/resolvers/join-path-resolver.d.ts +158 -0
- package/dist/server/server/sql-format.d.ts +11 -0
- package/dist/server/server/template-substitution.d.ts +57 -0
- package/dist/server/server/types/analysis.d.ts +189 -0
- package/dist/server/server/types/cache.d.ts +132 -0
- package/dist/server/server/types/core.d.ts +164 -0
- package/dist/server/server/types/cube.d.ts +544 -0
- package/dist/server/server/types/executor.d.ts +156 -0
- package/dist/server/server/types/flow.d.ts +144 -0
- package/dist/server/server/types/funnel.d.ts +118 -0
- package/dist/server/server/types/index.d.ts +11 -0
- package/dist/server/server/types/metadata.d.ts +113 -0
- package/dist/server/server/types/query.d.ts +153 -0
- package/dist/server/server/types/retention.d.ts +141 -0
- package/dist/server/server/types/utils.d.ts +11 -0
- package/dist/server/server/types/validation.d.ts +14 -0
- package/package.json +15 -8
- package/dist/adapters/google-DUlXeeDA.cjs +0 -2
- package/dist/adapters/handler-C63rJUUK.cjs +0 -25
- package/dist/adapters/locale-CTNwPVZI.cjs +0 -198
- package/dist/adapters/locale-gU_d1Wja.js +0 -8249
- package/dist/adapters/mcp-transport-C4J4SAcn.cjs +0 -40
- package/dist/adapters/mcp-transport-CVUiifEc.js +0 -579
- package/dist/adapters/openai-6wrBvAnv.cjs +0 -1
- package/dist/adapters/openai-BDwb2u7y.cjs +0 -17
- package/dist/adapters/utils-CkEkU8Bo.cjs +0 -128
- package/dist/client/chunks/DashboardEditModal-6KRE36mm.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-x576-O5p.js.map +0 -1
- package/dist/client/chunks/analysis-builder-zd48FVJO.js +0 -5367
- package/dist/client/chunks/analysis-builder-zd48FVJO.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-CiHrLH6Y.js.map +0 -1
- package/dist/client/chunks/chart-area-CXFK-Grv.js +0 -450
- package/dist/client/chunks/chart-area-CXFK-Grv.js.map +0 -1
- package/dist/client/chunks/chart-bar-DKXfLoGG.js +0 -271
- package/dist/client/chunks/chart-bar-DKXfLoGG.js.map +0 -1
- package/dist/client/chunks/chart-bubble-DGkTQlxM.js +0 -273
- package/dist/client/chunks/chart-bubble-DGkTQlxM.js.map +0 -1
- package/dist/client/chunks/chart-config-area-Bq_UsW3x.js +0 -101
- package/dist/client/chunks/chart-config-area-Bq_UsW3x.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-_JEGZnAu.js +0 -95
- package/dist/client/chunks/chart-config-bar-_JEGZnAu.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-DJ-dWWXA.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-DSwC04l0.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-D6BIkHL3.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-Bx-V9a62.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-CcqC1u-8.js.map +0 -1
- package/dist/client/chunks/chart-config-line-Db3jDsWc.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-DD4SmRTF.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-CC2XAaGr.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-DmxKx1R0.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-BI-oQStO.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-DSnyixbI.js.map +0 -1
- package/dist/client/chunks/chart-data-table-Cm5jrpaw.js.map +0 -1
- package/dist/client/chunks/chart-funnel-Eke8IPtG.js.map +0 -1
- package/dist/client/chunks/chart-gauge-DeRZNsyl.js +0 -424
- package/dist/client/chunks/chart-gauge-DeRZNsyl.js.map +0 -1
- package/dist/client/chunks/chart-heat-map-C86thSJ4.js +0 -231
- package/dist/client/chunks/chart-heat-map-C86thSJ4.js.map +0 -1
- package/dist/client/chunks/chart-kpi-delta-CxOYD2f1.js +0 -343
- package/dist/client/chunks/chart-kpi-delta-CxOYD2f1.js.map +0 -1
- package/dist/client/chunks/chart-kpi-number-C6gWz-x4.js +0 -322
- package/dist/client/chunks/chart-kpi-number-C6gWz-x4.js.map +0 -1
- package/dist/client/chunks/chart-kpi-text-dDONrhS-.js +0 -149
- package/dist/client/chunks/chart-kpi-text-dDONrhS-.js.map +0 -1
- package/dist/client/chunks/chart-line-r4iWevKZ.js +0 -433
- package/dist/client/chunks/chart-line-r4iWevKZ.js.map +0 -1
- package/dist/client/chunks/chart-markdown-BPW-EAm9.js.map +0 -1
- package/dist/client/chunks/chart-pie-yqH2YVEI.js +0 -172
- package/dist/client/chunks/chart-pie-yqH2YVEI.js.map +0 -1
- package/dist/client/chunks/chart-radar-B-_3v-rE.js +0 -154
- package/dist/client/chunks/chart-radar-B-_3v-rE.js.map +0 -1
- package/dist/client/chunks/chart-radial-bar-C0EgzfAF.js +0 -148
- package/dist/client/chunks/chart-radial-bar-C0EgzfAF.js.map +0 -1
- package/dist/client/chunks/chart-scatter-DZPirzwX.js +0 -255
- package/dist/client/chunks/chart-scatter-DZPirzwX.js.map +0 -1
- package/dist/client/chunks/chart-tree-map-Bi4axCvh.js +0 -298
- package/dist/client/chunks/chart-tree-map-Bi4axCvh.js.map +0 -1
- package/dist/client/chunks/useDirtyStateTracking-B5wCDJSj.js.map +0 -1
- package/dist/server/google-DUlXeeDA.cjs +0 -2
- package/dist/server/openai-6wrBvAnv.cjs +0 -1
- package/dist/server/openai-BDwb2u7y.cjs +0 -17
- /package/dist/adapters/{express → adapters/express}/index.d.ts +0 -0
- /package/dist/adapters/{fastify → adapters/fastify}/index.d.ts +0 -0
- /package/dist/adapters/{hono → adapters/hono}/index.d.ts +0 -0
- /package/dist/adapters/{locale.d.ts → adapters/locale.d.ts} +0 -0
- /package/dist/adapters/{mcp-tools.d.ts → adapters/mcp-tools.d.ts} +0 -0
- /package/dist/adapters/{mcp-transport.d.ts → adapters/mcp-transport.d.ts} +0 -0
- /package/dist/adapters/{nextjs → adapters/nextjs}/index.d.ts +0 -0
- /package/dist/adapters/{types.d.ts → adapters/types.d.ts} +0 -0
|
@@ -119,7 +119,7 @@ var ce = (e, t) => {
|
|
|
119
119
|
} catch {
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
}, ue = (e) => new Promise((t) => setTimeout(t, e)), de = "6.
|
|
122
|
+
}, ue = (e) => new Promise((t) => setTimeout(t, e)), de = "6.42.0", fe = () => typeof window < "u" && window.document !== void 0 && typeof navigator < "u";
|
|
123
123
|
function pe() {
|
|
124
124
|
return typeof Deno < "u" && Deno.build != null ? "deno" : typeof EdgeRuntime < "u" ? "edge" : Object.prototype.toString.call(globalThis.process === void 0 ? 0 : globalThis.process) === "[object process]" ? "node" : "unknown";
|
|
125
125
|
}
|
|
@@ -566,9 +566,9 @@ function D(e) {
|
|
|
566
566
|
};
|
|
567
567
|
return nt.set(t, [n, i]), i;
|
|
568
568
|
}
|
|
569
|
-
var
|
|
569
|
+
var rt = (e) => (e.options && (e.options = { ...e.options }, delete e.options.headers), e.headers &&= Object.fromEntries((e.headers instanceof Headers ? [...e.headers] : Object.entries(e.headers)).map(([e, t]) => [e, e.toLowerCase() === "authorization" || e.toLowerCase() === "api-key" || e.toLowerCase() === "x-api-key" || e.toLowerCase() === "cookie" || e.toLowerCase() === "set-cookie" ? "***" : t])), "retryOfRequestLogID" in e && (e.retryOfRequestLogID && (e.retryOf = e.retryOfRequestLogID), delete e.retryOfRequestLogID), e), it, at = class n {
|
|
570
570
|
constructor(t, n, r) {
|
|
571
|
-
this.iterator = t,
|
|
571
|
+
this.iterator = t, it.set(this, void 0), this.controller = n, e(this, it, r, "f");
|
|
572
572
|
}
|
|
573
573
|
static fromSSEResponse(e, t, i, s) {
|
|
574
574
|
let c = !1, l = i ? D(i) : console;
|
|
@@ -577,7 +577,7 @@ var O = (e) => (e.options && (e.options = { ...e.options }, delete e.options.hea
|
|
|
577
577
|
c = !0;
|
|
578
578
|
let n = !1;
|
|
579
579
|
try {
|
|
580
|
-
for await (let r of
|
|
580
|
+
for await (let r of ot(e, t)) if (!n) {
|
|
581
581
|
if (r.data.startsWith("[DONE]")) {
|
|
582
582
|
n = !0;
|
|
583
583
|
continue;
|
|
@@ -641,7 +641,7 @@ var O = (e) => (e.options && (e.options = { ...e.options }, delete e.options.hea
|
|
|
641
641
|
}
|
|
642
642
|
return new n(c, t, i);
|
|
643
643
|
}
|
|
644
|
-
[(
|
|
644
|
+
[(it = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() {
|
|
645
645
|
return this.iterator();
|
|
646
646
|
}
|
|
647
647
|
tee() {
|
|
@@ -652,7 +652,7 @@ var O = (e) => (e.options && (e.options = { ...e.options }, delete e.options.hea
|
|
|
652
652
|
}
|
|
653
653
|
return t.shift();
|
|
654
654
|
} });
|
|
655
|
-
return [new n(() => a(e), this.controller, t(this,
|
|
655
|
+
return [new n(() => a(e), this.controller, t(this, it, "f")), new n(() => a(r), this.controller, t(this, it, "f"))];
|
|
656
656
|
}
|
|
657
657
|
toReadableStream() {
|
|
658
658
|
let e = this, t;
|
|
@@ -676,10 +676,10 @@ var O = (e) => (e.options && (e.options = { ...e.options }, delete e.options.hea
|
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
678
|
};
|
|
679
|
-
async function*
|
|
679
|
+
async function* ot(e, t) {
|
|
680
680
|
if (!e.body) throw t.abort(), globalThis.navigator !== void 0 && globalThis.navigator.product === "ReactNative" ? new a("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api") : new a("Attempted to iterate over a response with no body");
|
|
681
|
-
let n = new
|
|
682
|
-
for await (let e of
|
|
681
|
+
let n = new ct(), r = new Je(), i = Ce(e.body);
|
|
682
|
+
for await (let e of st(i)) for (let t of r.decode(e)) {
|
|
683
683
|
let e = n.decode(t);
|
|
684
684
|
e && (yield e);
|
|
685
685
|
}
|
|
@@ -688,7 +688,7 @@ async function* at(e, t) {
|
|
|
688
688
|
t && (yield t);
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
async function*
|
|
691
|
+
async function* st(e) {
|
|
692
692
|
let t = new Uint8Array();
|
|
693
693
|
for await (let n of e) {
|
|
694
694
|
if (n == null) continue;
|
|
@@ -699,7 +699,7 @@ async function* ot(e) {
|
|
|
699
699
|
}
|
|
700
700
|
t.length > 0 && (yield t);
|
|
701
701
|
}
|
|
702
|
-
var
|
|
702
|
+
var ct = class {
|
|
703
703
|
constructor() {
|
|
704
704
|
this.event = null, this.data = [], this.chunks = [];
|
|
705
705
|
}
|
|
@@ -714,11 +714,11 @@ var st = class {
|
|
|
714
714
|
return this.event = null, this.data = [], this.chunks = [], e;
|
|
715
715
|
}
|
|
716
716
|
if (this.chunks.push(e), e.startsWith(":")) return null;
|
|
717
|
-
let [t, n, r] =
|
|
717
|
+
let [t, n, r] = lt(e, ":");
|
|
718
718
|
return r.startsWith(" ") && (r = r.substring(1)), t === "event" ? this.event = r : t === "data" && this.data.push(r), null;
|
|
719
719
|
}
|
|
720
720
|
};
|
|
721
|
-
function
|
|
721
|
+
function lt(e, t) {
|
|
722
722
|
let n = e.indexOf(t);
|
|
723
723
|
return n === -1 ? [
|
|
724
724
|
e,
|
|
@@ -732,15 +732,15 @@ function ct(e, t) {
|
|
|
732
732
|
}
|
|
733
733
|
//#endregion
|
|
734
734
|
//#region node_modules/openai/internal/parse.mjs
|
|
735
|
-
async function
|
|
735
|
+
async function ut(e, t) {
|
|
736
736
|
let { response: n, requestLogID: r, retryOfRequestLogID: i, startTime: a } = t, o = await (async () => {
|
|
737
|
-
if (t.options.stream) return D(e).debug("response", n.status, n.url, n.headers, n.body), t.options.__streamClass ? t.options.__streamClass.fromSSEResponse(n, t.controller, e, t.options.__synthesizeEventData) :
|
|
737
|
+
if (t.options.stream) return D(e).debug("response", n.status, n.url, n.headers, n.body), t.options.__streamClass ? t.options.__streamClass.fromSSEResponse(n, t.controller, e, t.options.__synthesizeEventData) : at.fromSSEResponse(n, t.controller, e, t.options.__synthesizeEventData);
|
|
738
738
|
if (n.status === 204) return null;
|
|
739
739
|
if (t.options.__binaryResponse) return n;
|
|
740
740
|
let r = n.headers.get("content-type")?.split(";")[0]?.trim();
|
|
741
|
-
return r?.includes("application/json") || r?.endsWith("+json") ? n.headers.get("content-length") === "0" ? void 0 :
|
|
741
|
+
return r?.includes("application/json") || r?.endsWith("+json") ? n.headers.get("content-length") === "0" ? void 0 : dt(await n.json(), n) : await n.text();
|
|
742
742
|
})();
|
|
743
|
-
return D(e).debug(`[${r}] response parsed`,
|
|
743
|
+
return D(e).debug(`[${r}] response parsed`, rt({
|
|
744
744
|
retryOfRequestLogID: i,
|
|
745
745
|
url: n.url,
|
|
746
746
|
status: n.status,
|
|
@@ -748,7 +748,7 @@ async function lt(e, t) {
|
|
|
748
748
|
durationMs: Date.now() - a
|
|
749
749
|
})), o;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function dt(e, t) {
|
|
752
752
|
return !e || typeof e != "object" || Array.isArray(e) ? e : Object.defineProperty(e, "_request_id", {
|
|
753
753
|
value: t.headers.get("x-request-id"),
|
|
754
754
|
enumerable: !1
|
|
@@ -756,14 +756,14 @@ function ut(e, t) {
|
|
|
756
756
|
}
|
|
757
757
|
//#endregion
|
|
758
758
|
//#region node_modules/openai/core/api-promise.mjs
|
|
759
|
-
var
|
|
760
|
-
constructor(t, n, r =
|
|
759
|
+
var ft, pt = class n extends Promise {
|
|
760
|
+
constructor(t, n, r = ut) {
|
|
761
761
|
super((e) => {
|
|
762
762
|
e(null);
|
|
763
|
-
}), this.responsePromise = n, this.parseResponse = r,
|
|
763
|
+
}), this.responsePromise = n, this.parseResponse = r, ft.set(this, void 0), e(this, ft, t, "f");
|
|
764
764
|
}
|
|
765
765
|
_thenUnwrap(e) {
|
|
766
|
-
return new n(t(this,
|
|
766
|
+
return new n(t(this, ft, "f"), this.responsePromise, async (t, n) => dt(e(await this.parseResponse(t, n), n), n.response));
|
|
767
767
|
}
|
|
768
768
|
asResponse() {
|
|
769
769
|
return this.responsePromise.then((e) => e.response);
|
|
@@ -777,7 +777,7 @@ var dt, ft = class n extends Promise {
|
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
779
|
parse() {
|
|
780
|
-
return this.parsedPromise ||= this.responsePromise.then((e) => this.parseResponse(t(this,
|
|
780
|
+
return this.parsedPromise ||= this.responsePromise.then((e) => this.parseResponse(t(this, ft, "f"), e)), this.parsedPromise;
|
|
781
781
|
}
|
|
782
782
|
then(e, t) {
|
|
783
783
|
return this.parse().then(e, t);
|
|
@@ -789,12 +789,12 @@ var dt, ft = class n extends Promise {
|
|
|
789
789
|
return this.parse().finally(e);
|
|
790
790
|
}
|
|
791
791
|
};
|
|
792
|
-
|
|
792
|
+
ft = /* @__PURE__ */ new WeakMap();
|
|
793
793
|
//#endregion
|
|
794
794
|
//#region node_modules/openai/core/pagination.mjs
|
|
795
|
-
var
|
|
795
|
+
var mt, ht = class {
|
|
796
796
|
constructor(t, n, r, i) {
|
|
797
|
-
|
|
797
|
+
mt.set(this, void 0), e(this, mt, t, "f"), this.options = i, this.response = n, this.body = r;
|
|
798
798
|
}
|
|
799
799
|
hasNextPage() {
|
|
800
800
|
return this.getPaginatedItems().length ? this.nextPageRequestOptions() != null : !1;
|
|
@@ -802,24 +802,24 @@ var pt, mt = class {
|
|
|
802
802
|
async getNextPage() {
|
|
803
803
|
let e = this.nextPageRequestOptions();
|
|
804
804
|
if (!e) throw new a("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");
|
|
805
|
-
return await t(this,
|
|
805
|
+
return await t(this, mt, "f").requestAPIList(this.constructor, e);
|
|
806
806
|
}
|
|
807
807
|
async *iterPages() {
|
|
808
808
|
let e = this;
|
|
809
809
|
for (yield e; e.hasNextPage();) e = await e.getNextPage(), yield e;
|
|
810
810
|
}
|
|
811
|
-
async *[(
|
|
811
|
+
async *[(mt = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() {
|
|
812
812
|
for await (let e of this.iterPages()) for (let t of e.getPaginatedItems()) yield t;
|
|
813
813
|
}
|
|
814
|
-
},
|
|
814
|
+
}, gt = class extends pt {
|
|
815
815
|
constructor(e, t, n) {
|
|
816
|
-
super(e, t, async (e, t) => new n(e, t.response, await
|
|
816
|
+
super(e, t, async (e, t) => new n(e, t.response, await ut(e, t), t.options));
|
|
817
817
|
}
|
|
818
818
|
async *[Symbol.asyncIterator]() {
|
|
819
819
|
let e = await this;
|
|
820
820
|
for await (let t of e) yield t;
|
|
821
821
|
}
|
|
822
|
-
},
|
|
822
|
+
}, O = class extends ht {
|
|
823
823
|
constructor(e, t, n, r) {
|
|
824
824
|
super(e, t, n, r), this.data = n.data || [], this.object = n.object;
|
|
825
825
|
}
|
|
@@ -829,7 +829,7 @@ var pt, mt = class {
|
|
|
829
829
|
nextPageRequestOptions() {
|
|
830
830
|
return null;
|
|
831
831
|
}
|
|
832
|
-
},
|
|
832
|
+
}, k = class extends ht {
|
|
833
833
|
constructor(e, t, n, r) {
|
|
834
834
|
super(e, t, n, r), this.data = n.data || [], this.has_more = n.has_more || !1;
|
|
835
835
|
}
|
|
@@ -849,7 +849,7 @@ var pt, mt = class {
|
|
|
849
849
|
}
|
|
850
850
|
} : null;
|
|
851
851
|
}
|
|
852
|
-
},
|
|
852
|
+
}, A = class extends ht {
|
|
853
853
|
constructor(e, t, n, r) {
|
|
854
854
|
super(e, t, n, r), this.data = n.data || [], this.has_more = n.has_more || !1, this.last_id = n.last_id || "";
|
|
855
855
|
}
|
|
@@ -869,7 +869,7 @@ var pt, mt = class {
|
|
|
869
869
|
}
|
|
870
870
|
} : null;
|
|
871
871
|
}
|
|
872
|
-
},
|
|
872
|
+
}, j = class extends ht {
|
|
873
873
|
constructor(e, t, n, r) {
|
|
874
874
|
super(e, t, n, r), this.data = n.data || [], this.has_more = n.has_more || !1, this.next = n.next || null;
|
|
875
875
|
}
|
|
@@ -889,10 +889,10 @@ var pt, mt = class {
|
|
|
889
889
|
}
|
|
890
890
|
} : null;
|
|
891
891
|
}
|
|
892
|
-
},
|
|
892
|
+
}, _t = {
|
|
893
893
|
jwt: "urn:ietf:params:oauth:token-type:jwt",
|
|
894
894
|
id: "urn:ietf:params:oauth:token-type:id_token"
|
|
895
|
-
},
|
|
895
|
+
}, vt = "urn:ietf:params:oauth:grant-type:token-exchange", yt = class {
|
|
896
896
|
constructor(e, t) {
|
|
897
897
|
this.cachedToken = null, this.refreshPromise = null, this.tokenExchangeUrl = "https://auth.openai.com/oauth/token", this.config = e, this.fetch = t ?? be();
|
|
898
898
|
}
|
|
@@ -912,9 +912,9 @@ var pt, mt = class {
|
|
|
912
912
|
}
|
|
913
913
|
async refreshToken() {
|
|
914
914
|
let e = {
|
|
915
|
-
grant_type:
|
|
915
|
+
grant_type: vt,
|
|
916
916
|
subject_token: await this.config.provider.getToken(),
|
|
917
|
-
subject_token_type:
|
|
917
|
+
subject_token_type: _t[this.config.provider.tokenType],
|
|
918
918
|
identity_provider_id: this.config.identityProviderId,
|
|
919
919
|
service_account_id: this.config.serviceAccountId
|
|
920
920
|
};
|
|
@@ -947,27 +947,27 @@ var pt, mt = class {
|
|
|
947
947
|
invalidateToken() {
|
|
948
948
|
this.cachedToken = null, this.refreshPromise = null;
|
|
949
949
|
}
|
|
950
|
-
},
|
|
950
|
+
}, bt = () => {
|
|
951
951
|
if (typeof File > "u") {
|
|
952
952
|
let { process: e } = globalThis, t = typeof e?.versions?.node == "string" && parseInt(e.versions.node.split(".")) < 20;
|
|
953
953
|
throw Error("`File` is not defined as a global, which is required for file uploads." + (t ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : ""));
|
|
954
954
|
}
|
|
955
955
|
};
|
|
956
|
-
function
|
|
957
|
-
return
|
|
956
|
+
function xt(e, t, n) {
|
|
957
|
+
return bt(), new File(e, t ?? "unknown_file", n);
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function St(e) {
|
|
960
960
|
return (typeof e == "object" && !!e && ("name" in e && e.name && String(e.name) || "url" in e && e.url && String(e.url) || "filename" in e && e.filename && String(e.filename) || "path" in e && e.path && String(e.path)) || "").split(/[\\/]/).pop() || void 0;
|
|
961
961
|
}
|
|
962
|
-
var
|
|
962
|
+
var Ct = (e) => typeof e == "object" && !!e && typeof e[Symbol.asyncIterator] == "function", wt = async (e, t) => At(e.body) ? {
|
|
963
963
|
...e,
|
|
964
|
-
body: await
|
|
965
|
-
} : e,
|
|
964
|
+
body: await Dt(e.body, t)
|
|
965
|
+
} : e, M = async (e, t) => ({
|
|
966
966
|
...e,
|
|
967
|
-
body: await
|
|
968
|
-
}),
|
|
969
|
-
function
|
|
970
|
-
let t = typeof e == "function" ? e : e.fetch, n =
|
|
967
|
+
body: await Dt(e.body, t)
|
|
968
|
+
}), Tt = /* @__PURE__ */ new WeakMap();
|
|
969
|
+
function Et(e) {
|
|
970
|
+
let t = typeof e == "function" ? e : e.fetch, n = Tt.get(t);
|
|
971
971
|
if (n) return n;
|
|
972
972
|
let r = (async () => {
|
|
973
973
|
try {
|
|
@@ -977,79 +977,79 @@ function Tt(e) {
|
|
|
977
977
|
return !0;
|
|
978
978
|
}
|
|
979
979
|
})();
|
|
980
|
-
return
|
|
980
|
+
return Tt.set(t, r), r;
|
|
981
981
|
}
|
|
982
|
-
var
|
|
983
|
-
if (!await
|
|
982
|
+
var Dt = async (e, t) => {
|
|
983
|
+
if (!await Et(t)) throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");
|
|
984
984
|
let n = new FormData();
|
|
985
|
-
return await Promise.all(Object.entries(e || {}).map(([e, t]) =>
|
|
986
|
-
},
|
|
987
|
-
if (
|
|
988
|
-
if (Array.isArray(e)) return e.some(
|
|
985
|
+
return await Promise.all(Object.entries(e || {}).map(([e, t]) => jt(n, e, t))), n;
|
|
986
|
+
}, Ot = (e) => e instanceof Blob && "name" in e, kt = (e) => typeof e == "object" && !!e && (e instanceof Response || Ct(e) || Ot(e)), At = (e) => {
|
|
987
|
+
if (kt(e)) return !0;
|
|
988
|
+
if (Array.isArray(e)) return e.some(At);
|
|
989
989
|
if (e && typeof e == "object") {
|
|
990
|
-
for (let t in e) if (
|
|
990
|
+
for (let t in e) if (At(e[t])) return !0;
|
|
991
991
|
}
|
|
992
992
|
return !1;
|
|
993
|
-
},
|
|
993
|
+
}, jt = async (e, t, n) => {
|
|
994
994
|
if (n !== void 0) {
|
|
995
995
|
if (n == null) throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);
|
|
996
996
|
if (typeof n == "string" || typeof n == "number" || typeof n == "boolean") e.append(t, String(n));
|
|
997
|
-
else if (n instanceof Response) e.append(t,
|
|
998
|
-
else if (
|
|
999
|
-
else if (
|
|
1000
|
-
else if (Array.isArray(n)) await Promise.all(n.map((n) =>
|
|
1001
|
-
else if (typeof n == "object") await Promise.all(Object.entries(n).map(([n, r]) =>
|
|
997
|
+
else if (n instanceof Response) e.append(t, xt([await n.blob()], St(n)));
|
|
998
|
+
else if (Ct(n)) e.append(t, xt([await new Response(Se(n)).blob()], St(n)));
|
|
999
|
+
else if (Ot(n)) e.append(t, n, St(n));
|
|
1000
|
+
else if (Array.isArray(n)) await Promise.all(n.map((n) => jt(e, t + "[]", n)));
|
|
1001
|
+
else if (typeof n == "object") await Promise.all(Object.entries(n).map(([n, r]) => jt(e, `${t}[${n}]`, r)));
|
|
1002
1002
|
else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`);
|
|
1003
1003
|
}
|
|
1004
|
-
},
|
|
1005
|
-
async function
|
|
1006
|
-
if (
|
|
1007
|
-
if (
|
|
1004
|
+
}, Mt = (e) => typeof e == "object" && !!e && typeof e.size == "number" && typeof e.type == "string" && typeof e.text == "function" && typeof e.slice == "function" && typeof e.arrayBuffer == "function", Nt = (e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.lastModified == "number" && Mt(e), Pt = (e) => typeof e == "object" && !!e && typeof e.url == "string" && typeof e.blob == "function";
|
|
1005
|
+
async function Ft(e, t, n) {
|
|
1006
|
+
if (bt(), e = await e, Nt(e)) return e instanceof File ? e : xt([await e.arrayBuffer()], e.name);
|
|
1007
|
+
if (Pt(e)) {
|
|
1008
1008
|
let r = await e.blob();
|
|
1009
|
-
return t ||= new URL(e.url).pathname.split(/[\\/]/).pop(),
|
|
1009
|
+
return t ||= new URL(e.url).pathname.split(/[\\/]/).pop(), xt(await It(r), t, n);
|
|
1010
1010
|
}
|
|
1011
|
-
let r = await
|
|
1012
|
-
if (t ||=
|
|
1011
|
+
let r = await It(e);
|
|
1012
|
+
if (t ||= St(e), !n?.type) {
|
|
1013
1013
|
let e = r.find((e) => typeof e == "object" && "type" in e && e.type);
|
|
1014
1014
|
typeof e == "string" && (n = {
|
|
1015
1015
|
...n,
|
|
1016
1016
|
type: e
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
|
-
return
|
|
1019
|
+
return xt(r, t, n);
|
|
1020
1020
|
}
|
|
1021
|
-
async function
|
|
1021
|
+
async function It(e) {
|
|
1022
1022
|
let t = [];
|
|
1023
1023
|
if (typeof e == "string" || ArrayBuffer.isView(e) || e instanceof ArrayBuffer) t.push(e);
|
|
1024
|
-
else if (
|
|
1025
|
-
else if (
|
|
1024
|
+
else if (Mt(e)) t.push(e instanceof Blob ? e : await e.arrayBuffer());
|
|
1025
|
+
else if (Ct(e)) for await (let n of e) t.push(...await It(n));
|
|
1026
1026
|
else {
|
|
1027
1027
|
let t = e?.constructor?.name;
|
|
1028
|
-
throw Error(`Unexpected data type: ${typeof e}${t ? `; constructor: ${t}` : ""}${
|
|
1028
|
+
throw Error(`Unexpected data type: ${typeof e}${t ? `; constructor: ${t}` : ""}${Lt(e)}`);
|
|
1029
1029
|
}
|
|
1030
1030
|
return t;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Lt(e) {
|
|
1033
1033
|
return typeof e != "object" || !e ? "" : `; props: [${Object.getOwnPropertyNames(e).map((e) => `"${e}"`).join(", ")}]`;
|
|
1034
1034
|
}
|
|
1035
1035
|
//#endregion
|
|
1036
1036
|
//#region node_modules/openai/core/resource.mjs
|
|
1037
|
-
var
|
|
1037
|
+
var N = class {
|
|
1038
1038
|
constructor(e) {
|
|
1039
1039
|
this._client = e;
|
|
1040
1040
|
}
|
|
1041
1041
|
};
|
|
1042
1042
|
//#endregion
|
|
1043
1043
|
//#region node_modules/openai/internal/utils/path.mjs
|
|
1044
|
-
function
|
|
1044
|
+
function Rt(e) {
|
|
1045
1045
|
return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
1046
1046
|
}
|
|
1047
|
-
var
|
|
1047
|
+
var zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)), P = /* @__PURE__ */ ((e = Rt) => function(t, ...n) {
|
|
1048
1048
|
if (t.length === 1) return t[0];
|
|
1049
1049
|
let r = !1, i = [], o = t.reduce((t, a, o) => {
|
|
1050
1050
|
/[?#]/.test(a) && (r = !0);
|
|
1051
1051
|
let s = n[o], c = (r ? encodeURIComponent : e)("" + s);
|
|
1052
|
-
return o !== n.length && (s == null || typeof s == "object" && s.toString === Object.getPrototypeOf(Object.getPrototypeOf(s.hasOwnProperty ??
|
|
1052
|
+
return o !== n.length && (s == null || typeof s == "object" && s.toString === Object.getPrototypeOf(Object.getPrototypeOf(s.hasOwnProperty ?? zt) ?? zt)?.toString) && (c = s + "", i.push({
|
|
1053
1053
|
start: t.length + a.length,
|
|
1054
1054
|
length: c.length,
|
|
1055
1055
|
error: `Value of type ${Object.prototype.toString.call(s).slice(8, -1)} is not a valid path parameter`
|
|
@@ -1068,9 +1068,9 @@ var Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)), F =
|
|
|
1068
1068
|
throw new a(`Path parameters result in path with invalid segments:\n${i.map((e) => e.error).join("\n")}\n${o}\n${t}`);
|
|
1069
1069
|
}
|
|
1070
1070
|
return o;
|
|
1071
|
-
})(
|
|
1071
|
+
})(Rt), Bt = class extends N {
|
|
1072
1072
|
list(e, t = {}, n) {
|
|
1073
|
-
return this._client.getAPIList(
|
|
1073
|
+
return this._client.getAPIList(P`/chat/completions/${e}/messages`, k, {
|
|
1074
1074
|
query: t,
|
|
1075
1075
|
...n,
|
|
1076
1076
|
__security: { bearerAuth: !0 }
|
|
@@ -1079,19 +1079,19 @@ var Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)), F =
|
|
|
1079
1079
|
};
|
|
1080
1080
|
//#endregion
|
|
1081
1081
|
//#region node_modules/openai/lib/parser.mjs
|
|
1082
|
-
function
|
|
1082
|
+
function Vt(e) {
|
|
1083
1083
|
return e !== void 0 && "function" in e && e.function !== void 0;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Ht(e) {
|
|
1086
1086
|
return e?.$brand === "auto-parseable-response-format";
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function Ut(e) {
|
|
1089
1089
|
return e?.$brand === "auto-parseable-tool";
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return !t || !
|
|
1091
|
+
function Wt(e, t) {
|
|
1092
|
+
return !t || !Yt(t) ? {
|
|
1093
1093
|
...e,
|
|
1094
|
-
choices: e.choices.map((e) => (
|
|
1094
|
+
choices: e.choices.map((e) => (Xt(e.message.tool_calls), {
|
|
1095
1095
|
...e,
|
|
1096
1096
|
message: {
|
|
1097
1097
|
...e.message,
|
|
@@ -1099,18 +1099,18 @@ function Ut(e, t) {
|
|
|
1099
1099
|
...e.message.tool_calls ? { tool_calls: e.message.tool_calls } : void 0
|
|
1100
1100
|
}
|
|
1101
1101
|
}))
|
|
1102
|
-
} :
|
|
1102
|
+
} : Gt(e, t);
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function Gt(e, t) {
|
|
1105
1105
|
let n = e.choices.map((e) => {
|
|
1106
1106
|
if (e.finish_reason === "length") throw new v();
|
|
1107
1107
|
if (e.finish_reason === "content_filter") throw new y();
|
|
1108
|
-
return
|
|
1108
|
+
return Xt(e.message.tool_calls), {
|
|
1109
1109
|
...e,
|
|
1110
1110
|
message: {
|
|
1111
1111
|
...e.message,
|
|
1112
|
-
...e.message.tool_calls ? { tool_calls: e.message.tool_calls?.map((e) =>
|
|
1113
|
-
parsed: e.message.content && !e.message.refusal ?
|
|
1112
|
+
...e.message.tool_calls ? { tool_calls: e.message.tool_calls?.map((e) => qt(t, e)) ?? void 0 } : void 0,
|
|
1113
|
+
parsed: e.message.content && !e.message.refusal ? Kt(t, e.message.content) : null
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
1116
|
});
|
|
@@ -1119,31 +1119,31 @@ function Wt(e, t) {
|
|
|
1119
1119
|
choices: n
|
|
1120
1120
|
};
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Kt(e, t) {
|
|
1123
1123
|
return e.response_format?.type === "json_schema" && e.response_format?.type === "json_schema" ? "$parseRaw" in e.response_format ? e.response_format.$parseRaw(t) : JSON.parse(t) : null;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1126
|
-
let n = e.tools?.find((e) =>
|
|
1125
|
+
function qt(e, t) {
|
|
1126
|
+
let n = e.tools?.find((e) => Vt(e) && e.function?.name === t.function.name);
|
|
1127
1127
|
return {
|
|
1128
1128
|
...t,
|
|
1129
1129
|
function: {
|
|
1130
1130
|
...t.function,
|
|
1131
|
-
parsed_arguments:
|
|
1131
|
+
parsed_arguments: Ut(n) ? n.$parseRaw(t.function.arguments) : n?.function.strict ? JSON.parse(t.function.arguments) : null
|
|
1132
1132
|
}
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function Jt(e, t) {
|
|
1136
1136
|
if (!e || !("tools" in e) || !e.tools) return !1;
|
|
1137
|
-
let n = e.tools?.find((e) =>
|
|
1138
|
-
return
|
|
1139
|
-
}
|
|
1140
|
-
function Jt(e) {
|
|
1141
|
-
return Vt(e.response_format) ? !0 : e.tools?.some((e) => Ht(e) || e.type === "function" && e.function.strict === !0) ?? !1;
|
|
1137
|
+
let n = e.tools?.find((e) => Vt(e) && e.function?.name === t.function.name);
|
|
1138
|
+
return Vt(n) && (Ut(n) || n?.function.strict || !1);
|
|
1142
1139
|
}
|
|
1143
1140
|
function Yt(e) {
|
|
1144
|
-
|
|
1141
|
+
return Ht(e.response_format) ? !0 : e.tools?.some((e) => Ut(e) || e.type === "function" && e.function.strict === !0) ?? !1;
|
|
1145
1142
|
}
|
|
1146
1143
|
function Xt(e) {
|
|
1144
|
+
for (let t of e || []) if (t.type !== "function") throw new a(`Currently only \`function\` tool calls are supported; Received \`${t.type}\``);
|
|
1145
|
+
}
|
|
1146
|
+
function Zt(e) {
|
|
1147
1147
|
for (let t of e ?? []) {
|
|
1148
1148
|
if (t.type !== "function") throw new a(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);
|
|
1149
1149
|
if (t.function.strict !== !0) throw new a(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
|
|
@@ -1151,77 +1151,77 @@ function Xt(e) {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
//#endregion
|
|
1153
1153
|
//#region node_modules/openai/lib/chatCompletionUtils.mjs
|
|
1154
|
-
var
|
|
1154
|
+
var Qt = (e) => e?.role === "assistant", $t = (e) => e?.role === "tool", en, tn, nn, rn, an, on, sn, F, cn, ln, un, dn, fn, pn = class {
|
|
1155
1155
|
constructor() {
|
|
1156
|
-
|
|
1157
|
-
e(this,
|
|
1158
|
-
}), "f"), e(this,
|
|
1159
|
-
e(this,
|
|
1160
|
-
}), "f"), t(this,
|
|
1156
|
+
en.add(this), this.controller = new AbortController(), tn.set(this, void 0), nn.set(this, () => {}), rn.set(this, () => {}), an.set(this, void 0), on.set(this, () => {}), sn.set(this, () => {}), F.set(this, {}), cn.set(this, !1), ln.set(this, !1), un.set(this, !1), dn.set(this, !1), e(this, tn, new Promise((t, n) => {
|
|
1157
|
+
e(this, nn, t, "f"), e(this, rn, n, "f");
|
|
1158
|
+
}), "f"), e(this, an, new Promise((t, n) => {
|
|
1159
|
+
e(this, on, t, "f"), e(this, sn, n, "f");
|
|
1160
|
+
}), "f"), t(this, tn, "f").catch(() => {}), t(this, an, "f").catch(() => {});
|
|
1161
1161
|
}
|
|
1162
1162
|
_run(e) {
|
|
1163
1163
|
setTimeout(() => {
|
|
1164
1164
|
e().then(() => {
|
|
1165
1165
|
this._emitFinal(), this._emit("end");
|
|
1166
|
-
}, t(this,
|
|
1166
|
+
}, t(this, en, "m", fn).bind(this));
|
|
1167
1167
|
}, 0);
|
|
1168
1168
|
}
|
|
1169
1169
|
_connected() {
|
|
1170
|
-
this.ended || (t(this,
|
|
1170
|
+
this.ended || (t(this, nn, "f").call(this), this._emit("connect"));
|
|
1171
1171
|
}
|
|
1172
1172
|
get ended() {
|
|
1173
|
-
return t(this,
|
|
1173
|
+
return t(this, cn, "f");
|
|
1174
1174
|
}
|
|
1175
1175
|
get errored() {
|
|
1176
|
-
return t(this,
|
|
1176
|
+
return t(this, ln, "f");
|
|
1177
1177
|
}
|
|
1178
1178
|
get aborted() {
|
|
1179
|
-
return t(this,
|
|
1179
|
+
return t(this, un, "f");
|
|
1180
1180
|
}
|
|
1181
1181
|
abort() {
|
|
1182
1182
|
this.controller.abort();
|
|
1183
1183
|
}
|
|
1184
1184
|
on(e, n) {
|
|
1185
|
-
return (t(this,
|
|
1185
|
+
return (t(this, F, "f")[e] || (t(this, F, "f")[e] = [])).push({ listener: n }), this;
|
|
1186
1186
|
}
|
|
1187
1187
|
off(e, n) {
|
|
1188
|
-
let r = t(this,
|
|
1188
|
+
let r = t(this, F, "f")[e];
|
|
1189
1189
|
if (!r) return this;
|
|
1190
1190
|
let i = r.findIndex((e) => e.listener === n);
|
|
1191
1191
|
return i >= 0 && r.splice(i, 1), this;
|
|
1192
1192
|
}
|
|
1193
1193
|
once(e, n) {
|
|
1194
|
-
return (t(this,
|
|
1194
|
+
return (t(this, F, "f")[e] || (t(this, F, "f")[e] = [])).push({
|
|
1195
1195
|
listener: n,
|
|
1196
1196
|
once: !0
|
|
1197
1197
|
}), this;
|
|
1198
1198
|
}
|
|
1199
1199
|
emitted(t) {
|
|
1200
1200
|
return new Promise((n, r) => {
|
|
1201
|
-
e(this,
|
|
1201
|
+
e(this, dn, !0, "f"), t !== "error" && this.once("error", r), this.once(t, n);
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
1204
|
async done() {
|
|
1205
|
-
e(this,
|
|
1205
|
+
e(this, dn, !0, "f"), await t(this, an, "f");
|
|
1206
1206
|
}
|
|
1207
1207
|
_emit(n, ...r) {
|
|
1208
|
-
if (t(this,
|
|
1209
|
-
n === "end" && (e(this,
|
|
1210
|
-
let i = t(this,
|
|
1211
|
-
if (i && (t(this,
|
|
1208
|
+
if (t(this, cn, "f")) return;
|
|
1209
|
+
n === "end" && (e(this, cn, !0, "f"), t(this, on, "f").call(this));
|
|
1210
|
+
let i = t(this, F, "f")[n];
|
|
1211
|
+
if (i && (t(this, F, "f")[n] = i.filter((e) => !e.once), i.forEach(({ listener: e }) => e(...r))), n === "abort") {
|
|
1212
1212
|
let e = r[0];
|
|
1213
|
-
!t(this,
|
|
1213
|
+
!t(this, dn, "f") && !i?.length && Promise.reject(e), t(this, rn, "f").call(this, e), t(this, sn, "f").call(this, e), this._emit("end");
|
|
1214
1214
|
return;
|
|
1215
1215
|
}
|
|
1216
1216
|
if (n === "error") {
|
|
1217
1217
|
let e = r[0];
|
|
1218
|
-
!t(this,
|
|
1218
|
+
!t(this, dn, "f") && !i?.length && Promise.reject(e), t(this, rn, "f").call(this, e), t(this, sn, "f").call(this, e), this._emit("end");
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
_emitFinal() {}
|
|
1222
1222
|
};
|
|
1223
|
-
|
|
1224
|
-
if (e(this,
|
|
1223
|
+
tn = /* @__PURE__ */ new WeakMap(), nn = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap(), an = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), sn = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), cn = /* @__PURE__ */ new WeakMap(), ln = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), dn = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakSet(), fn = function(t) {
|
|
1224
|
+
if (e(this, ln, !0, "f"), t instanceof Error && t.name === "AbortError" && (t = new s()), t instanceof s) return e(this, un, !0, "f"), this._emit("abort", t);
|
|
1225
1225
|
if (t instanceof a) return this._emit("error", t);
|
|
1226
1226
|
if (t instanceof Error) {
|
|
1227
1227
|
let e = new a(t.message);
|
|
@@ -1231,14 +1231,14 @@ en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), nn = /*
|
|
|
1231
1231
|
};
|
|
1232
1232
|
//#endregion
|
|
1233
1233
|
//#region node_modules/openai/lib/RunnableFunction.mjs
|
|
1234
|
-
function
|
|
1234
|
+
function mn(e) {
|
|
1235
1235
|
return typeof e.parse == "function";
|
|
1236
1236
|
}
|
|
1237
1237
|
//#endregion
|
|
1238
1238
|
//#region node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
1239
|
-
var
|
|
1239
|
+
var I, hn, gn, _n, vn, yn, bn, xn, Sn = 10, Cn = class extends pn {
|
|
1240
1240
|
constructor() {
|
|
1241
|
-
super(...arguments),
|
|
1241
|
+
super(...arguments), I.add(this), this._chatCompletions = [], this.messages = [];
|
|
1242
1242
|
}
|
|
1243
1243
|
_addChatCompletion(e) {
|
|
1244
1244
|
this._chatCompletions.push(e), this._emit("chatCompletion", e);
|
|
@@ -1247,8 +1247,8 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
_addMessage(e, t = !0) {
|
|
1249
1249
|
if ("content" in e || (e.content = null), this.messages.push(e), t) {
|
|
1250
|
-
if (this._emit("message", e),
|
|
1251
|
-
else if (
|
|
1250
|
+
if (this._emit("message", e), $t(e) && e.content) this._emit("functionToolCallResult", e.content);
|
|
1251
|
+
else if (Qt(e) && e.tool_calls) for (let t of e.tool_calls) t.type === "function" && this._emit("functionToolCall", t.function);
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
async finalChatCompletion() {
|
|
@@ -1258,19 +1258,19 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1258
1258
|
return e;
|
|
1259
1259
|
}
|
|
1260
1260
|
async finalContent() {
|
|
1261
|
-
return await this.done(), t(this,
|
|
1261
|
+
return await this.done(), t(this, I, "m", hn).call(this);
|
|
1262
1262
|
}
|
|
1263
1263
|
async finalMessage() {
|
|
1264
|
-
return await this.done(), t(this,
|
|
1264
|
+
return await this.done(), t(this, I, "m", gn).call(this);
|
|
1265
1265
|
}
|
|
1266
1266
|
async finalFunctionToolCall() {
|
|
1267
|
-
return await this.done(), t(this,
|
|
1267
|
+
return await this.done(), t(this, I, "m", _n).call(this);
|
|
1268
1268
|
}
|
|
1269
1269
|
async finalFunctionToolCallResult() {
|
|
1270
|
-
return await this.done(), t(this,
|
|
1270
|
+
return await this.done(), t(this, I, "m", vn).call(this);
|
|
1271
1271
|
}
|
|
1272
1272
|
async totalUsage() {
|
|
1273
|
-
return await this.done(), t(this,
|
|
1273
|
+
return await this.done(), t(this, I, "m", yn).call(this);
|
|
1274
1274
|
}
|
|
1275
1275
|
allChatCompletions() {
|
|
1276
1276
|
return [...this._chatCompletions];
|
|
@@ -1278,18 +1278,18 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1278
1278
|
_emitFinal() {
|
|
1279
1279
|
let e = this._chatCompletions[this._chatCompletions.length - 1];
|
|
1280
1280
|
e && this._emit("finalChatCompletion", e);
|
|
1281
|
-
let n = t(this,
|
|
1281
|
+
let n = t(this, I, "m", gn).call(this);
|
|
1282
1282
|
n && this._emit("finalMessage", n);
|
|
1283
|
-
let r = t(this,
|
|
1283
|
+
let r = t(this, I, "m", hn).call(this);
|
|
1284
1284
|
r && this._emit("finalContent", r);
|
|
1285
|
-
let i = t(this,
|
|
1285
|
+
let i = t(this, I, "m", _n).call(this);
|
|
1286
1286
|
i && this._emit("finalFunctionToolCall", i);
|
|
1287
|
-
let a = t(this,
|
|
1288
|
-
a != null && this._emit("finalFunctionToolCallResult", a), this._chatCompletions.some((e) => e.usage) && this._emit("totalUsage", t(this,
|
|
1287
|
+
let a = t(this, I, "m", vn).call(this);
|
|
1288
|
+
a != null && this._emit("finalFunctionToolCallResult", a), this._chatCompletions.some((e) => e.usage) && this._emit("totalUsage", t(this, I, "m", yn).call(this));
|
|
1289
1289
|
}
|
|
1290
1290
|
async _createChatCompletion(e, n, r) {
|
|
1291
1291
|
let i = r?.signal;
|
|
1292
|
-
i && (i.aborted && this.controller.abort(), i.addEventListener("abort", () => this.controller.abort())), t(this,
|
|
1292
|
+
i && (i.aborted && this.controller.abort(), i.addEventListener("abort", () => this.controller.abort())), t(this, I, "m", bn).call(this, n);
|
|
1293
1293
|
let a = await e.chat.completions.create({
|
|
1294
1294
|
...n,
|
|
1295
1295
|
stream: !1
|
|
@@ -1297,15 +1297,15 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1297
1297
|
...r,
|
|
1298
1298
|
signal: this.controller.signal
|
|
1299
1299
|
});
|
|
1300
|
-
return this._connected(), this._addChatCompletion(
|
|
1300
|
+
return this._connected(), this._addChatCompletion(Gt(a, n));
|
|
1301
1301
|
}
|
|
1302
1302
|
async _runChatCompletion(e, t, n) {
|
|
1303
1303
|
for (let e of t.messages) this._addMessage(e, !1);
|
|
1304
1304
|
return await this._createChatCompletion(e, t, n);
|
|
1305
1305
|
}
|
|
1306
1306
|
async _runTools(e, n, r) {
|
|
1307
|
-
let i = "tool", { tool_choice: o = "auto", stream: s, ...c } = n, l = typeof o != "string" && o.type === "function" && o?.function?.name, { maxChatCompletions: u =
|
|
1308
|
-
if (
|
|
1307
|
+
let i = "tool", { tool_choice: o = "auto", stream: s, ...c } = n, l = typeof o != "string" && o.type === "function" && o?.function?.name, { maxChatCompletions: u = Sn } = r || {}, d = n.tools.map((e) => {
|
|
1308
|
+
if (Ut(e)) {
|
|
1309
1309
|
if (!e.$callback) throw new a("Tool given to `.runTools()` that does not have an associated function");
|
|
1310
1310
|
return {
|
|
1311
1311
|
type: "function",
|
|
@@ -1363,7 +1363,7 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
let s;
|
|
1365
1365
|
try {
|
|
1366
|
-
s =
|
|
1366
|
+
s = mn(o) ? await o.parse(a) : a;
|
|
1367
1367
|
} catch (e) {
|
|
1368
1368
|
let t = e instanceof Error ? e.message : String(e);
|
|
1369
1369
|
this._addMessage({
|
|
@@ -1373,7 +1373,7 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1373
1373
|
});
|
|
1374
1374
|
continue;
|
|
1375
1375
|
}
|
|
1376
|
-
let c = await o.function(s, this), u = t(this,
|
|
1376
|
+
let c = await o.function(s, this), u = t(this, I, "m", xn).call(this, c);
|
|
1377
1377
|
if (this._addMessage({
|
|
1378
1378
|
role: i,
|
|
1379
1379
|
tool_call_id: n,
|
|
@@ -1383,30 +1383,30 @@ var L, mn, hn, gn, _n, vn, yn, bn, xn = 10, Sn = class extends fn {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
1385
|
};
|
|
1386
|
-
|
|
1387
|
-
return t(this,
|
|
1388
|
-
},
|
|
1386
|
+
I = /* @__PURE__ */ new WeakSet(), hn = function() {
|
|
1387
|
+
return t(this, I, "m", gn).call(this).content ?? null;
|
|
1388
|
+
}, gn = function() {
|
|
1389
1389
|
let e = this.messages.length;
|
|
1390
1390
|
for (; e-- > 0;) {
|
|
1391
1391
|
let t = this.messages[e];
|
|
1392
|
-
if (
|
|
1392
|
+
if (Qt(t)) return {
|
|
1393
1393
|
...t,
|
|
1394
1394
|
content: t.content ?? null,
|
|
1395
1395
|
refusal: t.refusal ?? null
|
|
1396
1396
|
};
|
|
1397
1397
|
}
|
|
1398
1398
|
throw new a("stream ended without producing a ChatCompletionMessage with role=assistant");
|
|
1399
|
-
},
|
|
1399
|
+
}, _n = function() {
|
|
1400
1400
|
for (let e = this.messages.length - 1; e >= 0; e--) {
|
|
1401
1401
|
let t = this.messages[e];
|
|
1402
|
-
if (
|
|
1402
|
+
if (Qt(t) && t?.tool_calls?.length) return t.tool_calls.filter((e) => e.type === "function").at(-1)?.function;
|
|
1403
1403
|
}
|
|
1404
|
-
},
|
|
1404
|
+
}, vn = function() {
|
|
1405
1405
|
for (let e = this.messages.length - 1; e >= 0; e--) {
|
|
1406
1406
|
let t = this.messages[e];
|
|
1407
|
-
if (
|
|
1407
|
+
if ($t(t) && t.content != null && typeof t.content == "string" && this.messages.some((e) => e.role === "assistant" && e.tool_calls?.some((e) => e.type === "function" && e.id === t.tool_call_id))) return t.content;
|
|
1408
1408
|
}
|
|
1409
|
-
},
|
|
1409
|
+
}, yn = function() {
|
|
1410
1410
|
let e = {
|
|
1411
1411
|
completion_tokens: 0,
|
|
1412
1412
|
prompt_tokens: 0,
|
|
@@ -1414,14 +1414,14 @@ L = /* @__PURE__ */ new WeakSet(), mn = function() {
|
|
|
1414
1414
|
};
|
|
1415
1415
|
for (let { usage: t } of this._chatCompletions) t && (e.completion_tokens += t.completion_tokens, e.prompt_tokens += t.prompt_tokens, e.total_tokens += t.total_tokens);
|
|
1416
1416
|
return e;
|
|
1417
|
-
}, yn = function(e) {
|
|
1418
|
-
if (e.n != null && e.n > 1) throw new a("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.");
|
|
1419
1417
|
}, bn = function(e) {
|
|
1418
|
+
if (e.n != null && e.n > 1) throw new a("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.");
|
|
1419
|
+
}, xn = function(e) {
|
|
1420
1420
|
return typeof e == "string" ? e : e === void 0 ? "undefined" : JSON.stringify(e);
|
|
1421
1421
|
};
|
|
1422
1422
|
//#endregion
|
|
1423
1423
|
//#region node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
1424
|
-
var
|
|
1424
|
+
var wn = class e extends Cn {
|
|
1425
1425
|
static runTools(t, n, r) {
|
|
1426
1426
|
let i = new e(), a = {
|
|
1427
1427
|
...r,
|
|
@@ -1433,9 +1433,9 @@ var Cn = class e extends Sn {
|
|
|
1433
1433
|
return i._run(() => i._runTools(t, n, a)), i;
|
|
1434
1434
|
}
|
|
1435
1435
|
_addMessage(e, t = !0) {
|
|
1436
|
-
super._addMessage(e, t),
|
|
1436
|
+
super._addMessage(e, t), Qt(e) && e.content && this._emit("content", e.content);
|
|
1437
1437
|
}
|
|
1438
|
-
},
|
|
1438
|
+
}, L = {
|
|
1439
1439
|
STR: 1,
|
|
1440
1440
|
NUM: 2,
|
|
1441
1441
|
ARR: 4,
|
|
@@ -1450,18 +1450,18 @@ var Cn = class e extends Sn {
|
|
|
1450
1450
|
ATOM: 499,
|
|
1451
1451
|
COLLECTION: 12,
|
|
1452
1452
|
ALL: 511
|
|
1453
|
-
},
|
|
1454
|
-
function
|
|
1453
|
+
}, Tn = class extends Error {}, En = class extends Error {};
|
|
1454
|
+
function Dn(e, t = L.ALL) {
|
|
1455
1455
|
if (typeof e != "string") throw TypeError(`expecting str, got ${typeof e}`);
|
|
1456
1456
|
if (!e.trim()) throw Error(`${e} is empty`);
|
|
1457
|
-
return
|
|
1457
|
+
return On(e.trim(), t);
|
|
1458
1458
|
}
|
|
1459
|
-
var
|
|
1459
|
+
var On = (e, t) => {
|
|
1460
1460
|
let n = e.length, r = 0, i = (e) => {
|
|
1461
|
-
throw new wn(`${e} at position ${r}`);
|
|
1462
|
-
}, a = (e) => {
|
|
1463
1461
|
throw new Tn(`${e} at position ${r}`);
|
|
1464
|
-
},
|
|
1462
|
+
}, a = (e) => {
|
|
1463
|
+
throw new En(`${e} at position ${r}`);
|
|
1464
|
+
}, o = () => (d(), r >= n && i("Unexpected end of input"), e[r] === "\"" ? s() : e[r] === "{" ? c() : e[r] === "[" ? l() : e.substring(r, r + 4) === "null" || L.NULL & t && n - r < 4 && "null".startsWith(e.substring(r)) ? (r += 4, null) : e.substring(r, r + 4) === "true" || L.BOOL & t && n - r < 4 && "true".startsWith(e.substring(r)) ? (r += 4, !0) : e.substring(r, r + 5) === "false" || L.BOOL & t && n - r < 5 && "false".startsWith(e.substring(r)) ? (r += 5, !1) : e.substring(r, r + 8) === "Infinity" || L.INFINITY & t && n - r < 8 && "Infinity".startsWith(e.substring(r)) ? (r += 8, Infinity) : e.substring(r, r + 9) === "-Infinity" || L.MINUS_INFINITY & t && 1 < n - r && n - r < 9 && "-Infinity".startsWith(e.substring(r)) ? (r += 9, -Infinity) : e.substring(r, r + 3) === "NaN" || L.NAN & t && n - r < 3 && "NaN".startsWith(e.substring(r)) ? (r += 3, NaN) : u()), s = () => {
|
|
1465
1465
|
let o = r, s = !1;
|
|
1466
1466
|
for (r++; r < n && (e[r] !== "\"" || s && e[r - 1] === "\\");) s = e[r] === "\\" ? !s : !1, r++;
|
|
1467
1467
|
if (e.charAt(r) == "\"") try {
|
|
@@ -1469,7 +1469,7 @@ var Dn = (e, t) => {
|
|
|
1469
1469
|
} catch (e) {
|
|
1470
1470
|
a(String(e));
|
|
1471
1471
|
}
|
|
1472
|
-
else if (
|
|
1472
|
+
else if (L.STR & t) try {
|
|
1473
1473
|
return JSON.parse(e.substring(o, r - Number(s)) + "\"");
|
|
1474
1474
|
} catch {
|
|
1475
1475
|
return JSON.parse(e.substring(o, e.lastIndexOf("\\")) + "\"");
|
|
@@ -1480,7 +1480,7 @@ var Dn = (e, t) => {
|
|
|
1480
1480
|
let a = {};
|
|
1481
1481
|
try {
|
|
1482
1482
|
for (; e[r] !== "}";) {
|
|
1483
|
-
if (d(), r >= n &&
|
|
1483
|
+
if (d(), r >= n && L.OBJ & t) return a;
|
|
1484
1484
|
let i = s();
|
|
1485
1485
|
d(), r++;
|
|
1486
1486
|
try {
|
|
@@ -1492,13 +1492,13 @@ var Dn = (e, t) => {
|
|
|
1492
1492
|
configurable: !0
|
|
1493
1493
|
});
|
|
1494
1494
|
} catch (e) {
|
|
1495
|
-
if (
|
|
1495
|
+
if (L.OBJ & t) return a;
|
|
1496
1496
|
throw e;
|
|
1497
1497
|
}
|
|
1498
1498
|
d(), e[r] === "," && r++;
|
|
1499
1499
|
}
|
|
1500
1500
|
} catch {
|
|
1501
|
-
if (
|
|
1501
|
+
if (L.OBJ & t) return a;
|
|
1502
1502
|
i("Expected '}' at end of object");
|
|
1503
1503
|
}
|
|
1504
1504
|
return r++, a;
|
|
@@ -1508,17 +1508,17 @@ var Dn = (e, t) => {
|
|
|
1508
1508
|
try {
|
|
1509
1509
|
for (; e[r] !== "]";) n.push(o()), d(), e[r] === "," && r++;
|
|
1510
1510
|
} catch {
|
|
1511
|
-
if (
|
|
1511
|
+
if (L.ARR & t) return n;
|
|
1512
1512
|
i("Expected ']' at end of array");
|
|
1513
1513
|
}
|
|
1514
1514
|
return r++, n;
|
|
1515
1515
|
}, u = () => {
|
|
1516
1516
|
if (r === 0) {
|
|
1517
|
-
e === "-" &&
|
|
1517
|
+
e === "-" && L.NUM & t && i("Not sure what '-' is");
|
|
1518
1518
|
try {
|
|
1519
1519
|
return JSON.parse(e);
|
|
1520
1520
|
} catch (n) {
|
|
1521
|
-
if (
|
|
1521
|
+
if (L.NUM & t) try {
|
|
1522
1522
|
return e[e.length - 1] === "." ? JSON.parse(e.substring(0, e.lastIndexOf("."))) : JSON.parse(e.substring(0, e.lastIndexOf("e")));
|
|
1523
1523
|
} catch {}
|
|
1524
1524
|
a(String(n));
|
|
@@ -1526,11 +1526,11 @@ var Dn = (e, t) => {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
let o = r;
|
|
1528
1528
|
for (e[r] === "-" && r++; e[r] && !",]}".includes(e[r]);) r++;
|
|
1529
|
-
r == n && !(
|
|
1529
|
+
r == n && !(L.NUM & t) && i("Unterminated number literal");
|
|
1530
1530
|
try {
|
|
1531
1531
|
return JSON.parse(e.substring(o, r));
|
|
1532
1532
|
} catch {
|
|
1533
|
-
e.substring(o, r) === "-" &&
|
|
1533
|
+
e.substring(o, r) === "-" && L.NUM & t && i("Not sure what '-' is");
|
|
1534
1534
|
try {
|
|
1535
1535
|
return JSON.parse(e.substring(o, e.lastIndexOf("e")));
|
|
1536
1536
|
} catch (e) {
|
|
@@ -1541,12 +1541,12 @@ var Dn = (e, t) => {
|
|
|
1541
1541
|
for (; r < n && " \n\r ".includes(e[r]);) r++;
|
|
1542
1542
|
};
|
|
1543
1543
|
return o();
|
|
1544
|
-
},
|
|
1544
|
+
}, kn = (e) => Dn(e, L.ALL ^ L.NUM), R, z, An, B, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn = class n extends Cn {
|
|
1545
1545
|
constructor(t) {
|
|
1546
|
-
super(),
|
|
1546
|
+
super(), R.add(this), z.set(this, void 0), An.set(this, void 0), B.set(this, void 0), e(this, z, t, "f"), e(this, An, [], "f");
|
|
1547
1547
|
}
|
|
1548
1548
|
get currentChatCompletionSnapshot() {
|
|
1549
|
-
return t(this,
|
|
1549
|
+
return t(this, B, "f");
|
|
1550
1550
|
}
|
|
1551
1551
|
static fromReadableStream(e) {
|
|
1552
1552
|
let t = new n(null);
|
|
@@ -1568,7 +1568,7 @@ var Dn = (e, t) => {
|
|
|
1568
1568
|
async _createChatCompletion(e, n, r) {
|
|
1569
1569
|
super._createChatCompletion;
|
|
1570
1570
|
let i = r?.signal;
|
|
1571
|
-
i && (i.aborted && this.controller.abort(), i.addEventListener("abort", () => this.controller.abort())), t(this,
|
|
1571
|
+
i && (i.aborted && this.controller.abort(), i.addEventListener("abort", () => this.controller.abort())), t(this, R, "m", jn).call(this);
|
|
1572
1572
|
let a = await e.chat.completions.create({
|
|
1573
1573
|
...n,
|
|
1574
1574
|
stream: !0
|
|
@@ -1577,22 +1577,22 @@ var Dn = (e, t) => {
|
|
|
1577
1577
|
signal: this.controller.signal
|
|
1578
1578
|
});
|
|
1579
1579
|
this._connected();
|
|
1580
|
-
for await (let e of a) t(this,
|
|
1580
|
+
for await (let e of a) t(this, R, "m", Nn).call(this, e);
|
|
1581
1581
|
if (a.controller.signal?.aborted) throw new s();
|
|
1582
|
-
return this._addChatCompletion(t(this,
|
|
1582
|
+
return this._addChatCompletion(t(this, R, "m", In).call(this));
|
|
1583
1583
|
}
|
|
1584
1584
|
async _fromReadableStream(e, n) {
|
|
1585
1585
|
let r = n?.signal;
|
|
1586
|
-
r && (r.aborted && this.controller.abort(), r.addEventListener("abort", () => this.controller.abort())), t(this,
|
|
1587
|
-
let i =
|
|
1588
|
-
for await (let e of i) a && a !== e.id && this._addChatCompletion(t(this,
|
|
1586
|
+
r && (r.aborted && this.controller.abort(), r.addEventListener("abort", () => this.controller.abort())), t(this, R, "m", jn).call(this), this._connected();
|
|
1587
|
+
let i = at.fromReadableStream(e, this.controller), a;
|
|
1588
|
+
for await (let e of i) a && a !== e.id && this._addChatCompletion(t(this, R, "m", In).call(this)), t(this, R, "m", Nn).call(this, e), a = e.id;
|
|
1589
1589
|
if (i.controller.signal?.aborted) throw new s();
|
|
1590
|
-
return this._addChatCompletion(t(this,
|
|
1590
|
+
return this._addChatCompletion(t(this, R, "m", In).call(this));
|
|
1591
1591
|
}
|
|
1592
|
-
[(
|
|
1593
|
-
this.ended || e(this,
|
|
1594
|
-
},
|
|
1595
|
-
let n = t(this,
|
|
1592
|
+
[(z = /* @__PURE__ */ new WeakMap(), An = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakSet(), jn = function() {
|
|
1593
|
+
this.ended || e(this, B, void 0, "f");
|
|
1594
|
+
}, Mn = function(e) {
|
|
1595
|
+
let n = t(this, An, "f")[e.index];
|
|
1596
1596
|
return n || (n = {
|
|
1597
1597
|
content_done: !1,
|
|
1598
1598
|
refusal_done: !1,
|
|
@@ -1600,10 +1600,10 @@ var Dn = (e, t) => {
|
|
|
1600
1600
|
logprobs_refusal_done: !1,
|
|
1601
1601
|
done_tool_calls: /* @__PURE__ */ new Set(),
|
|
1602
1602
|
current_tool_call_index: null
|
|
1603
|
-
}, t(this,
|
|
1604
|
-
},
|
|
1603
|
+
}, t(this, An, "f")[e.index] = n, n);
|
|
1604
|
+
}, Nn = function(e) {
|
|
1605
1605
|
if (this.ended) return;
|
|
1606
|
-
let n = t(this,
|
|
1606
|
+
let n = t(this, R, "m", Rn).call(this, e);
|
|
1607
1607
|
this._emit("chunk", e, n);
|
|
1608
1608
|
for (let r of e.choices) {
|
|
1609
1609
|
let e = n.choices[r.index];
|
|
@@ -1621,9 +1621,9 @@ var Dn = (e, t) => {
|
|
|
1621
1621
|
refusal: r.logprobs?.refusal,
|
|
1622
1622
|
snapshot: e.logprobs?.refusal ?? []
|
|
1623
1623
|
});
|
|
1624
|
-
let i = t(this,
|
|
1625
|
-
e.finish_reason && (t(this,
|
|
1626
|
-
for (let n of r.delta.tool_calls ?? []) i.current_tool_call_index !== n.index && (t(this,
|
|
1624
|
+
let i = t(this, R, "m", Mn).call(this, e);
|
|
1625
|
+
e.finish_reason && (t(this, R, "m", Fn).call(this, e), i.current_tool_call_index != null && t(this, R, "m", Pn).call(this, e, i.current_tool_call_index));
|
|
1626
|
+
for (let n of r.delta.tool_calls ?? []) i.current_tool_call_index !== n.index && (t(this, R, "m", Fn).call(this, e), i.current_tool_call_index != null && t(this, R, "m", Pn).call(this, e, i.current_tool_call_index)), i.current_tool_call_index = n.index;
|
|
1627
1627
|
for (let t of r.delta.tool_calls ?? []) {
|
|
1628
1628
|
let n = e.message.tool_calls?.[t.index];
|
|
1629
1629
|
n?.type && (n?.type === "function" ? this._emit("tool_calls.function.arguments.delta", {
|
|
@@ -1635,43 +1635,43 @@ var Dn = (e, t) => {
|
|
|
1635
1635
|
}) : n?.type);
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
|
-
},
|
|
1639
|
-
if (t(this,
|
|
1638
|
+
}, Pn = function(e, n) {
|
|
1639
|
+
if (t(this, R, "m", Mn).call(this, e).done_tool_calls.has(n)) return;
|
|
1640
1640
|
let r = e.message.tool_calls?.[n];
|
|
1641
1641
|
if (!r) throw Error("no tool call snapshot");
|
|
1642
1642
|
if (!r.type) throw Error("tool call snapshot missing `type`");
|
|
1643
1643
|
if (r.type === "function") {
|
|
1644
|
-
let e = t(this,
|
|
1644
|
+
let e = t(this, z, "f")?.tools?.find((e) => Vt(e) && e.function.name === r.function.name);
|
|
1645
1645
|
this._emit("tool_calls.function.arguments.done", {
|
|
1646
1646
|
name: r.function.name,
|
|
1647
1647
|
index: n,
|
|
1648
1648
|
arguments: r.function.arguments,
|
|
1649
|
-
parsed_arguments:
|
|
1649
|
+
parsed_arguments: Ut(e) ? e.$parseRaw(r.function.arguments) : e?.function.strict ? JSON.parse(r.function.arguments) : null
|
|
1650
1650
|
});
|
|
1651
1651
|
} else r.type;
|
|
1652
|
-
},
|
|
1653
|
-
let n = t(this,
|
|
1652
|
+
}, Fn = function(e) {
|
|
1653
|
+
let n = t(this, R, "m", Mn).call(this, e);
|
|
1654
1654
|
if (e.message.content && !n.content_done) {
|
|
1655
1655
|
n.content_done = !0;
|
|
1656
|
-
let r = t(this,
|
|
1656
|
+
let r = t(this, R, "m", Ln).call(this);
|
|
1657
1657
|
this._emit("content.done", {
|
|
1658
1658
|
content: e.message.content,
|
|
1659
1659
|
parsed: r ? r.$parseRaw(e.message.content) : null
|
|
1660
1660
|
});
|
|
1661
1661
|
}
|
|
1662
1662
|
e.message.refusal && !n.refusal_done && (n.refusal_done = !0, this._emit("refusal.done", { refusal: e.message.refusal })), e.logprobs?.content && !n.logprobs_content_done && (n.logprobs_content_done = !0, this._emit("logprobs.content.done", { content: e.logprobs.content })), e.logprobs?.refusal && !n.logprobs_refusal_done && (n.logprobs_refusal_done = !0, this._emit("logprobs.refusal.done", { refusal: e.logprobs.refusal }));
|
|
1663
|
-
},
|
|
1663
|
+
}, In = function() {
|
|
1664
1664
|
if (this.ended) throw new a("stream has ended, this shouldn't happen");
|
|
1665
|
-
let n = t(this,
|
|
1665
|
+
let n = t(this, B, "f");
|
|
1666
1666
|
if (!n) throw new a("request ended without sending any chunks");
|
|
1667
|
-
return e(this,
|
|
1668
|
-
},
|
|
1669
|
-
let e = t(this,
|
|
1670
|
-
return
|
|
1671
|
-
},
|
|
1667
|
+
return e(this, B, void 0, "f"), e(this, An, [], "f"), Bn(n, t(this, z, "f"));
|
|
1668
|
+
}, Ln = function() {
|
|
1669
|
+
let e = t(this, z, "f")?.response_format;
|
|
1670
|
+
return Ht(e) ? e : null;
|
|
1671
|
+
}, Rn = function(n) {
|
|
1672
1672
|
var r, i, a, o;
|
|
1673
|
-
let s = t(this,
|
|
1674
|
-
s ? Object.assign(s, l) : s = e(this,
|
|
1673
|
+
let s = t(this, B, "f"), { choices: c, ...l } = n;
|
|
1674
|
+
s ? Object.assign(s, l) : s = e(this, B, {
|
|
1675
1675
|
...l,
|
|
1676
1676
|
choices: []
|
|
1677
1677
|
}, "f");
|
|
@@ -1688,20 +1688,20 @@ var Dn = (e, t) => {
|
|
|
1688
1688
|
let { content: e, refusal: t, ...a } = u;
|
|
1689
1689
|
Object.assign(n.logprobs, a), e && ((r = n.logprobs).content ?? (r.content = []), n.logprobs.content.push(...e)), t && ((i = n.logprobs).refusal ?? (i.refusal = []), n.logprobs.refusal.push(...t));
|
|
1690
1690
|
}
|
|
1691
|
-
if (c && (n.finish_reason = c, t(this,
|
|
1691
|
+
if (c && (n.finish_reason = c, t(this, z, "f") && Yt(t(this, z, "f")))) {
|
|
1692
1692
|
if (c === "length") throw new v();
|
|
1693
1693
|
if (c === "content_filter") throw new y();
|
|
1694
1694
|
}
|
|
1695
1695
|
if (Object.assign(n, d), !e) continue;
|
|
1696
1696
|
let { content: f, refusal: p, function_call: m, role: h, tool_calls: g, ..._ } = e;
|
|
1697
|
-
if (Object.assign(n.message, _), p && (n.message.refusal = (n.message.refusal || "") + p), h && (n.message.role = h), m && (n.message.function_call ? (m.name && (n.message.function_call.name = m.name), m.arguments && ((a = n.message.function_call).arguments ?? (a.arguments = ""), n.message.function_call.arguments += m.arguments)) : n.message.function_call = m), f && (n.message.content = (n.message.content || "") + f, !n.message.refusal && t(this,
|
|
1697
|
+
if (Object.assign(n.message, _), p && (n.message.refusal = (n.message.refusal || "") + p), h && (n.message.role = h), m && (n.message.function_call ? (m.name && (n.message.function_call.name = m.name), m.arguments && ((a = n.message.function_call).arguments ?? (a.arguments = ""), n.message.function_call.arguments += m.arguments)) : n.message.function_call = m), f && (n.message.content = (n.message.content || "") + f, !n.message.refusal && t(this, R, "m", Ln).call(this) && (n.message.parsed = kn(n.message.content))), g) {
|
|
1698
1698
|
n.message.tool_calls || (n.message.tool_calls = []);
|
|
1699
1699
|
for (let { index: e, id: r, type: i, function: a, ...s } of g) {
|
|
1700
1700
|
let c = (o = n.message.tool_calls)[e] ?? (o[e] = {});
|
|
1701
1701
|
Object.assign(c, s), r && (c.id = r), i && (c.type = i), a && (c.function ??= {
|
|
1702
1702
|
name: a.name ?? "",
|
|
1703
1703
|
arguments: ""
|
|
1704
|
-
}), a?.name && (c.function.name = a.name), a?.arguments && (c.function.arguments += a.arguments,
|
|
1704
|
+
}), a?.name && (c.function.name = a.name), a?.arguments && (c.function.arguments += a.arguments, Jt(t(this, z, "f"), c) && (c.function.parsed_arguments = kn(c.function.arguments)));
|
|
1705
1705
|
}
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
@@ -1747,12 +1747,12 @@ var Dn = (e, t) => {
|
|
|
1747
1747
|
};
|
|
1748
1748
|
}
|
|
1749
1749
|
toReadableStream() {
|
|
1750
|
-
return new
|
|
1750
|
+
return new at(this[Symbol.asyncIterator].bind(this), this.controller).toReadableStream();
|
|
1751
1751
|
}
|
|
1752
1752
|
};
|
|
1753
|
-
function
|
|
1753
|
+
function Bn(e, t) {
|
|
1754
1754
|
let { id: n, choices: r, created: i, model: o, system_fingerprint: s, ...c } = e;
|
|
1755
|
-
return
|
|
1755
|
+
return Wt({
|
|
1756
1756
|
...c,
|
|
1757
1757
|
id: n,
|
|
1758
1758
|
choices: r.map(({ message: t, finish_reason: n, index: r, logprobs: i, ...o }) => {
|
|
@@ -1791,10 +1791,10 @@ function zn(e, t) {
|
|
|
1791
1791
|
refusal: t.refusal ?? null,
|
|
1792
1792
|
tool_calls: l.map((t, n) => {
|
|
1793
1793
|
let { function: i, type: o, id: s, ...c } = t, { arguments: l, name: u, ...d } = i || {};
|
|
1794
|
-
if (s == null) throw new a(`missing choices[${r}].tool_calls[${n}].id\n${
|
|
1795
|
-
if (o == null) throw new a(`missing choices[${r}].tool_calls[${n}].type\n${
|
|
1796
|
-
if (u == null) throw new a(`missing choices[${r}].tool_calls[${n}].function.name\n${
|
|
1797
|
-
if (l == null) throw new a(`missing choices[${r}].tool_calls[${n}].function.arguments\n${
|
|
1794
|
+
if (s == null) throw new a(`missing choices[${r}].tool_calls[${n}].id\n${Vn(e)}`);
|
|
1795
|
+
if (o == null) throw new a(`missing choices[${r}].tool_calls[${n}].type\n${Vn(e)}`);
|
|
1796
|
+
if (u == null) throw new a(`missing choices[${r}].tool_calls[${n}].function.name\n${Vn(e)}`);
|
|
1797
|
+
if (l == null) throw new a(`missing choices[${r}].tool_calls[${n}].function.arguments\n${Vn(e)}`);
|
|
1798
1798
|
return {
|
|
1799
1799
|
...c,
|
|
1800
1800
|
id: s,
|
|
@@ -1826,12 +1826,12 @@ function zn(e, t) {
|
|
|
1826
1826
|
...s ? { system_fingerprint: s } : {}
|
|
1827
1827
|
}, t);
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1829
|
+
function Vn(e) {
|
|
1830
1830
|
return JSON.stringify(e);
|
|
1831
1831
|
}
|
|
1832
1832
|
//#endregion
|
|
1833
1833
|
//#region node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
1834
|
-
var
|
|
1834
|
+
var Hn = class e extends zn {
|
|
1835
1835
|
static fromReadableStream(t) {
|
|
1836
1836
|
let n = new e(null);
|
|
1837
1837
|
return n._run(() => n._fromReadableStream(t)), n;
|
|
@@ -1846,9 +1846,9 @@ var Vn = class e extends Rn {
|
|
|
1846
1846
|
};
|
|
1847
1847
|
return i._run(() => i._runTools(t, n, a)), i;
|
|
1848
1848
|
}
|
|
1849
|
-
},
|
|
1849
|
+
}, Un = class extends N {
|
|
1850
1850
|
constructor() {
|
|
1851
|
-
super(...arguments), this.messages = new
|
|
1851
|
+
super(...arguments), this.messages = new Bt(this._client);
|
|
1852
1852
|
}
|
|
1853
1853
|
create(e, t) {
|
|
1854
1854
|
return this._client.post("/chat/completions", {
|
|
@@ -1859,59 +1859,59 @@ var Vn = class e extends Rn {
|
|
|
1859
1859
|
});
|
|
1860
1860
|
}
|
|
1861
1861
|
retrieve(e, t) {
|
|
1862
|
-
return this._client.get(
|
|
1862
|
+
return this._client.get(P`/chat/completions/${e}`, {
|
|
1863
1863
|
...t,
|
|
1864
1864
|
__security: { bearerAuth: !0 }
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
1867
|
update(e, t, n) {
|
|
1868
|
-
return this._client.post(
|
|
1868
|
+
return this._client.post(P`/chat/completions/${e}`, {
|
|
1869
1869
|
body: t,
|
|
1870
1870
|
...n,
|
|
1871
1871
|
__security: { bearerAuth: !0 }
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
1874
|
list(e = {}, t) {
|
|
1875
|
-
return this._client.getAPIList("/chat/completions",
|
|
1875
|
+
return this._client.getAPIList("/chat/completions", k, {
|
|
1876
1876
|
query: e,
|
|
1877
1877
|
...t,
|
|
1878
1878
|
__security: { bearerAuth: !0 }
|
|
1879
1879
|
});
|
|
1880
1880
|
}
|
|
1881
1881
|
delete(e, t) {
|
|
1882
|
-
return this._client.delete(
|
|
1882
|
+
return this._client.delete(P`/chat/completions/${e}`, {
|
|
1883
1883
|
...t,
|
|
1884
1884
|
__security: { bearerAuth: !0 }
|
|
1885
1885
|
});
|
|
1886
1886
|
}
|
|
1887
1887
|
parse(e, t) {
|
|
1888
|
-
return
|
|
1888
|
+
return Zt(e.tools), this._client.chat.completions.create(e, {
|
|
1889
1889
|
...t,
|
|
1890
1890
|
headers: {
|
|
1891
1891
|
...t?.headers,
|
|
1892
1892
|
"X-Stainless-Helper-Method": "chat.completions.parse"
|
|
1893
1893
|
}
|
|
1894
|
-
})._thenUnwrap((t) =>
|
|
1894
|
+
})._thenUnwrap((t) => Gt(t, e));
|
|
1895
1895
|
}
|
|
1896
1896
|
runTools(e, t) {
|
|
1897
|
-
return e.stream ?
|
|
1897
|
+
return e.stream ? Hn.runTools(this._client, e, t) : wn.runTools(this._client, e, t);
|
|
1898
1898
|
}
|
|
1899
1899
|
stream(e, t) {
|
|
1900
|
-
return
|
|
1900
|
+
return zn.createChatCompletion(this._client, e, t);
|
|
1901
1901
|
}
|
|
1902
1902
|
};
|
|
1903
|
-
|
|
1903
|
+
Un.Messages = Bt;
|
|
1904
1904
|
//#endregion
|
|
1905
1905
|
//#region node_modules/openai/resources/chat/chat.mjs
|
|
1906
|
-
var
|
|
1906
|
+
var Wn = class extends N {
|
|
1907
1907
|
constructor() {
|
|
1908
|
-
super(...arguments), this.completions = new
|
|
1908
|
+
super(...arguments), this.completions = new Un(this._client);
|
|
1909
1909
|
}
|
|
1910
1910
|
};
|
|
1911
|
-
|
|
1911
|
+
Wn.Completions = Un;
|
|
1912
1912
|
//#endregion
|
|
1913
1913
|
//#region node_modules/openai/resources/admin/organization/admin-api-keys.mjs
|
|
1914
|
-
var
|
|
1914
|
+
var Gn = class extends N {
|
|
1915
1915
|
create(e, t) {
|
|
1916
1916
|
return this._client.post("/organization/admin_api_keys", {
|
|
1917
1917
|
body: e,
|
|
@@ -1920,33 +1920,33 @@ var Wn = class extends P {
|
|
|
1920
1920
|
});
|
|
1921
1921
|
}
|
|
1922
1922
|
retrieve(e, t) {
|
|
1923
|
-
return this._client.get(
|
|
1923
|
+
return this._client.get(P`/organization/admin_api_keys/${e}`, {
|
|
1924
1924
|
...t,
|
|
1925
1925
|
__security: { adminAPIKeyAuth: !0 }
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
1928
|
list(e = {}, t) {
|
|
1929
|
-
return this._client.getAPIList("/organization/admin_api_keys",
|
|
1929
|
+
return this._client.getAPIList("/organization/admin_api_keys", k, {
|
|
1930
1930
|
query: e,
|
|
1931
1931
|
...t,
|
|
1932
1932
|
__security: { adminAPIKeyAuth: !0 }
|
|
1933
1933
|
});
|
|
1934
1934
|
}
|
|
1935
1935
|
delete(e, t) {
|
|
1936
|
-
return this._client.delete(
|
|
1936
|
+
return this._client.delete(P`/organization/admin_api_keys/${e}`, {
|
|
1937
1937
|
...t,
|
|
1938
1938
|
__security: { adminAPIKeyAuth: !0 }
|
|
1939
1939
|
});
|
|
1940
1940
|
}
|
|
1941
|
-
},
|
|
1941
|
+
}, Kn = class extends N {
|
|
1942
1942
|
list(e = {}, t) {
|
|
1943
|
-
return this._client.getAPIList("/organization/audit_logs",
|
|
1943
|
+
return this._client.getAPIList("/organization/audit_logs", A, {
|
|
1944
1944
|
query: e,
|
|
1945
1945
|
...t,
|
|
1946
1946
|
__security: { adminAPIKeyAuth: !0 }
|
|
1947
1947
|
});
|
|
1948
1948
|
}
|
|
1949
|
-
},
|
|
1949
|
+
}, qn = class extends N {
|
|
1950
1950
|
create(e, t) {
|
|
1951
1951
|
return this._client.post("/organization/certificates", {
|
|
1952
1952
|
body: e,
|
|
@@ -1955,34 +1955,34 @@ var Wn = class extends P {
|
|
|
1955
1955
|
});
|
|
1956
1956
|
}
|
|
1957
1957
|
retrieve(e, t = {}, n) {
|
|
1958
|
-
return this._client.get(
|
|
1958
|
+
return this._client.get(P`/organization/certificates/${e}`, {
|
|
1959
1959
|
query: t,
|
|
1960
1960
|
...n,
|
|
1961
1961
|
__security: { adminAPIKeyAuth: !0 }
|
|
1962
1962
|
});
|
|
1963
1963
|
}
|
|
1964
1964
|
update(e, t, n) {
|
|
1965
|
-
return this._client.post(
|
|
1965
|
+
return this._client.post(P`/organization/certificates/${e}`, {
|
|
1966
1966
|
body: t,
|
|
1967
1967
|
...n,
|
|
1968
1968
|
__security: { adminAPIKeyAuth: !0 }
|
|
1969
1969
|
});
|
|
1970
1970
|
}
|
|
1971
1971
|
list(e = {}, t) {
|
|
1972
|
-
return this._client.getAPIList("/organization/certificates",
|
|
1972
|
+
return this._client.getAPIList("/organization/certificates", A, {
|
|
1973
1973
|
query: e,
|
|
1974
1974
|
...t,
|
|
1975
1975
|
__security: { adminAPIKeyAuth: !0 }
|
|
1976
1976
|
});
|
|
1977
1977
|
}
|
|
1978
1978
|
delete(e, t) {
|
|
1979
|
-
return this._client.delete(
|
|
1979
|
+
return this._client.delete(P`/organization/certificates/${e}`, {
|
|
1980
1980
|
...t,
|
|
1981
1981
|
__security: { adminAPIKeyAuth: !0 }
|
|
1982
1982
|
});
|
|
1983
1983
|
}
|
|
1984
1984
|
activate(e, t) {
|
|
1985
|
-
return this._client.getAPIList("/organization/certificates/activate",
|
|
1985
|
+
return this._client.getAPIList("/organization/certificates/activate", O, {
|
|
1986
1986
|
body: e,
|
|
1987
1987
|
method: "post",
|
|
1988
1988
|
...t,
|
|
@@ -1990,14 +1990,14 @@ var Wn = class extends P {
|
|
|
1990
1990
|
});
|
|
1991
1991
|
}
|
|
1992
1992
|
deactivate(e, t) {
|
|
1993
|
-
return this._client.getAPIList("/organization/certificates/deactivate",
|
|
1993
|
+
return this._client.getAPIList("/organization/certificates/deactivate", O, {
|
|
1994
1994
|
body: e,
|
|
1995
1995
|
method: "post",
|
|
1996
1996
|
...t,
|
|
1997
1997
|
__security: { adminAPIKeyAuth: !0 }
|
|
1998
1998
|
});
|
|
1999
1999
|
}
|
|
2000
|
-
},
|
|
2000
|
+
}, Jn = class extends N {
|
|
2001
2001
|
retrieve(e) {
|
|
2002
2002
|
return this._client.get("/organization/data_retention", {
|
|
2003
2003
|
...e,
|
|
@@ -2011,7 +2011,7 @@ var Wn = class extends P {
|
|
|
2011
2011
|
__security: { adminAPIKeyAuth: !0 }
|
|
2012
2012
|
});
|
|
2013
2013
|
}
|
|
2014
|
-
},
|
|
2014
|
+
}, Yn = class extends N {
|
|
2015
2015
|
create(e, t) {
|
|
2016
2016
|
return this._client.post("/organization/invites", {
|
|
2017
2017
|
body: e,
|
|
@@ -2020,25 +2020,25 @@ var Wn = class extends P {
|
|
|
2020
2020
|
});
|
|
2021
2021
|
}
|
|
2022
2022
|
retrieve(e, t) {
|
|
2023
|
-
return this._client.get(
|
|
2023
|
+
return this._client.get(P`/organization/invites/${e}`, {
|
|
2024
2024
|
...t,
|
|
2025
2025
|
__security: { adminAPIKeyAuth: !0 }
|
|
2026
2026
|
});
|
|
2027
2027
|
}
|
|
2028
2028
|
list(e = {}, t) {
|
|
2029
|
-
return this._client.getAPIList("/organization/invites",
|
|
2029
|
+
return this._client.getAPIList("/organization/invites", A, {
|
|
2030
2030
|
query: e,
|
|
2031
2031
|
...t,
|
|
2032
2032
|
__security: { adminAPIKeyAuth: !0 }
|
|
2033
2033
|
});
|
|
2034
2034
|
}
|
|
2035
2035
|
delete(e, t) {
|
|
2036
|
-
return this._client.delete(
|
|
2036
|
+
return this._client.delete(P`/organization/invites/${e}`, {
|
|
2037
2037
|
...t,
|
|
2038
2038
|
__security: { adminAPIKeyAuth: !0 }
|
|
2039
2039
|
});
|
|
2040
2040
|
}
|
|
2041
|
-
},
|
|
2041
|
+
}, Xn = class extends N {
|
|
2042
2042
|
create(e, t) {
|
|
2043
2043
|
return this._client.post("/organization/roles", {
|
|
2044
2044
|
body: e,
|
|
@@ -2047,32 +2047,32 @@ var Wn = class extends P {
|
|
|
2047
2047
|
});
|
|
2048
2048
|
}
|
|
2049
2049
|
retrieve(e, t) {
|
|
2050
|
-
return this._client.get(
|
|
2050
|
+
return this._client.get(P`/organization/roles/${e}`, {
|
|
2051
2051
|
...t,
|
|
2052
2052
|
__security: { adminAPIKeyAuth: !0 }
|
|
2053
2053
|
});
|
|
2054
2054
|
}
|
|
2055
2055
|
update(e, t, n) {
|
|
2056
|
-
return this._client.post(
|
|
2056
|
+
return this._client.post(P`/organization/roles/${e}`, {
|
|
2057
2057
|
body: t,
|
|
2058
2058
|
...n,
|
|
2059
2059
|
__security: { adminAPIKeyAuth: !0 }
|
|
2060
2060
|
});
|
|
2061
2061
|
}
|
|
2062
2062
|
list(e = {}, t) {
|
|
2063
|
-
return this._client.getAPIList("/organization/roles",
|
|
2063
|
+
return this._client.getAPIList("/organization/roles", j, {
|
|
2064
2064
|
query: e,
|
|
2065
2065
|
...t,
|
|
2066
2066
|
__security: { adminAPIKeyAuth: !0 }
|
|
2067
2067
|
});
|
|
2068
2068
|
}
|
|
2069
2069
|
delete(e, t) {
|
|
2070
|
-
return this._client.delete(
|
|
2070
|
+
return this._client.delete(P`/organization/roles/${e}`, {
|
|
2071
2071
|
...t,
|
|
2072
2072
|
__security: { adminAPIKeyAuth: !0 }
|
|
2073
2073
|
});
|
|
2074
2074
|
}
|
|
2075
|
-
},
|
|
2075
|
+
}, Zn = class extends N {
|
|
2076
2076
|
create(e, t) {
|
|
2077
2077
|
return this._client.post("/organization/spend_alerts", {
|
|
2078
2078
|
body: e,
|
|
@@ -2081,26 +2081,26 @@ var Wn = class extends P {
|
|
|
2081
2081
|
});
|
|
2082
2082
|
}
|
|
2083
2083
|
update(e, t, n) {
|
|
2084
|
-
return this._client.post(
|
|
2084
|
+
return this._client.post(P`/organization/spend_alerts/${e}`, {
|
|
2085
2085
|
body: t,
|
|
2086
2086
|
...n,
|
|
2087
2087
|
__security: { adminAPIKeyAuth: !0 }
|
|
2088
2088
|
});
|
|
2089
2089
|
}
|
|
2090
2090
|
list(e = {}, t) {
|
|
2091
|
-
return this._client.getAPIList("/organization/spend_alerts",
|
|
2091
|
+
return this._client.getAPIList("/organization/spend_alerts", A, {
|
|
2092
2092
|
query: e,
|
|
2093
2093
|
...t,
|
|
2094
2094
|
__security: { adminAPIKeyAuth: !0 }
|
|
2095
2095
|
});
|
|
2096
2096
|
}
|
|
2097
2097
|
delete(e, t) {
|
|
2098
|
-
return this._client.delete(
|
|
2098
|
+
return this._client.delete(P`/organization/spend_alerts/${e}`, {
|
|
2099
2099
|
...t,
|
|
2100
2100
|
__security: { adminAPIKeyAuth: !0 }
|
|
2101
2101
|
});
|
|
2102
2102
|
}
|
|
2103
|
-
},
|
|
2103
|
+
}, Qn = class extends N {
|
|
2104
2104
|
audioSpeeches(e, t) {
|
|
2105
2105
|
return this._client.get("/organization/usage/audio_speeches", {
|
|
2106
2106
|
query: e,
|
|
@@ -2178,9 +2178,9 @@ var Wn = class extends P {
|
|
|
2178
2178
|
__security: { adminAPIKeyAuth: !0 }
|
|
2179
2179
|
});
|
|
2180
2180
|
}
|
|
2181
|
-
},
|
|
2181
|
+
}, $n = class extends N {
|
|
2182
2182
|
create(e, t, n) {
|
|
2183
|
-
return this._client.post(
|
|
2183
|
+
return this._client.post(P`/organization/groups/${e}/roles`, {
|
|
2184
2184
|
body: t,
|
|
2185
2185
|
...n,
|
|
2186
2186
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2188,13 +2188,13 @@ var Wn = class extends P {
|
|
|
2188
2188
|
}
|
|
2189
2189
|
retrieve(e, t, n) {
|
|
2190
2190
|
let { group_id: r } = t;
|
|
2191
|
-
return this._client.get(
|
|
2191
|
+
return this._client.get(P`/organization/groups/${r}/roles/${e}`, {
|
|
2192
2192
|
...n,
|
|
2193
2193
|
__security: { adminAPIKeyAuth: !0 }
|
|
2194
2194
|
});
|
|
2195
2195
|
}
|
|
2196
2196
|
list(e, t = {}, n) {
|
|
2197
|
-
return this._client.getAPIList(
|
|
2197
|
+
return this._client.getAPIList(P`/organization/groups/${e}/roles`, j, {
|
|
2198
2198
|
query: t,
|
|
2199
2199
|
...n,
|
|
2200
2200
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2202,14 +2202,14 @@ var Wn = class extends P {
|
|
|
2202
2202
|
}
|
|
2203
2203
|
delete(e, t, n) {
|
|
2204
2204
|
let { group_id: r } = t;
|
|
2205
|
-
return this._client.delete(
|
|
2205
|
+
return this._client.delete(P`/organization/groups/${r}/roles/${e}`, {
|
|
2206
2206
|
...n,
|
|
2207
2207
|
__security: { adminAPIKeyAuth: !0 }
|
|
2208
2208
|
});
|
|
2209
2209
|
}
|
|
2210
|
-
},
|
|
2210
|
+
}, er = class extends N {
|
|
2211
2211
|
create(e, t, n) {
|
|
2212
|
-
return this._client.post(
|
|
2212
|
+
return this._client.post(P`/organization/groups/${e}/users`, {
|
|
2213
2213
|
body: t,
|
|
2214
2214
|
...n,
|
|
2215
2215
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2217,13 +2217,13 @@ var Wn = class extends P {
|
|
|
2217
2217
|
}
|
|
2218
2218
|
retrieve(e, t, n) {
|
|
2219
2219
|
let { group_id: r } = t;
|
|
2220
|
-
return this._client.get(
|
|
2220
|
+
return this._client.get(P`/organization/groups/${r}/users/${e}`, {
|
|
2221
2221
|
...n,
|
|
2222
2222
|
__security: { adminAPIKeyAuth: !0 }
|
|
2223
2223
|
});
|
|
2224
2224
|
}
|
|
2225
2225
|
list(e, t = {}, n) {
|
|
2226
|
-
return this._client.getAPIList(
|
|
2226
|
+
return this._client.getAPIList(P`/organization/groups/${e}/users`, j, {
|
|
2227
2227
|
query: t,
|
|
2228
2228
|
...n,
|
|
2229
2229
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2231,14 +2231,14 @@ var Wn = class extends P {
|
|
|
2231
2231
|
}
|
|
2232
2232
|
delete(e, t, n) {
|
|
2233
2233
|
let { group_id: r } = t;
|
|
2234
|
-
return this._client.delete(
|
|
2234
|
+
return this._client.delete(P`/organization/groups/${r}/users/${e}`, {
|
|
2235
2235
|
...n,
|
|
2236
2236
|
__security: { adminAPIKeyAuth: !0 }
|
|
2237
2237
|
});
|
|
2238
2238
|
}
|
|
2239
|
-
},
|
|
2239
|
+
}, tr = class extends N {
|
|
2240
2240
|
constructor() {
|
|
2241
|
-
super(...arguments), this.users = new
|
|
2241
|
+
super(...arguments), this.users = new er(this._client), this.roles = new $n(this._client);
|
|
2242
2242
|
}
|
|
2243
2243
|
create(e, t) {
|
|
2244
2244
|
return this._client.post("/organization/groups", {
|
|
@@ -2248,45 +2248,45 @@ var Wn = class extends P {
|
|
|
2248
2248
|
});
|
|
2249
2249
|
}
|
|
2250
2250
|
retrieve(e, t) {
|
|
2251
|
-
return this._client.get(
|
|
2251
|
+
return this._client.get(P`/organization/groups/${e}`, {
|
|
2252
2252
|
...t,
|
|
2253
2253
|
__security: { adminAPIKeyAuth: !0 }
|
|
2254
2254
|
});
|
|
2255
2255
|
}
|
|
2256
2256
|
update(e, t, n) {
|
|
2257
|
-
return this._client.post(
|
|
2257
|
+
return this._client.post(P`/organization/groups/${e}`, {
|
|
2258
2258
|
body: t,
|
|
2259
2259
|
...n,
|
|
2260
2260
|
__security: { adminAPIKeyAuth: !0 }
|
|
2261
2261
|
});
|
|
2262
2262
|
}
|
|
2263
2263
|
list(e = {}, t) {
|
|
2264
|
-
return this._client.getAPIList("/organization/groups",
|
|
2264
|
+
return this._client.getAPIList("/organization/groups", j, {
|
|
2265
2265
|
query: e,
|
|
2266
2266
|
...t,
|
|
2267
2267
|
__security: { adminAPIKeyAuth: !0 }
|
|
2268
2268
|
});
|
|
2269
2269
|
}
|
|
2270
2270
|
delete(e, t) {
|
|
2271
|
-
return this._client.delete(
|
|
2271
|
+
return this._client.delete(P`/organization/groups/${e}`, {
|
|
2272
2272
|
...t,
|
|
2273
2273
|
__security: { adminAPIKeyAuth: !0 }
|
|
2274
2274
|
});
|
|
2275
2275
|
}
|
|
2276
2276
|
};
|
|
2277
|
-
|
|
2277
|
+
tr.Users = er, tr.Roles = $n;
|
|
2278
2278
|
//#endregion
|
|
2279
2279
|
//#region node_modules/openai/resources/admin/organization/projects/api-keys.mjs
|
|
2280
|
-
var
|
|
2280
|
+
var nr = class extends N {
|
|
2281
2281
|
retrieve(e, t, n) {
|
|
2282
2282
|
let { project_id: r } = t;
|
|
2283
|
-
return this._client.get(
|
|
2283
|
+
return this._client.get(P`/organization/projects/${r}/api_keys/${e}`, {
|
|
2284
2284
|
...n,
|
|
2285
2285
|
__security: { adminAPIKeyAuth: !0 }
|
|
2286
2286
|
});
|
|
2287
2287
|
}
|
|
2288
2288
|
list(e, t = {}, n) {
|
|
2289
|
-
return this._client.getAPIList(
|
|
2289
|
+
return this._client.getAPIList(P`/organization/projects/${e}/api_keys`, A, {
|
|
2290
2290
|
query: t,
|
|
2291
2291
|
...n,
|
|
2292
2292
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2294,21 +2294,21 @@ var tr = class extends P {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
delete(e, t, n) {
|
|
2296
2296
|
let { project_id: r } = t;
|
|
2297
|
-
return this._client.delete(
|
|
2297
|
+
return this._client.delete(P`/organization/projects/${r}/api_keys/${e}`, {
|
|
2298
2298
|
...n,
|
|
2299
2299
|
__security: { adminAPIKeyAuth: !0 }
|
|
2300
2300
|
});
|
|
2301
2301
|
}
|
|
2302
|
-
},
|
|
2302
|
+
}, rr = class extends N {
|
|
2303
2303
|
list(e, t = {}, n) {
|
|
2304
|
-
return this._client.getAPIList(
|
|
2304
|
+
return this._client.getAPIList(P`/organization/projects/${e}/certificates`, A, {
|
|
2305
2305
|
query: t,
|
|
2306
2306
|
...n,
|
|
2307
2307
|
__security: { adminAPIKeyAuth: !0 }
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
2310
|
activate(e, t, n) {
|
|
2311
|
-
return this._client.getAPIList(
|
|
2311
|
+
return this._client.getAPIList(P`/organization/projects/${e}/certificates/activate`, O, {
|
|
2312
2312
|
body: t,
|
|
2313
2313
|
method: "post",
|
|
2314
2314
|
...n,
|
|
@@ -2316,64 +2316,64 @@ var tr = class extends P {
|
|
|
2316
2316
|
});
|
|
2317
2317
|
}
|
|
2318
2318
|
deactivate(e, t, n) {
|
|
2319
|
-
return this._client.getAPIList(
|
|
2319
|
+
return this._client.getAPIList(P`/organization/projects/${e}/certificates/deactivate`, O, {
|
|
2320
2320
|
body: t,
|
|
2321
2321
|
method: "post",
|
|
2322
2322
|
...n,
|
|
2323
2323
|
__security: { adminAPIKeyAuth: !0 }
|
|
2324
2324
|
});
|
|
2325
2325
|
}
|
|
2326
|
-
},
|
|
2326
|
+
}, ir = class extends N {
|
|
2327
2327
|
retrieve(e, t) {
|
|
2328
|
-
return this._client.get(
|
|
2328
|
+
return this._client.get(P`/organization/projects/${e}/data_retention`, {
|
|
2329
2329
|
...t,
|
|
2330
2330
|
__security: { adminAPIKeyAuth: !0 }
|
|
2331
2331
|
});
|
|
2332
2332
|
}
|
|
2333
2333
|
update(e, t, n) {
|
|
2334
|
-
return this._client.post(
|
|
2334
|
+
return this._client.post(P`/organization/projects/${e}/data_retention`, {
|
|
2335
2335
|
body: t,
|
|
2336
2336
|
...n,
|
|
2337
2337
|
__security: { adminAPIKeyAuth: !0 }
|
|
2338
2338
|
});
|
|
2339
2339
|
}
|
|
2340
|
-
},
|
|
2340
|
+
}, ar = class extends N {
|
|
2341
2341
|
retrieve(e, t) {
|
|
2342
|
-
return this._client.get(
|
|
2342
|
+
return this._client.get(P`/organization/projects/${e}/hosted_tool_permissions`, {
|
|
2343
2343
|
...t,
|
|
2344
2344
|
__security: { adminAPIKeyAuth: !0 }
|
|
2345
2345
|
});
|
|
2346
2346
|
}
|
|
2347
2347
|
update(e, t, n) {
|
|
2348
|
-
return this._client.post(
|
|
2348
|
+
return this._client.post(P`/organization/projects/${e}/hosted_tool_permissions`, {
|
|
2349
2349
|
body: t,
|
|
2350
2350
|
...n,
|
|
2351
2351
|
__security: { adminAPIKeyAuth: !0 }
|
|
2352
2352
|
});
|
|
2353
2353
|
}
|
|
2354
|
-
},
|
|
2354
|
+
}, or = class extends N {
|
|
2355
2355
|
retrieve(e, t) {
|
|
2356
|
-
return this._client.get(
|
|
2356
|
+
return this._client.get(P`/organization/projects/${e}/model_permissions`, {
|
|
2357
2357
|
...t,
|
|
2358
2358
|
__security: { adminAPIKeyAuth: !0 }
|
|
2359
2359
|
});
|
|
2360
2360
|
}
|
|
2361
2361
|
update(e, t, n) {
|
|
2362
|
-
return this._client.post(
|
|
2362
|
+
return this._client.post(P`/organization/projects/${e}/model_permissions`, {
|
|
2363
2363
|
body: t,
|
|
2364
2364
|
...n,
|
|
2365
2365
|
__security: { adminAPIKeyAuth: !0 }
|
|
2366
2366
|
});
|
|
2367
2367
|
}
|
|
2368
2368
|
delete(e, t) {
|
|
2369
|
-
return this._client.delete(
|
|
2369
|
+
return this._client.delete(P`/organization/projects/${e}/model_permissions`, {
|
|
2370
2370
|
...t,
|
|
2371
2371
|
__security: { adminAPIKeyAuth: !0 }
|
|
2372
2372
|
});
|
|
2373
2373
|
}
|
|
2374
|
-
},
|
|
2374
|
+
}, sr = class extends N {
|
|
2375
2375
|
listRateLimits(e, t = {}, n) {
|
|
2376
|
-
return this._client.getAPIList(
|
|
2376
|
+
return this._client.getAPIList(P`/organization/projects/${e}/rate_limits`, A, {
|
|
2377
2377
|
query: t,
|
|
2378
2378
|
...n,
|
|
2379
2379
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2381,15 +2381,15 @@ var tr = class extends P {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
updateRateLimit(e, t, n) {
|
|
2383
2383
|
let { project_id: r, ...i } = t;
|
|
2384
|
-
return this._client.post(
|
|
2384
|
+
return this._client.post(P`/organization/projects/${r}/rate_limits/${e}`, {
|
|
2385
2385
|
body: i,
|
|
2386
2386
|
...n,
|
|
2387
2387
|
__security: { adminAPIKeyAuth: !0 }
|
|
2388
2388
|
});
|
|
2389
2389
|
}
|
|
2390
|
-
},
|
|
2390
|
+
}, cr = class extends N {
|
|
2391
2391
|
create(e, t, n) {
|
|
2392
|
-
return this._client.post(
|
|
2392
|
+
return this._client.post(P`/projects/${e}/roles`, {
|
|
2393
2393
|
body: t,
|
|
2394
2394
|
...n,
|
|
2395
2395
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2397,21 +2397,21 @@ var tr = class extends P {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
retrieve(e, t, n) {
|
|
2399
2399
|
let { project_id: r } = t;
|
|
2400
|
-
return this._client.get(
|
|
2400
|
+
return this._client.get(P`/projects/${r}/roles/${e}`, {
|
|
2401
2401
|
...n,
|
|
2402
2402
|
__security: { adminAPIKeyAuth: !0 }
|
|
2403
2403
|
});
|
|
2404
2404
|
}
|
|
2405
2405
|
update(e, t, n) {
|
|
2406
2406
|
let { project_id: r, ...i } = t;
|
|
2407
|
-
return this._client.post(
|
|
2407
|
+
return this._client.post(P`/projects/${r}/roles/${e}`, {
|
|
2408
2408
|
body: i,
|
|
2409
2409
|
...n,
|
|
2410
2410
|
__security: { adminAPIKeyAuth: !0 }
|
|
2411
2411
|
});
|
|
2412
2412
|
}
|
|
2413
2413
|
list(e, t = {}, n) {
|
|
2414
|
-
return this._client.getAPIList(
|
|
2414
|
+
return this._client.getAPIList(P`/projects/${e}/roles`, j, {
|
|
2415
2415
|
query: t,
|
|
2416
2416
|
...n,
|
|
2417
2417
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2419,14 +2419,14 @@ var tr = class extends P {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
delete(e, t, n) {
|
|
2421
2421
|
let { project_id: r } = t;
|
|
2422
|
-
return this._client.delete(
|
|
2422
|
+
return this._client.delete(P`/projects/${r}/roles/${e}`, {
|
|
2423
2423
|
...n,
|
|
2424
2424
|
__security: { adminAPIKeyAuth: !0 }
|
|
2425
2425
|
});
|
|
2426
2426
|
}
|
|
2427
|
-
},
|
|
2427
|
+
}, lr = class extends N {
|
|
2428
2428
|
create(e, t, n) {
|
|
2429
|
-
return this._client.post(
|
|
2429
|
+
return this._client.post(P`/organization/projects/${e}/service_accounts`, {
|
|
2430
2430
|
body: t,
|
|
2431
2431
|
...n,
|
|
2432
2432
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2434,21 +2434,21 @@ var tr = class extends P {
|
|
|
2434
2434
|
}
|
|
2435
2435
|
retrieve(e, t, n) {
|
|
2436
2436
|
let { project_id: r } = t;
|
|
2437
|
-
return this._client.get(
|
|
2437
|
+
return this._client.get(P`/organization/projects/${r}/service_accounts/${e}`, {
|
|
2438
2438
|
...n,
|
|
2439
2439
|
__security: { adminAPIKeyAuth: !0 }
|
|
2440
2440
|
});
|
|
2441
2441
|
}
|
|
2442
2442
|
update(e, t, n) {
|
|
2443
2443
|
let { project_id: r, ...i } = t;
|
|
2444
|
-
return this._client.post(
|
|
2444
|
+
return this._client.post(P`/organization/projects/${r}/service_accounts/${e}`, {
|
|
2445
2445
|
body: i,
|
|
2446
2446
|
...n,
|
|
2447
2447
|
__security: { adminAPIKeyAuth: !0 }
|
|
2448
2448
|
});
|
|
2449
2449
|
}
|
|
2450
2450
|
list(e, t = {}, n) {
|
|
2451
|
-
return this._client.getAPIList(
|
|
2451
|
+
return this._client.getAPIList(P`/organization/projects/${e}/service_accounts`, A, {
|
|
2452
2452
|
query: t,
|
|
2453
2453
|
...n,
|
|
2454
2454
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2456,14 +2456,14 @@ var tr = class extends P {
|
|
|
2456
2456
|
}
|
|
2457
2457
|
delete(e, t, n) {
|
|
2458
2458
|
let { project_id: r } = t;
|
|
2459
|
-
return this._client.delete(
|
|
2459
|
+
return this._client.delete(P`/organization/projects/${r}/service_accounts/${e}`, {
|
|
2460
2460
|
...n,
|
|
2461
2461
|
__security: { adminAPIKeyAuth: !0 }
|
|
2462
2462
|
});
|
|
2463
2463
|
}
|
|
2464
|
-
},
|
|
2464
|
+
}, ur = class extends N {
|
|
2465
2465
|
create(e, t, n) {
|
|
2466
|
-
return this._client.post(
|
|
2466
|
+
return this._client.post(P`/organization/projects/${e}/spend_alerts`, {
|
|
2467
2467
|
body: t,
|
|
2468
2468
|
...n,
|
|
2469
2469
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2471,14 +2471,14 @@ var tr = class extends P {
|
|
|
2471
2471
|
}
|
|
2472
2472
|
update(e, t, n) {
|
|
2473
2473
|
let { project_id: r, ...i } = t;
|
|
2474
|
-
return this._client.post(
|
|
2474
|
+
return this._client.post(P`/organization/projects/${r}/spend_alerts/${e}`, {
|
|
2475
2475
|
body: i,
|
|
2476
2476
|
...n,
|
|
2477
2477
|
__security: { adminAPIKeyAuth: !0 }
|
|
2478
2478
|
});
|
|
2479
2479
|
}
|
|
2480
2480
|
list(e, t = {}, n) {
|
|
2481
|
-
return this._client.getAPIList(
|
|
2481
|
+
return this._client.getAPIList(P`/organization/projects/${e}/spend_alerts`, A, {
|
|
2482
2482
|
query: t,
|
|
2483
2483
|
...n,
|
|
2484
2484
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2486,15 +2486,15 @@ var tr = class extends P {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
delete(e, t, n) {
|
|
2488
2488
|
let { project_id: r } = t;
|
|
2489
|
-
return this._client.delete(
|
|
2489
|
+
return this._client.delete(P`/organization/projects/${r}/spend_alerts/${e}`, {
|
|
2490
2490
|
...n,
|
|
2491
2491
|
__security: { adminAPIKeyAuth: !0 }
|
|
2492
2492
|
});
|
|
2493
2493
|
}
|
|
2494
|
-
},
|
|
2494
|
+
}, dr = class extends N {
|
|
2495
2495
|
create(e, t, n) {
|
|
2496
2496
|
let { project_id: r, ...i } = t;
|
|
2497
|
-
return this._client.post(
|
|
2497
|
+
return this._client.post(P`/projects/${r}/groups/${e}/roles`, {
|
|
2498
2498
|
body: i,
|
|
2499
2499
|
...n,
|
|
2500
2500
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2502,14 +2502,14 @@ var tr = class extends P {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
retrieve(e, t, n) {
|
|
2504
2504
|
let { project_id: r, group_id: i } = t;
|
|
2505
|
-
return this._client.get(
|
|
2505
|
+
return this._client.get(P`/projects/${r}/groups/${i}/roles/${e}`, {
|
|
2506
2506
|
...n,
|
|
2507
2507
|
__security: { adminAPIKeyAuth: !0 }
|
|
2508
2508
|
});
|
|
2509
2509
|
}
|
|
2510
2510
|
list(e, t, n) {
|
|
2511
2511
|
let { project_id: r, ...i } = t;
|
|
2512
|
-
return this._client.getAPIList(
|
|
2512
|
+
return this._client.getAPIList(P`/projects/${r}/groups/${e}/roles`, j, {
|
|
2513
2513
|
query: i,
|
|
2514
2514
|
...n,
|
|
2515
2515
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2517,17 +2517,17 @@ var tr = class extends P {
|
|
|
2517
2517
|
}
|
|
2518
2518
|
delete(e, t, n) {
|
|
2519
2519
|
let { project_id: r, group_id: i } = t;
|
|
2520
|
-
return this._client.delete(
|
|
2520
|
+
return this._client.delete(P`/projects/${r}/groups/${i}/roles/${e}`, {
|
|
2521
2521
|
...n,
|
|
2522
2522
|
__security: { adminAPIKeyAuth: !0 }
|
|
2523
2523
|
});
|
|
2524
2524
|
}
|
|
2525
|
-
},
|
|
2525
|
+
}, fr = class extends N {
|
|
2526
2526
|
constructor() {
|
|
2527
|
-
super(...arguments), this.roles = new
|
|
2527
|
+
super(...arguments), this.roles = new dr(this._client);
|
|
2528
2528
|
}
|
|
2529
2529
|
create(e, t, n) {
|
|
2530
|
-
return this._client.post(
|
|
2530
|
+
return this._client.post(P`/organization/projects/${e}/groups`, {
|
|
2531
2531
|
body: t,
|
|
2532
2532
|
...n,
|
|
2533
2533
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2535,14 +2535,14 @@ var tr = class extends P {
|
|
|
2535
2535
|
}
|
|
2536
2536
|
retrieve(e, t, n) {
|
|
2537
2537
|
let { project_id: r, ...i } = t;
|
|
2538
|
-
return this._client.get(
|
|
2538
|
+
return this._client.get(P`/organization/projects/${r}/groups/${e}`, {
|
|
2539
2539
|
query: i,
|
|
2540
2540
|
...n,
|
|
2541
2541
|
__security: { adminAPIKeyAuth: !0 }
|
|
2542
2542
|
});
|
|
2543
2543
|
}
|
|
2544
2544
|
list(e, t = {}, n) {
|
|
2545
|
-
return this._client.getAPIList(
|
|
2545
|
+
return this._client.getAPIList(P`/organization/projects/${e}/groups`, j, {
|
|
2546
2546
|
query: t,
|
|
2547
2547
|
...n,
|
|
2548
2548
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2550,19 +2550,19 @@ var tr = class extends P {
|
|
|
2550
2550
|
}
|
|
2551
2551
|
delete(e, t, n) {
|
|
2552
2552
|
let { project_id: r } = t;
|
|
2553
|
-
return this._client.delete(
|
|
2553
|
+
return this._client.delete(P`/organization/projects/${r}/groups/${e}`, {
|
|
2554
2554
|
...n,
|
|
2555
2555
|
__security: { adminAPIKeyAuth: !0 }
|
|
2556
2556
|
});
|
|
2557
2557
|
}
|
|
2558
2558
|
};
|
|
2559
|
-
|
|
2559
|
+
fr.Roles = dr;
|
|
2560
2560
|
//#endregion
|
|
2561
2561
|
//#region node_modules/openai/resources/admin/organization/projects/users/roles.mjs
|
|
2562
|
-
var
|
|
2562
|
+
var pr = class extends N {
|
|
2563
2563
|
create(e, t, n) {
|
|
2564
2564
|
let { project_id: r, ...i } = t;
|
|
2565
|
-
return this._client.post(
|
|
2565
|
+
return this._client.post(P`/projects/${r}/users/${e}/roles`, {
|
|
2566
2566
|
body: i,
|
|
2567
2567
|
...n,
|
|
2568
2568
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2570,14 +2570,14 @@ var fr = class extends P {
|
|
|
2570
2570
|
}
|
|
2571
2571
|
retrieve(e, t, n) {
|
|
2572
2572
|
let { project_id: r, user_id: i } = t;
|
|
2573
|
-
return this._client.get(
|
|
2573
|
+
return this._client.get(P`/projects/${r}/users/${i}/roles/${e}`, {
|
|
2574
2574
|
...n,
|
|
2575
2575
|
__security: { adminAPIKeyAuth: !0 }
|
|
2576
2576
|
});
|
|
2577
2577
|
}
|
|
2578
2578
|
list(e, t, n) {
|
|
2579
2579
|
let { project_id: r, ...i } = t;
|
|
2580
|
-
return this._client.getAPIList(
|
|
2580
|
+
return this._client.getAPIList(P`/projects/${r}/users/${e}/roles`, j, {
|
|
2581
2581
|
query: i,
|
|
2582
2582
|
...n,
|
|
2583
2583
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2585,17 +2585,17 @@ var fr = class extends P {
|
|
|
2585
2585
|
}
|
|
2586
2586
|
delete(e, t, n) {
|
|
2587
2587
|
let { project_id: r, user_id: i } = t;
|
|
2588
|
-
return this._client.delete(
|
|
2588
|
+
return this._client.delete(P`/projects/${r}/users/${i}/roles/${e}`, {
|
|
2589
2589
|
...n,
|
|
2590
2590
|
__security: { adminAPIKeyAuth: !0 }
|
|
2591
2591
|
});
|
|
2592
2592
|
}
|
|
2593
|
-
},
|
|
2593
|
+
}, mr = class extends N {
|
|
2594
2594
|
constructor() {
|
|
2595
|
-
super(...arguments), this.roles = new
|
|
2595
|
+
super(...arguments), this.roles = new pr(this._client);
|
|
2596
2596
|
}
|
|
2597
2597
|
create(e, t, n) {
|
|
2598
|
-
return this._client.post(
|
|
2598
|
+
return this._client.post(P`/organization/projects/${e}/users`, {
|
|
2599
2599
|
body: t,
|
|
2600
2600
|
...n,
|
|
2601
2601
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2603,21 +2603,21 @@ var fr = class extends P {
|
|
|
2603
2603
|
}
|
|
2604
2604
|
retrieve(e, t, n) {
|
|
2605
2605
|
let { project_id: r } = t;
|
|
2606
|
-
return this._client.get(
|
|
2606
|
+
return this._client.get(P`/organization/projects/${r}/users/${e}`, {
|
|
2607
2607
|
...n,
|
|
2608
2608
|
__security: { adminAPIKeyAuth: !0 }
|
|
2609
2609
|
});
|
|
2610
2610
|
}
|
|
2611
2611
|
update(e, t, n) {
|
|
2612
2612
|
let { project_id: r, ...i } = t;
|
|
2613
|
-
return this._client.post(
|
|
2613
|
+
return this._client.post(P`/organization/projects/${r}/users/${e}`, {
|
|
2614
2614
|
body: i,
|
|
2615
2615
|
...n,
|
|
2616
2616
|
__security: { adminAPIKeyAuth: !0 }
|
|
2617
2617
|
});
|
|
2618
2618
|
}
|
|
2619
2619
|
list(e, t = {}, n) {
|
|
2620
|
-
return this._client.getAPIList(
|
|
2620
|
+
return this._client.getAPIList(P`/organization/projects/${e}/users`, A, {
|
|
2621
2621
|
query: t,
|
|
2622
2622
|
...n,
|
|
2623
2623
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2625,18 +2625,18 @@ var fr = class extends P {
|
|
|
2625
2625
|
}
|
|
2626
2626
|
delete(e, t, n) {
|
|
2627
2627
|
let { project_id: r } = t;
|
|
2628
|
-
return this._client.delete(
|
|
2628
|
+
return this._client.delete(P`/organization/projects/${r}/users/${e}`, {
|
|
2629
2629
|
...n,
|
|
2630
2630
|
__security: { adminAPIKeyAuth: !0 }
|
|
2631
2631
|
});
|
|
2632
2632
|
}
|
|
2633
2633
|
};
|
|
2634
|
-
|
|
2634
|
+
mr.Roles = pr;
|
|
2635
2635
|
//#endregion
|
|
2636
2636
|
//#region node_modules/openai/resources/admin/organization/projects/projects.mjs
|
|
2637
|
-
var
|
|
2637
|
+
var V = class extends N {
|
|
2638
2638
|
constructor() {
|
|
2639
|
-
super(...arguments), this.users = new
|
|
2639
|
+
super(...arguments), this.users = new mr(this._client), this.serviceAccounts = new lr(this._client), this.apiKeys = new nr(this._client), this.rateLimits = new sr(this._client), this.modelPermissions = new or(this._client), this.hostedToolPermissions = new ar(this._client), this.groups = new fr(this._client), this.roles = new cr(this._client), this.dataRetention = new ir(this._client), this.spendAlerts = new ur(this._client), this.certificates = new rr(this._client);
|
|
2640
2640
|
}
|
|
2641
2641
|
create(e, t) {
|
|
2642
2642
|
return this._client.post("/organization/projects", {
|
|
@@ -2646,38 +2646,38 @@ var H = class extends P {
|
|
|
2646
2646
|
});
|
|
2647
2647
|
}
|
|
2648
2648
|
retrieve(e, t) {
|
|
2649
|
-
return this._client.get(
|
|
2649
|
+
return this._client.get(P`/organization/projects/${e}`, {
|
|
2650
2650
|
...t,
|
|
2651
2651
|
__security: { adminAPIKeyAuth: !0 }
|
|
2652
2652
|
});
|
|
2653
2653
|
}
|
|
2654
2654
|
update(e, t, n) {
|
|
2655
|
-
return this._client.post(
|
|
2655
|
+
return this._client.post(P`/organization/projects/${e}`, {
|
|
2656
2656
|
body: t,
|
|
2657
2657
|
...n,
|
|
2658
2658
|
__security: { adminAPIKeyAuth: !0 }
|
|
2659
2659
|
});
|
|
2660
2660
|
}
|
|
2661
2661
|
list(e = {}, t) {
|
|
2662
|
-
return this._client.getAPIList("/organization/projects",
|
|
2662
|
+
return this._client.getAPIList("/organization/projects", A, {
|
|
2663
2663
|
query: e,
|
|
2664
2664
|
...t,
|
|
2665
2665
|
__security: { adminAPIKeyAuth: !0 }
|
|
2666
2666
|
});
|
|
2667
2667
|
}
|
|
2668
2668
|
archive(e, t) {
|
|
2669
|
-
return this._client.post(
|
|
2669
|
+
return this._client.post(P`/organization/projects/${e}/archive`, {
|
|
2670
2670
|
...t,
|
|
2671
2671
|
__security: { adminAPIKeyAuth: !0 }
|
|
2672
2672
|
});
|
|
2673
2673
|
}
|
|
2674
2674
|
};
|
|
2675
|
-
|
|
2675
|
+
V.Users = mr, V.ServiceAccounts = lr, V.APIKeys = nr, V.RateLimits = sr, V.ModelPermissions = or, V.HostedToolPermissions = ar, V.Groups = fr, V.Roles = cr, V.DataRetention = ir, V.SpendAlerts = ur, V.Certificates = rr;
|
|
2676
2676
|
//#endregion
|
|
2677
2677
|
//#region node_modules/openai/resources/admin/organization/users/roles.mjs
|
|
2678
|
-
var
|
|
2678
|
+
var hr = class extends N {
|
|
2679
2679
|
create(e, t, n) {
|
|
2680
|
-
return this._client.post(
|
|
2680
|
+
return this._client.post(P`/organization/users/${e}/roles`, {
|
|
2681
2681
|
body: t,
|
|
2682
2682
|
...n,
|
|
2683
2683
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2685,13 +2685,13 @@ var mr = class extends P {
|
|
|
2685
2685
|
}
|
|
2686
2686
|
retrieve(e, t, n) {
|
|
2687
2687
|
let { user_id: r } = t;
|
|
2688
|
-
return this._client.get(
|
|
2688
|
+
return this._client.get(P`/organization/users/${r}/roles/${e}`, {
|
|
2689
2689
|
...n,
|
|
2690
2690
|
__security: { adminAPIKeyAuth: !0 }
|
|
2691
2691
|
});
|
|
2692
2692
|
}
|
|
2693
2693
|
list(e, t = {}, n) {
|
|
2694
|
-
return this._client.getAPIList(
|
|
2694
|
+
return this._client.getAPIList(P`/organization/users/${e}/roles`, j, {
|
|
2695
2695
|
query: t,
|
|
2696
2696
|
...n,
|
|
2697
2697
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -2699,65 +2699,65 @@ var mr = class extends P {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
delete(e, t, n) {
|
|
2701
2701
|
let { user_id: r } = t;
|
|
2702
|
-
return this._client.delete(
|
|
2702
|
+
return this._client.delete(P`/organization/users/${r}/roles/${e}`, {
|
|
2703
2703
|
...n,
|
|
2704
2704
|
__security: { adminAPIKeyAuth: !0 }
|
|
2705
2705
|
});
|
|
2706
2706
|
}
|
|
2707
|
-
},
|
|
2707
|
+
}, gr = class extends N {
|
|
2708
2708
|
constructor() {
|
|
2709
|
-
super(...arguments), this.roles = new
|
|
2709
|
+
super(...arguments), this.roles = new hr(this._client);
|
|
2710
2710
|
}
|
|
2711
2711
|
retrieve(e, t) {
|
|
2712
|
-
return this._client.get(
|
|
2712
|
+
return this._client.get(P`/organization/users/${e}`, {
|
|
2713
2713
|
...t,
|
|
2714
2714
|
__security: { adminAPIKeyAuth: !0 }
|
|
2715
2715
|
});
|
|
2716
2716
|
}
|
|
2717
2717
|
update(e, t, n) {
|
|
2718
|
-
return this._client.post(
|
|
2718
|
+
return this._client.post(P`/organization/users/${e}`, {
|
|
2719
2719
|
body: t,
|
|
2720
2720
|
...n,
|
|
2721
2721
|
__security: { adminAPIKeyAuth: !0 }
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
2724
|
list(e = {}, t) {
|
|
2725
|
-
return this._client.getAPIList("/organization/users",
|
|
2725
|
+
return this._client.getAPIList("/organization/users", A, {
|
|
2726
2726
|
query: e,
|
|
2727
2727
|
...t,
|
|
2728
2728
|
__security: { adminAPIKeyAuth: !0 }
|
|
2729
2729
|
});
|
|
2730
2730
|
}
|
|
2731
2731
|
delete(e, t) {
|
|
2732
|
-
return this._client.delete(
|
|
2732
|
+
return this._client.delete(P`/organization/users/${e}`, {
|
|
2733
2733
|
...t,
|
|
2734
2734
|
__security: { adminAPIKeyAuth: !0 }
|
|
2735
2735
|
});
|
|
2736
2736
|
}
|
|
2737
2737
|
};
|
|
2738
|
-
|
|
2738
|
+
gr.Roles = hr;
|
|
2739
2739
|
//#endregion
|
|
2740
2740
|
//#region node_modules/openai/resources/admin/organization/organization.mjs
|
|
2741
|
-
var
|
|
2741
|
+
var H = class extends N {
|
|
2742
2742
|
constructor() {
|
|
2743
|
-
super(...arguments), this.auditLogs = new
|
|
2743
|
+
super(...arguments), this.auditLogs = new Kn(this._client), this.adminAPIKeys = new Gn(this._client), this.usage = new Qn(this._client), this.invites = new Yn(this._client), this.users = new gr(this._client), this.groups = new tr(this._client), this.roles = new Xn(this._client), this.dataRetention = new Jn(this._client), this.spendAlerts = new Zn(this._client), this.certificates = new qn(this._client), this.projects = new V(this._client);
|
|
2744
2744
|
}
|
|
2745
2745
|
};
|
|
2746
|
-
|
|
2746
|
+
H.AuditLogs = Kn, H.AdminAPIKeys = Gn, H.Usage = Qn, H.Invites = Yn, H.Users = gr, H.Groups = tr, H.Roles = Xn, H.DataRetention = Jn, H.SpendAlerts = Zn, H.Certificates = qn, H.Projects = V;
|
|
2747
2747
|
//#endregion
|
|
2748
2748
|
//#region node_modules/openai/resources/admin/admin.mjs
|
|
2749
|
-
var
|
|
2749
|
+
var _r = class extends N {
|
|
2750
2750
|
constructor() {
|
|
2751
|
-
super(...arguments), this.organization = new
|
|
2751
|
+
super(...arguments), this.organization = new H(this._client);
|
|
2752
2752
|
}
|
|
2753
2753
|
};
|
|
2754
|
-
|
|
2754
|
+
_r.Organization = H;
|
|
2755
2755
|
//#endregion
|
|
2756
2756
|
//#region node_modules/openai/internal/headers.mjs
|
|
2757
|
-
var
|
|
2758
|
-
function*
|
|
2757
|
+
var vr = /* @__PURE__ */ Symbol("brand.privateNullableHeaders");
|
|
2758
|
+
function* yr(e) {
|
|
2759
2759
|
if (!e) return;
|
|
2760
|
-
if (
|
|
2760
|
+
if (vr in e) {
|
|
2761
2761
|
let { values: t, nulls: n } = e;
|
|
2762
2762
|
yield* t.entries();
|
|
2763
2763
|
for (let e of n) yield [e, null];
|
|
@@ -2772,33 +2772,33 @@ function* vr(e) {
|
|
|
2772
2772
|
for (let e of r) e !== void 0 && (t && !i && (i = !0, yield [n, null]), yield [n, e]);
|
|
2773
2773
|
}
|
|
2774
2774
|
}
|
|
2775
|
-
var
|
|
2775
|
+
var U = (e) => {
|
|
2776
2776
|
let t = new Headers(), n = /* @__PURE__ */ new Set();
|
|
2777
2777
|
for (let r of e) {
|
|
2778
2778
|
let e = /* @__PURE__ */ new Set();
|
|
2779
|
-
for (let [i, a] of
|
|
2779
|
+
for (let [i, a] of yr(r)) {
|
|
2780
2780
|
let r = i.toLowerCase();
|
|
2781
2781
|
e.has(r) || (t.delete(i), e.add(r)), a === null ? (t.delete(i), n.add(r)) : (t.append(i, a), n.delete(r));
|
|
2782
2782
|
}
|
|
2783
2783
|
}
|
|
2784
2784
|
return {
|
|
2785
|
-
[
|
|
2785
|
+
[vr]: !0,
|
|
2786
2786
|
values: t,
|
|
2787
2787
|
nulls: n
|
|
2788
2788
|
};
|
|
2789
|
-
},
|
|
2789
|
+
}, br = class extends N {
|
|
2790
2790
|
create(e, t) {
|
|
2791
2791
|
return this._client.post("/audio/speech", {
|
|
2792
2792
|
body: e,
|
|
2793
2793
|
...t,
|
|
2794
|
-
headers:
|
|
2794
|
+
headers: U([{ Accept: "application/octet-stream" }, t?.headers]),
|
|
2795
2795
|
__security: { bearerAuth: !0 },
|
|
2796
2796
|
__binaryResponse: !0
|
|
2797
2797
|
});
|
|
2798
2798
|
}
|
|
2799
|
-
},
|
|
2799
|
+
}, xr = class extends N {
|
|
2800
2800
|
create(e, t) {
|
|
2801
|
-
return this._client.post("/audio/transcriptions",
|
|
2801
|
+
return this._client.post("/audio/transcriptions", M({
|
|
2802
2802
|
body: e,
|
|
2803
2803
|
...t,
|
|
2804
2804
|
stream: e.stream ?? !1,
|
|
@@ -2806,24 +2806,24 @@ var W = (e) => {
|
|
|
2806
2806
|
__security: { bearerAuth: !0 }
|
|
2807
2807
|
}, this._client));
|
|
2808
2808
|
}
|
|
2809
|
-
},
|
|
2809
|
+
}, Sr = class extends N {
|
|
2810
2810
|
create(e, t) {
|
|
2811
|
-
return this._client.post("/audio/translations",
|
|
2811
|
+
return this._client.post("/audio/translations", M({
|
|
2812
2812
|
body: e,
|
|
2813
2813
|
...t,
|
|
2814
2814
|
__metadata: { model: e.model },
|
|
2815
2815
|
__security: { bearerAuth: !0 }
|
|
2816
2816
|
}, this._client));
|
|
2817
2817
|
}
|
|
2818
|
-
},
|
|
2818
|
+
}, Cr = class extends N {
|
|
2819
2819
|
constructor() {
|
|
2820
|
-
super(...arguments), this.transcriptions = new
|
|
2820
|
+
super(...arguments), this.transcriptions = new xr(this._client), this.translations = new Sr(this._client), this.speech = new br(this._client);
|
|
2821
2821
|
}
|
|
2822
2822
|
};
|
|
2823
|
-
|
|
2823
|
+
Cr.Transcriptions = xr, Cr.Translations = Sr, Cr.Speech = br;
|
|
2824
2824
|
//#endregion
|
|
2825
2825
|
//#region node_modules/openai/resources/batches.mjs
|
|
2826
|
-
var
|
|
2826
|
+
var wr = class extends N {
|
|
2827
2827
|
create(e, t) {
|
|
2828
2828
|
return this._client.post("/batches", {
|
|
2829
2829
|
body: e,
|
|
@@ -2832,206 +2832,206 @@ var Cr = class extends P {
|
|
|
2832
2832
|
});
|
|
2833
2833
|
}
|
|
2834
2834
|
retrieve(e, t) {
|
|
2835
|
-
return this._client.get(
|
|
2835
|
+
return this._client.get(P`/batches/${e}`, {
|
|
2836
2836
|
...t,
|
|
2837
2837
|
__security: { bearerAuth: !0 }
|
|
2838
2838
|
});
|
|
2839
2839
|
}
|
|
2840
2840
|
list(e = {}, t) {
|
|
2841
|
-
return this._client.getAPIList("/batches",
|
|
2841
|
+
return this._client.getAPIList("/batches", k, {
|
|
2842
2842
|
query: e,
|
|
2843
2843
|
...t,
|
|
2844
2844
|
__security: { bearerAuth: !0 }
|
|
2845
2845
|
});
|
|
2846
2846
|
}
|
|
2847
2847
|
cancel(e, t) {
|
|
2848
|
-
return this._client.post(
|
|
2848
|
+
return this._client.post(P`/batches/${e}/cancel`, {
|
|
2849
2849
|
...t,
|
|
2850
2850
|
__security: { bearerAuth: !0 }
|
|
2851
2851
|
});
|
|
2852
2852
|
}
|
|
2853
|
-
},
|
|
2853
|
+
}, Tr = class extends N {
|
|
2854
2854
|
create(e, t) {
|
|
2855
2855
|
return this._client.post("/assistants", {
|
|
2856
2856
|
body: e,
|
|
2857
2857
|
...t,
|
|
2858
|
-
headers:
|
|
2858
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
2859
2859
|
__security: { bearerAuth: !0 }
|
|
2860
2860
|
});
|
|
2861
2861
|
}
|
|
2862
2862
|
retrieve(e, t) {
|
|
2863
|
-
return this._client.get(
|
|
2863
|
+
return this._client.get(P`/assistants/${e}`, {
|
|
2864
2864
|
...t,
|
|
2865
|
-
headers:
|
|
2865
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
2866
2866
|
__security: { bearerAuth: !0 }
|
|
2867
2867
|
});
|
|
2868
2868
|
}
|
|
2869
2869
|
update(e, t, n) {
|
|
2870
|
-
return this._client.post(
|
|
2870
|
+
return this._client.post(P`/assistants/${e}`, {
|
|
2871
2871
|
body: t,
|
|
2872
2872
|
...n,
|
|
2873
|
-
headers:
|
|
2873
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
2874
2874
|
__security: { bearerAuth: !0 }
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
2877
|
list(e = {}, t) {
|
|
2878
|
-
return this._client.getAPIList("/assistants",
|
|
2878
|
+
return this._client.getAPIList("/assistants", k, {
|
|
2879
2879
|
query: e,
|
|
2880
2880
|
...t,
|
|
2881
|
-
headers:
|
|
2881
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
2882
2882
|
__security: { bearerAuth: !0 }
|
|
2883
2883
|
});
|
|
2884
2884
|
}
|
|
2885
2885
|
delete(e, t) {
|
|
2886
|
-
return this._client.delete(
|
|
2886
|
+
return this._client.delete(P`/assistants/${e}`, {
|
|
2887
2887
|
...t,
|
|
2888
|
-
headers:
|
|
2888
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
2889
2889
|
__security: { bearerAuth: !0 }
|
|
2890
2890
|
});
|
|
2891
2891
|
}
|
|
2892
|
-
},
|
|
2892
|
+
}, Er = class extends N {
|
|
2893
2893
|
create(e, t) {
|
|
2894
2894
|
return this._client.post("/realtime/sessions", {
|
|
2895
2895
|
body: e,
|
|
2896
2896
|
...t,
|
|
2897
|
-
headers:
|
|
2897
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
2898
2898
|
__security: { bearerAuth: !0 }
|
|
2899
2899
|
});
|
|
2900
2900
|
}
|
|
2901
|
-
},
|
|
2901
|
+
}, Dr = class extends N {
|
|
2902
2902
|
create(e, t) {
|
|
2903
2903
|
return this._client.post("/realtime/transcription_sessions", {
|
|
2904
2904
|
body: e,
|
|
2905
2905
|
...t,
|
|
2906
|
-
headers:
|
|
2906
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
2907
2907
|
__security: { bearerAuth: !0 }
|
|
2908
2908
|
});
|
|
2909
2909
|
}
|
|
2910
|
-
},
|
|
2910
|
+
}, Or = class extends N {
|
|
2911
2911
|
constructor() {
|
|
2912
|
-
super(...arguments), this.sessions = new
|
|
2912
|
+
super(...arguments), this.sessions = new Er(this._client), this.transcriptionSessions = new Dr(this._client);
|
|
2913
2913
|
}
|
|
2914
2914
|
};
|
|
2915
|
-
|
|
2915
|
+
Or.Sessions = Er, Or.TranscriptionSessions = Dr;
|
|
2916
2916
|
//#endregion
|
|
2917
2917
|
//#region node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
2918
|
-
var
|
|
2918
|
+
var kr = class extends N {
|
|
2919
2919
|
create(e, t) {
|
|
2920
2920
|
return this._client.post("/chatkit/sessions", {
|
|
2921
2921
|
body: e,
|
|
2922
2922
|
...t,
|
|
2923
|
-
headers:
|
|
2923
|
+
headers: U([{ "OpenAI-Beta": "chatkit_beta=v1" }, t?.headers]),
|
|
2924
2924
|
__security: { bearerAuth: !0 }
|
|
2925
2925
|
});
|
|
2926
2926
|
}
|
|
2927
2927
|
cancel(e, t) {
|
|
2928
|
-
return this._client.post(
|
|
2928
|
+
return this._client.post(P`/chatkit/sessions/${e}/cancel`, {
|
|
2929
2929
|
...t,
|
|
2930
|
-
headers:
|
|
2930
|
+
headers: U([{ "OpenAI-Beta": "chatkit_beta=v1" }, t?.headers]),
|
|
2931
2931
|
__security: { bearerAuth: !0 }
|
|
2932
2932
|
});
|
|
2933
2933
|
}
|
|
2934
|
-
},
|
|
2934
|
+
}, Ar = class extends N {
|
|
2935
2935
|
retrieve(e, t) {
|
|
2936
|
-
return this._client.get(
|
|
2936
|
+
return this._client.get(P`/chatkit/threads/${e}`, {
|
|
2937
2937
|
...t,
|
|
2938
|
-
headers:
|
|
2938
|
+
headers: U([{ "OpenAI-Beta": "chatkit_beta=v1" }, t?.headers]),
|
|
2939
2939
|
__security: { bearerAuth: !0 }
|
|
2940
2940
|
});
|
|
2941
2941
|
}
|
|
2942
2942
|
list(e = {}, t) {
|
|
2943
|
-
return this._client.getAPIList("/chatkit/threads",
|
|
2943
|
+
return this._client.getAPIList("/chatkit/threads", A, {
|
|
2944
2944
|
query: e,
|
|
2945
2945
|
...t,
|
|
2946
|
-
headers:
|
|
2946
|
+
headers: U([{ "OpenAI-Beta": "chatkit_beta=v1" }, t?.headers]),
|
|
2947
2947
|
__security: { bearerAuth: !0 }
|
|
2948
2948
|
});
|
|
2949
2949
|
}
|
|
2950
2950
|
delete(e, t) {
|
|
2951
|
-
return this._client.delete(
|
|
2951
|
+
return this._client.delete(P`/chatkit/threads/${e}`, {
|
|
2952
2952
|
...t,
|
|
2953
|
-
headers:
|
|
2953
|
+
headers: U([{ "OpenAI-Beta": "chatkit_beta=v1" }, t?.headers]),
|
|
2954
2954
|
__security: { bearerAuth: !0 }
|
|
2955
2955
|
});
|
|
2956
2956
|
}
|
|
2957
2957
|
listItems(e, t = {}, n) {
|
|
2958
|
-
return this._client.getAPIList(
|
|
2958
|
+
return this._client.getAPIList(P`/chatkit/threads/${e}/items`, A, {
|
|
2959
2959
|
query: t,
|
|
2960
2960
|
...n,
|
|
2961
|
-
headers:
|
|
2961
|
+
headers: U([{ "OpenAI-Beta": "chatkit_beta=v1" }, n?.headers]),
|
|
2962
2962
|
__security: { bearerAuth: !0 }
|
|
2963
2963
|
});
|
|
2964
2964
|
}
|
|
2965
|
-
},
|
|
2965
|
+
}, jr = class extends N {
|
|
2966
2966
|
constructor() {
|
|
2967
|
-
super(...arguments), this.sessions = new
|
|
2967
|
+
super(...arguments), this.sessions = new kr(this._client), this.threads = new Ar(this._client);
|
|
2968
2968
|
}
|
|
2969
2969
|
};
|
|
2970
|
-
|
|
2970
|
+
jr.Sessions = kr, jr.Threads = Ar;
|
|
2971
2971
|
//#endregion
|
|
2972
2972
|
//#region node_modules/openai/resources/beta/threads/messages.mjs
|
|
2973
|
-
var
|
|
2973
|
+
var Mr = class extends N {
|
|
2974
2974
|
create(e, t, n) {
|
|
2975
|
-
return this._client.post(
|
|
2975
|
+
return this._client.post(P`/threads/${e}/messages`, {
|
|
2976
2976
|
body: t,
|
|
2977
2977
|
...n,
|
|
2978
|
-
headers:
|
|
2978
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
2979
2979
|
__security: { bearerAuth: !0 }
|
|
2980
2980
|
});
|
|
2981
2981
|
}
|
|
2982
2982
|
retrieve(e, t, n) {
|
|
2983
2983
|
let { thread_id: r } = t;
|
|
2984
|
-
return this._client.get(
|
|
2984
|
+
return this._client.get(P`/threads/${r}/messages/${e}`, {
|
|
2985
2985
|
...n,
|
|
2986
|
-
headers:
|
|
2986
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
2987
2987
|
__security: { bearerAuth: !0 }
|
|
2988
2988
|
});
|
|
2989
2989
|
}
|
|
2990
2990
|
update(e, t, n) {
|
|
2991
2991
|
let { thread_id: r, ...i } = t;
|
|
2992
|
-
return this._client.post(
|
|
2992
|
+
return this._client.post(P`/threads/${r}/messages/${e}`, {
|
|
2993
2993
|
body: i,
|
|
2994
2994
|
...n,
|
|
2995
|
-
headers:
|
|
2995
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
2996
2996
|
__security: { bearerAuth: !0 }
|
|
2997
2997
|
});
|
|
2998
2998
|
}
|
|
2999
2999
|
list(e, t = {}, n) {
|
|
3000
|
-
return this._client.getAPIList(
|
|
3000
|
+
return this._client.getAPIList(P`/threads/${e}/messages`, k, {
|
|
3001
3001
|
query: t,
|
|
3002
3002
|
...n,
|
|
3003
|
-
headers:
|
|
3003
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3004
3004
|
__security: { bearerAuth: !0 }
|
|
3005
3005
|
});
|
|
3006
3006
|
}
|
|
3007
3007
|
delete(e, t, n) {
|
|
3008
3008
|
let { thread_id: r } = t;
|
|
3009
|
-
return this._client.delete(
|
|
3009
|
+
return this._client.delete(P`/threads/${r}/messages/${e}`, {
|
|
3010
3010
|
...n,
|
|
3011
|
-
headers:
|
|
3011
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3012
3012
|
__security: { bearerAuth: !0 }
|
|
3013
3013
|
});
|
|
3014
3014
|
}
|
|
3015
|
-
},
|
|
3015
|
+
}, Nr = class extends N {
|
|
3016
3016
|
retrieve(e, t, n) {
|
|
3017
3017
|
let { thread_id: r, run_id: i, ...a } = t;
|
|
3018
|
-
return this._client.get(
|
|
3018
|
+
return this._client.get(P`/threads/${r}/runs/${i}/steps/${e}`, {
|
|
3019
3019
|
query: a,
|
|
3020
3020
|
...n,
|
|
3021
|
-
headers:
|
|
3021
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3022
3022
|
__security: { bearerAuth: !0 }
|
|
3023
3023
|
});
|
|
3024
3024
|
}
|
|
3025
3025
|
list(e, t, n) {
|
|
3026
3026
|
let { thread_id: r, ...i } = t;
|
|
3027
|
-
return this._client.getAPIList(
|
|
3027
|
+
return this._client.getAPIList(P`/threads/${r}/runs/${e}/steps`, k, {
|
|
3028
3028
|
query: i,
|
|
3029
3029
|
...n,
|
|
3030
|
-
headers:
|
|
3030
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3031
3031
|
__security: { bearerAuth: !0 }
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
|
-
},
|
|
3034
|
+
}, Pr = (e) => {
|
|
3035
3035
|
if (typeof Buffer < "u") {
|
|
3036
3036
|
let t = Buffer.from(e, "base64");
|
|
3037
3037
|
return Array.from(new Float32Array(t.buffer, t.byteOffset, t.length / Float32Array.BYTES_PER_ELEMENT));
|
|
@@ -3040,14 +3040,14 @@ var jr = class extends P {
|
|
|
3040
3040
|
for (let e = 0; e < n; e++) r[e] = t.charCodeAt(e);
|
|
3041
3041
|
return Array.from(new Float32Array(r.buffer));
|
|
3042
3042
|
}
|
|
3043
|
-
},
|
|
3043
|
+
}, W = (e) => {
|
|
3044
3044
|
if (globalThis.process !== void 0) return globalThis.process.env?.[e]?.trim() || void 0;
|
|
3045
3045
|
if (globalThis.Deno !== void 0) return globalThis.Deno.env?.get?.(e)?.trim() || void 0;
|
|
3046
|
-
}, K, q,
|
|
3046
|
+
}, G, K, Fr, q, Ir, J, Y, Lr, X, Rr, Z, zr, Br, Vr, Hr, Ur, Wr, Gr, Kr, qr, Jr, Yr, Xr, Zr = class extends pn {
|
|
3047
3047
|
constructor() {
|
|
3048
|
-
super(...arguments),
|
|
3048
|
+
super(...arguments), G.add(this), Fr.set(this, []), q.set(this, {}), Ir.set(this, {}), J.set(this, void 0), Y.set(this, void 0), Lr.set(this, void 0), X.set(this, void 0), Rr.set(this, void 0), Z.set(this, void 0), zr.set(this, void 0), Br.set(this, void 0), Vr.set(this, void 0);
|
|
3049
3049
|
}
|
|
3050
|
-
[(
|
|
3050
|
+
[(Fr = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), Lr = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Rr = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), zr = /* @__PURE__ */ new WeakMap(), Br = /* @__PURE__ */ new WeakMap(), Vr = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() {
|
|
3051
3051
|
let e = [], t = [], n = !1;
|
|
3052
3052
|
return this.on("event", (n) => {
|
|
3053
3053
|
let r = t.shift();
|
|
@@ -3088,22 +3088,22 @@ var jr = class extends P {
|
|
|
3088
3088
|
};
|
|
3089
3089
|
}
|
|
3090
3090
|
static fromReadableStream(e) {
|
|
3091
|
-
let t = new
|
|
3091
|
+
let t = new K();
|
|
3092
3092
|
return t._run(() => t._fromReadableStream(e)), t;
|
|
3093
3093
|
}
|
|
3094
3094
|
async _fromReadableStream(e, n) {
|
|
3095
3095
|
let r = n?.signal;
|
|
3096
3096
|
r && (r.aborted && this.controller.abort(), r.addEventListener("abort", () => this.controller.abort())), this._connected();
|
|
3097
|
-
let i =
|
|
3098
|
-
for await (let e of i) t(this,
|
|
3097
|
+
let i = at.fromReadableStream(e, this.controller);
|
|
3098
|
+
for await (let e of i) t(this, G, "m", Hr).call(this, e);
|
|
3099
3099
|
if (i.controller.signal?.aborted) throw new s();
|
|
3100
|
-
return this._addRun(t(this,
|
|
3100
|
+
return this._addRun(t(this, G, "m", Ur).call(this));
|
|
3101
3101
|
}
|
|
3102
3102
|
toReadableStream() {
|
|
3103
|
-
return new
|
|
3103
|
+
return new at(this[Symbol.asyncIterator].bind(this), this.controller).toReadableStream();
|
|
3104
3104
|
}
|
|
3105
3105
|
static createToolAssistantStream(e, t, n, r) {
|
|
3106
|
-
let i = new
|
|
3106
|
+
let i = new K();
|
|
3107
3107
|
return i._run(() => i._runToolAssistantStream(e, t, n, {
|
|
3108
3108
|
...r,
|
|
3109
3109
|
headers: {
|
|
@@ -3123,12 +3123,12 @@ var jr = class extends P {
|
|
|
3123
3123
|
signal: this.controller.signal
|
|
3124
3124
|
});
|
|
3125
3125
|
this._connected();
|
|
3126
|
-
for await (let e of c) t(this,
|
|
3126
|
+
for await (let e of c) t(this, G, "m", Hr).call(this, e);
|
|
3127
3127
|
if (c.controller.signal?.aborted) throw new s();
|
|
3128
|
-
return this._addRun(t(this,
|
|
3128
|
+
return this._addRun(t(this, G, "m", Ur).call(this));
|
|
3129
3129
|
}
|
|
3130
3130
|
static createThreadAssistantStream(e, t, n) {
|
|
3131
|
-
let r = new
|
|
3131
|
+
let r = new K();
|
|
3132
3132
|
return r._run(() => r._threadAssistantStream(e, t, {
|
|
3133
3133
|
...n,
|
|
3134
3134
|
headers: {
|
|
@@ -3138,7 +3138,7 @@ var jr = class extends P {
|
|
|
3138
3138
|
})), r;
|
|
3139
3139
|
}
|
|
3140
3140
|
static createAssistantStream(e, t, n, r) {
|
|
3141
|
-
let i = new
|
|
3141
|
+
let i = new K();
|
|
3142
3142
|
return i._run(() => i._runAssistantStream(e, t, n, {
|
|
3143
3143
|
...r,
|
|
3144
3144
|
headers: {
|
|
@@ -3154,20 +3154,20 @@ var jr = class extends P {
|
|
|
3154
3154
|
return t(this, Br, "f");
|
|
3155
3155
|
}
|
|
3156
3156
|
currentMessageSnapshot() {
|
|
3157
|
-
return t(this,
|
|
3157
|
+
return t(this, J, "f");
|
|
3158
3158
|
}
|
|
3159
3159
|
currentRunStepSnapshot() {
|
|
3160
3160
|
return t(this, Vr, "f");
|
|
3161
3161
|
}
|
|
3162
3162
|
async finalRunSteps() {
|
|
3163
|
-
return await this.done(), Object.values(t(this,
|
|
3163
|
+
return await this.done(), Object.values(t(this, q, "f"));
|
|
3164
3164
|
}
|
|
3165
3165
|
async finalMessages() {
|
|
3166
|
-
return await this.done(), Object.values(t(this,
|
|
3166
|
+
return await this.done(), Object.values(t(this, Ir, "f"));
|
|
3167
3167
|
}
|
|
3168
3168
|
async finalRun() {
|
|
3169
|
-
if (await this.done(), !t(this,
|
|
3170
|
-
return t(this,
|
|
3169
|
+
if (await this.done(), !t(this, Y, "f")) throw Error("Final run was not received.");
|
|
3170
|
+
return t(this, Y, "f");
|
|
3171
3171
|
}
|
|
3172
3172
|
async _createThreadAssistantStream(e, n, r) {
|
|
3173
3173
|
let i = r?.signal;
|
|
@@ -3180,9 +3180,9 @@ var jr = class extends P {
|
|
|
3180
3180
|
signal: this.controller.signal
|
|
3181
3181
|
});
|
|
3182
3182
|
this._connected();
|
|
3183
|
-
for await (let e of o) t(this,
|
|
3183
|
+
for await (let e of o) t(this, G, "m", Hr).call(this, e);
|
|
3184
3184
|
if (o.controller.signal?.aborted) throw new s();
|
|
3185
|
-
return this._addRun(t(this,
|
|
3185
|
+
return this._addRun(t(this, G, "m", Ur).call(this));
|
|
3186
3186
|
}
|
|
3187
3187
|
async _createAssistantStream(e, n, r, i) {
|
|
3188
3188
|
let a = i?.signal;
|
|
@@ -3195,9 +3195,9 @@ var jr = class extends P {
|
|
|
3195
3195
|
signal: this.controller.signal
|
|
3196
3196
|
});
|
|
3197
3197
|
this._connected();
|
|
3198
|
-
for await (let e of c) t(this,
|
|
3198
|
+
for await (let e of c) t(this, G, "m", Hr).call(this, e);
|
|
3199
3199
|
if (c.controller.signal?.aborted) throw new s();
|
|
3200
|
-
return this._addRun(t(this,
|
|
3200
|
+
return this._addRun(t(this, G, "m", Ur).call(this));
|
|
3201
3201
|
}
|
|
3202
3202
|
static accumulateDelta(e, t) {
|
|
3203
3203
|
for (let [n, r] of Object.entries(t)) {
|
|
@@ -3249,8 +3249,8 @@ var jr = class extends P {
|
|
|
3249
3249
|
return await this._createToolAssistantStream(t, e, n, r);
|
|
3250
3250
|
}
|
|
3251
3251
|
};
|
|
3252
|
-
|
|
3253
|
-
if (!this.ended) switch (e(this, zr, n, "f"), t(this,
|
|
3252
|
+
K = Zr, Hr = function(n) {
|
|
3253
|
+
if (!this.ended) switch (e(this, zr, n, "f"), t(this, G, "m", Kr).call(this, n), n.event) {
|
|
3254
3254
|
case "thread.created": break;
|
|
3255
3255
|
case "thread.run.created":
|
|
3256
3256
|
case "thread.run.queued":
|
|
@@ -3262,7 +3262,7 @@ q = Zr, Hr = function(n) {
|
|
|
3262
3262
|
case "thread.run.cancelling":
|
|
3263
3263
|
case "thread.run.cancelled":
|
|
3264
3264
|
case "thread.run.expired":
|
|
3265
|
-
t(this,
|
|
3265
|
+
t(this, G, "m", Xr).call(this, n);
|
|
3266
3266
|
break;
|
|
3267
3267
|
case "thread.run.step.created":
|
|
3268
3268
|
case "thread.run.step.in_progress":
|
|
@@ -3271,25 +3271,25 @@ q = Zr, Hr = function(n) {
|
|
|
3271
3271
|
case "thread.run.step.failed":
|
|
3272
3272
|
case "thread.run.step.cancelled":
|
|
3273
3273
|
case "thread.run.step.expired":
|
|
3274
|
-
t(this,
|
|
3274
|
+
t(this, G, "m", Gr).call(this, n);
|
|
3275
3275
|
break;
|
|
3276
3276
|
case "thread.message.created":
|
|
3277
3277
|
case "thread.message.in_progress":
|
|
3278
3278
|
case "thread.message.delta":
|
|
3279
3279
|
case "thread.message.completed":
|
|
3280
3280
|
case "thread.message.incomplete":
|
|
3281
|
-
t(this,
|
|
3281
|
+
t(this, G, "m", Wr).call(this, n);
|
|
3282
3282
|
break;
|
|
3283
3283
|
case "error": throw Error("Encountered an error event in event processing - errors should be processed earlier");
|
|
3284
3284
|
default:
|
|
3285
3285
|
}
|
|
3286
3286
|
}, Ur = function() {
|
|
3287
3287
|
if (this.ended) throw new a("stream has ended, this shouldn't happen");
|
|
3288
|
-
if (!t(this,
|
|
3289
|
-
return t(this,
|
|
3288
|
+
if (!t(this, Y, "f")) throw Error("Final run has not been received");
|
|
3289
|
+
return t(this, Y, "f");
|
|
3290
3290
|
}, Wr = function(n) {
|
|
3291
|
-
let [r, i] = t(this,
|
|
3292
|
-
e(this,
|
|
3291
|
+
let [r, i] = t(this, G, "m", Jr).call(this, n, t(this, J, "f"));
|
|
3292
|
+
e(this, J, r, "f"), t(this, Ir, "f")[r.id] = r;
|
|
3293
3293
|
for (let e of i) {
|
|
3294
3294
|
let t = r.content[e.index];
|
|
3295
3295
|
t?.type == "text" && this._emit("textCreated", t.text);
|
|
@@ -3306,37 +3306,37 @@ q = Zr, Hr = function(n) {
|
|
|
3306
3306
|
if (t && t.type == "text") this._emit("textDelta", e, t.text);
|
|
3307
3307
|
else throw Error("The snapshot associated with this text delta is not text or missing");
|
|
3308
3308
|
}
|
|
3309
|
-
if (i.index != t(this,
|
|
3310
|
-
if (t(this,
|
|
3309
|
+
if (i.index != t(this, Lr, "f")) {
|
|
3310
|
+
if (t(this, X, "f")) switch (t(this, X, "f").type) {
|
|
3311
3311
|
case "text":
|
|
3312
|
-
this._emit("textDone", t(this,
|
|
3312
|
+
this._emit("textDone", t(this, X, "f").text, t(this, J, "f"));
|
|
3313
3313
|
break;
|
|
3314
3314
|
case "image_file":
|
|
3315
|
-
this._emit("imageFileDone", t(this,
|
|
3315
|
+
this._emit("imageFileDone", t(this, X, "f").image_file, t(this, J, "f"));
|
|
3316
3316
|
break;
|
|
3317
3317
|
}
|
|
3318
|
-
e(this,
|
|
3318
|
+
e(this, Lr, i.index, "f");
|
|
3319
3319
|
}
|
|
3320
|
-
e(this,
|
|
3320
|
+
e(this, X, r.content[i.index], "f");
|
|
3321
3321
|
}
|
|
3322
3322
|
break;
|
|
3323
3323
|
case "thread.message.completed":
|
|
3324
3324
|
case "thread.message.incomplete":
|
|
3325
|
-
if (t(this,
|
|
3326
|
-
let e = n.data.content[t(this,
|
|
3325
|
+
if (t(this, Lr, "f") !== void 0) {
|
|
3326
|
+
let e = n.data.content[t(this, Lr, "f")];
|
|
3327
3327
|
if (e) switch (e.type) {
|
|
3328
3328
|
case "image_file":
|
|
3329
|
-
this._emit("imageFileDone", e.image_file, t(this,
|
|
3329
|
+
this._emit("imageFileDone", e.image_file, t(this, J, "f"));
|
|
3330
3330
|
break;
|
|
3331
3331
|
case "text":
|
|
3332
|
-
this._emit("textDone", e.text, t(this,
|
|
3332
|
+
this._emit("textDone", e.text, t(this, J, "f"));
|
|
3333
3333
|
break;
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
|
-
t(this,
|
|
3336
|
+
t(this, J, "f") && this._emit("messageDone", n.data), e(this, J, void 0, "f");
|
|
3337
3337
|
}
|
|
3338
3338
|
}, Gr = function(n) {
|
|
3339
|
-
let r = t(this,
|
|
3339
|
+
let r = t(this, G, "m", qr).call(this, n);
|
|
3340
3340
|
switch (e(this, Vr, r, "f"), n.event) {
|
|
3341
3341
|
case "thread.run.step.created":
|
|
3342
3342
|
this._emit("runStepCreated", n.data);
|
|
@@ -3355,28 +3355,28 @@ q = Zr, Hr = function(n) {
|
|
|
3355
3355
|
case "thread.run.step.in_progress": break;
|
|
3356
3356
|
}
|
|
3357
3357
|
}, Kr = function(e) {
|
|
3358
|
-
t(this,
|
|
3358
|
+
t(this, Fr, "f").push(e), this._emit("event", e);
|
|
3359
3359
|
}, qr = function(e) {
|
|
3360
3360
|
switch (e.event) {
|
|
3361
|
-
case "thread.run.step.created": return t(this,
|
|
3361
|
+
case "thread.run.step.created": return t(this, q, "f")[e.data.id] = e.data, e.data;
|
|
3362
3362
|
case "thread.run.step.delta":
|
|
3363
|
-
let n = t(this,
|
|
3363
|
+
let n = t(this, q, "f")[e.data.id];
|
|
3364
3364
|
if (!n) throw Error("Received a RunStepDelta before creation of a snapshot");
|
|
3365
3365
|
let r = e.data;
|
|
3366
3366
|
if (r.delta) {
|
|
3367
|
-
let i =
|
|
3368
|
-
t(this,
|
|
3367
|
+
let i = K.accumulateDelta(n, r.delta);
|
|
3368
|
+
t(this, q, "f")[e.data.id] = i;
|
|
3369
3369
|
}
|
|
3370
|
-
return t(this,
|
|
3370
|
+
return t(this, q, "f")[e.data.id];
|
|
3371
3371
|
case "thread.run.step.completed":
|
|
3372
3372
|
case "thread.run.step.failed":
|
|
3373
3373
|
case "thread.run.step.cancelled":
|
|
3374
3374
|
case "thread.run.step.expired":
|
|
3375
3375
|
case "thread.run.step.in_progress":
|
|
3376
|
-
t(this,
|
|
3376
|
+
t(this, q, "f")[e.data.id] = e.data;
|
|
3377
3377
|
break;
|
|
3378
3378
|
}
|
|
3379
|
-
if (t(this,
|
|
3379
|
+
if (t(this, q, "f")[e.data.id]) return t(this, q, "f")[e.data.id];
|
|
3380
3380
|
throw Error("No snapshot available");
|
|
3381
3381
|
}, Jr = function(e, n) {
|
|
3382
3382
|
let r = [];
|
|
@@ -3387,7 +3387,7 @@ q = Zr, Hr = function(n) {
|
|
|
3387
3387
|
let i = e.data;
|
|
3388
3388
|
if (i.delta.content) for (let e of i.delta.content) if (e.index in n.content) {
|
|
3389
3389
|
let r = n.content[e.index];
|
|
3390
|
-
n.content[e.index] = t(this,
|
|
3390
|
+
n.content[e.index] = t(this, G, "m", Yr).call(this, e, r);
|
|
3391
3391
|
} else n.content[e.index] = e, r.push(e);
|
|
3392
3392
|
return [n, r];
|
|
3393
3393
|
case "thread.message.in_progress":
|
|
@@ -3398,7 +3398,7 @@ q = Zr, Hr = function(n) {
|
|
|
3398
3398
|
}
|
|
3399
3399
|
throw Error("Tried to accumulate a non-message event");
|
|
3400
3400
|
}, Yr = function(e, t) {
|
|
3401
|
-
return
|
|
3401
|
+
return K.accumulateDelta(t, e);
|
|
3402
3402
|
}, Xr = function(n) {
|
|
3403
3403
|
switch (e(this, Br, n.data, "f"), n.event) {
|
|
3404
3404
|
case "thread.run.created": break;
|
|
@@ -3410,24 +3410,24 @@ q = Zr, Hr = function(n) {
|
|
|
3410
3410
|
case "thread.run.completed":
|
|
3411
3411
|
case "thread.run.expired":
|
|
3412
3412
|
case "thread.run.incomplete":
|
|
3413
|
-
e(this,
|
|
3413
|
+
e(this, Y, n.data, "f"), t(this, Z, "f") && (this._emit("toolCallDone", t(this, Z, "f")), e(this, Z, void 0, "f"));
|
|
3414
3414
|
break;
|
|
3415
3415
|
case "thread.run.cancelling": break;
|
|
3416
3416
|
}
|
|
3417
3417
|
};
|
|
3418
3418
|
//#endregion
|
|
3419
3419
|
//#region node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
3420
|
-
var Qr = class extends
|
|
3420
|
+
var Qr = class extends N {
|
|
3421
3421
|
constructor() {
|
|
3422
|
-
super(...arguments), this.steps = new
|
|
3422
|
+
super(...arguments), this.steps = new Nr(this._client);
|
|
3423
3423
|
}
|
|
3424
3424
|
create(e, t, n) {
|
|
3425
3425
|
let { include: r, ...i } = t;
|
|
3426
|
-
return this._client.post(
|
|
3426
|
+
return this._client.post(P`/threads/${e}/runs`, {
|
|
3427
3427
|
query: { include: r },
|
|
3428
3428
|
body: i,
|
|
3429
3429
|
...n,
|
|
3430
|
-
headers:
|
|
3430
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3431
3431
|
stream: t.stream ?? !1,
|
|
3432
3432
|
__synthesizeEventData: !0,
|
|
3433
3433
|
__security: { bearerAuth: !0 }
|
|
@@ -3435,34 +3435,34 @@ var Qr = class extends P {
|
|
|
3435
3435
|
}
|
|
3436
3436
|
retrieve(e, t, n) {
|
|
3437
3437
|
let { thread_id: r } = t;
|
|
3438
|
-
return this._client.get(
|
|
3438
|
+
return this._client.get(P`/threads/${r}/runs/${e}`, {
|
|
3439
3439
|
...n,
|
|
3440
|
-
headers:
|
|
3440
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3441
3441
|
__security: { bearerAuth: !0 }
|
|
3442
3442
|
});
|
|
3443
3443
|
}
|
|
3444
3444
|
update(e, t, n) {
|
|
3445
3445
|
let { thread_id: r, ...i } = t;
|
|
3446
|
-
return this._client.post(
|
|
3446
|
+
return this._client.post(P`/threads/${r}/runs/${e}`, {
|
|
3447
3447
|
body: i,
|
|
3448
3448
|
...n,
|
|
3449
|
-
headers:
|
|
3449
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3450
3450
|
__security: { bearerAuth: !0 }
|
|
3451
3451
|
});
|
|
3452
3452
|
}
|
|
3453
3453
|
list(e, t = {}, n) {
|
|
3454
|
-
return this._client.getAPIList(
|
|
3454
|
+
return this._client.getAPIList(P`/threads/${e}/runs`, k, {
|
|
3455
3455
|
query: t,
|
|
3456
3456
|
...n,
|
|
3457
|
-
headers:
|
|
3457
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3458
3458
|
__security: { bearerAuth: !0 }
|
|
3459
3459
|
});
|
|
3460
3460
|
}
|
|
3461
3461
|
cancel(e, t, n) {
|
|
3462
3462
|
let { thread_id: r } = t;
|
|
3463
|
-
return this._client.post(
|
|
3463
|
+
return this._client.post(P`/threads/${r}/runs/${e}/cancel`, {
|
|
3464
3464
|
...n,
|
|
3465
|
-
headers:
|
|
3465
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3466
3466
|
__security: { bearerAuth: !0 }
|
|
3467
3467
|
});
|
|
3468
3468
|
}
|
|
@@ -3474,7 +3474,7 @@ var Qr = class extends P {
|
|
|
3474
3474
|
return Zr.createAssistantStream(e, this._client.beta.threads.runs, t, n);
|
|
3475
3475
|
}
|
|
3476
3476
|
async poll(e, t, n) {
|
|
3477
|
-
let r =
|
|
3477
|
+
let r = U([n?.headers, {
|
|
3478
3478
|
"X-Stainless-Poll-Helper": "true",
|
|
3479
3479
|
"X-Stainless-Custom-Poll-Interval": n?.pollIntervalMs?.toString() ?? void 0
|
|
3480
3480
|
}]);
|
|
@@ -3515,10 +3515,10 @@ var Qr = class extends P {
|
|
|
3515
3515
|
}
|
|
3516
3516
|
submitToolOutputs(e, t, n) {
|
|
3517
3517
|
let { thread_id: r, ...i } = t;
|
|
3518
|
-
return this._client.post(
|
|
3518
|
+
return this._client.post(P`/threads/${r}/runs/${e}/submit_tool_outputs`, {
|
|
3519
3519
|
body: i,
|
|
3520
3520
|
...n,
|
|
3521
|
-
headers:
|
|
3521
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3522
3522
|
stream: t.stream ?? !1,
|
|
3523
3523
|
__synthesizeEventData: !0,
|
|
3524
3524
|
__security: { bearerAuth: !0 }
|
|
@@ -3532,40 +3532,40 @@ var Qr = class extends P {
|
|
|
3532
3532
|
return Zr.createToolAssistantStream(e, this._client.beta.threads.runs, t, n);
|
|
3533
3533
|
}
|
|
3534
3534
|
};
|
|
3535
|
-
Qr.Steps =
|
|
3535
|
+
Qr.Steps = Nr;
|
|
3536
3536
|
//#endregion
|
|
3537
3537
|
//#region node_modules/openai/resources/beta/threads/threads.mjs
|
|
3538
|
-
var $r = class extends
|
|
3538
|
+
var $r = class extends N {
|
|
3539
3539
|
constructor() {
|
|
3540
|
-
super(...arguments), this.runs = new Qr(this._client), this.messages = new
|
|
3540
|
+
super(...arguments), this.runs = new Qr(this._client), this.messages = new Mr(this._client);
|
|
3541
3541
|
}
|
|
3542
3542
|
create(e = {}, t) {
|
|
3543
3543
|
return this._client.post("/threads", {
|
|
3544
3544
|
body: e,
|
|
3545
3545
|
...t,
|
|
3546
|
-
headers:
|
|
3546
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
3547
3547
|
__security: { bearerAuth: !0 }
|
|
3548
3548
|
});
|
|
3549
3549
|
}
|
|
3550
3550
|
retrieve(e, t) {
|
|
3551
|
-
return this._client.get(
|
|
3551
|
+
return this._client.get(P`/threads/${e}`, {
|
|
3552
3552
|
...t,
|
|
3553
|
-
headers:
|
|
3553
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
3554
3554
|
__security: { bearerAuth: !0 }
|
|
3555
3555
|
});
|
|
3556
3556
|
}
|
|
3557
3557
|
update(e, t, n) {
|
|
3558
|
-
return this._client.post(
|
|
3558
|
+
return this._client.post(P`/threads/${e}`, {
|
|
3559
3559
|
body: t,
|
|
3560
3560
|
...n,
|
|
3561
|
-
headers:
|
|
3561
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
3562
3562
|
__security: { bearerAuth: !0 }
|
|
3563
3563
|
});
|
|
3564
3564
|
}
|
|
3565
3565
|
delete(e, t) {
|
|
3566
|
-
return this._client.delete(
|
|
3566
|
+
return this._client.delete(P`/threads/${e}`, {
|
|
3567
3567
|
...t,
|
|
3568
|
-
headers:
|
|
3568
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
3569
3569
|
__security: { bearerAuth: !0 }
|
|
3570
3570
|
});
|
|
3571
3571
|
}
|
|
@@ -3573,7 +3573,7 @@ var $r = class extends P {
|
|
|
3573
3573
|
return this._client.post("/threads/runs", {
|
|
3574
3574
|
body: e,
|
|
3575
3575
|
...t,
|
|
3576
|
-
headers:
|
|
3576
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
3577
3577
|
stream: e.stream ?? !1,
|
|
3578
3578
|
__synthesizeEventData: !0,
|
|
3579
3579
|
__security: { bearerAuth: !0 }
|
|
@@ -3587,18 +3587,18 @@ var $r = class extends P {
|
|
|
3587
3587
|
return Zr.createThreadAssistantStream(e, this._client.beta.threads, t);
|
|
3588
3588
|
}
|
|
3589
3589
|
};
|
|
3590
|
-
$r.Runs = Qr, $r.Messages =
|
|
3590
|
+
$r.Runs = Qr, $r.Messages = Mr;
|
|
3591
3591
|
//#endregion
|
|
3592
3592
|
//#region node_modules/openai/resources/beta/beta.mjs
|
|
3593
|
-
var ei = class extends
|
|
3593
|
+
var ei = class extends N {
|
|
3594
3594
|
constructor() {
|
|
3595
|
-
super(...arguments), this.realtime = new
|
|
3595
|
+
super(...arguments), this.realtime = new Or(this._client), this.chatkit = new jr(this._client), this.assistants = new Tr(this._client), this.threads = new $r(this._client);
|
|
3596
3596
|
}
|
|
3597
3597
|
};
|
|
3598
|
-
ei.Realtime =
|
|
3598
|
+
ei.Realtime = Or, ei.ChatKit = jr, ei.Assistants = Tr, ei.Threads = $r;
|
|
3599
3599
|
//#endregion
|
|
3600
3600
|
//#region node_modules/openai/resources/completions.mjs
|
|
3601
|
-
var ti = class extends
|
|
3601
|
+
var ti = class extends N {
|
|
3602
3602
|
create(e, t) {
|
|
3603
3603
|
return this._client.post("/completions", {
|
|
3604
3604
|
body: e,
|
|
@@ -3607,22 +3607,22 @@ var ti = class extends P {
|
|
|
3607
3607
|
__security: { bearerAuth: !0 }
|
|
3608
3608
|
});
|
|
3609
3609
|
}
|
|
3610
|
-
}, ni = class extends
|
|
3610
|
+
}, ni = class extends N {
|
|
3611
3611
|
retrieve(e, t, n) {
|
|
3612
3612
|
let { container_id: r } = t;
|
|
3613
|
-
return this._client.get(
|
|
3613
|
+
return this._client.get(P`/containers/${r}/files/${e}/content`, {
|
|
3614
3614
|
...n,
|
|
3615
|
-
headers:
|
|
3615
|
+
headers: U([{ Accept: "application/binary" }, n?.headers]),
|
|
3616
3616
|
__security: { bearerAuth: !0 },
|
|
3617
3617
|
__binaryResponse: !0
|
|
3618
3618
|
});
|
|
3619
3619
|
}
|
|
3620
|
-
}, ri = class extends
|
|
3620
|
+
}, ri = class extends N {
|
|
3621
3621
|
constructor() {
|
|
3622
3622
|
super(...arguments), this.content = new ni(this._client);
|
|
3623
3623
|
}
|
|
3624
3624
|
create(e, t, n) {
|
|
3625
|
-
return this._client.post(
|
|
3625
|
+
return this._client.post(P`/containers/${e}/files`, wt({
|
|
3626
3626
|
body: t,
|
|
3627
3627
|
...n,
|
|
3628
3628
|
__security: { bearerAuth: !0 }
|
|
@@ -3630,13 +3630,13 @@ var ti = class extends P {
|
|
|
3630
3630
|
}
|
|
3631
3631
|
retrieve(e, t, n) {
|
|
3632
3632
|
let { container_id: r } = t;
|
|
3633
|
-
return this._client.get(
|
|
3633
|
+
return this._client.get(P`/containers/${r}/files/${e}`, {
|
|
3634
3634
|
...n,
|
|
3635
3635
|
__security: { bearerAuth: !0 }
|
|
3636
3636
|
});
|
|
3637
3637
|
}
|
|
3638
3638
|
list(e, t = {}, n) {
|
|
3639
|
-
return this._client.getAPIList(
|
|
3639
|
+
return this._client.getAPIList(P`/containers/${e}/files`, k, {
|
|
3640
3640
|
query: t,
|
|
3641
3641
|
...n,
|
|
3642
3642
|
__security: { bearerAuth: !0 }
|
|
@@ -3644,9 +3644,9 @@ var ti = class extends P {
|
|
|
3644
3644
|
}
|
|
3645
3645
|
delete(e, t, n) {
|
|
3646
3646
|
let { container_id: r } = t;
|
|
3647
|
-
return this._client.delete(
|
|
3647
|
+
return this._client.delete(P`/containers/${r}/files/${e}`, {
|
|
3648
3648
|
...n,
|
|
3649
|
-
headers:
|
|
3649
|
+
headers: U([{ Accept: "*/*" }, n?.headers]),
|
|
3650
3650
|
__security: { bearerAuth: !0 }
|
|
3651
3651
|
});
|
|
3652
3652
|
}
|
|
@@ -3654,7 +3654,7 @@ var ti = class extends P {
|
|
|
3654
3654
|
ri.Content = ni;
|
|
3655
3655
|
//#endregion
|
|
3656
3656
|
//#region node_modules/openai/resources/containers/containers.mjs
|
|
3657
|
-
var ii = class extends
|
|
3657
|
+
var ii = class extends N {
|
|
3658
3658
|
constructor() {
|
|
3659
3659
|
super(...arguments), this.files = new ri(this._client);
|
|
3660
3660
|
}
|
|
@@ -3666,22 +3666,22 @@ var ii = class extends P {
|
|
|
3666
3666
|
});
|
|
3667
3667
|
}
|
|
3668
3668
|
retrieve(e, t) {
|
|
3669
|
-
return this._client.get(
|
|
3669
|
+
return this._client.get(P`/containers/${e}`, {
|
|
3670
3670
|
...t,
|
|
3671
3671
|
__security: { bearerAuth: !0 }
|
|
3672
3672
|
});
|
|
3673
3673
|
}
|
|
3674
3674
|
list(e = {}, t) {
|
|
3675
|
-
return this._client.getAPIList("/containers",
|
|
3675
|
+
return this._client.getAPIList("/containers", k, {
|
|
3676
3676
|
query: e,
|
|
3677
3677
|
...t,
|
|
3678
3678
|
__security: { bearerAuth: !0 }
|
|
3679
3679
|
});
|
|
3680
3680
|
}
|
|
3681
3681
|
delete(e, t) {
|
|
3682
|
-
return this._client.delete(
|
|
3682
|
+
return this._client.delete(P`/containers/${e}`, {
|
|
3683
3683
|
...t,
|
|
3684
|
-
headers:
|
|
3684
|
+
headers: U([{ Accept: "*/*" }, t?.headers]),
|
|
3685
3685
|
__security: { bearerAuth: !0 }
|
|
3686
3686
|
});
|
|
3687
3687
|
}
|
|
@@ -3689,10 +3689,10 @@ var ii = class extends P {
|
|
|
3689
3689
|
ii.Files = ri;
|
|
3690
3690
|
//#endregion
|
|
3691
3691
|
//#region node_modules/openai/resources/conversations/items.mjs
|
|
3692
|
-
var ai = class extends
|
|
3692
|
+
var ai = class extends N {
|
|
3693
3693
|
create(e, t, n) {
|
|
3694
3694
|
let { include: r, ...i } = t;
|
|
3695
|
-
return this._client.post(
|
|
3695
|
+
return this._client.post(P`/conversations/${e}/items`, {
|
|
3696
3696
|
query: { include: r },
|
|
3697
3697
|
body: i,
|
|
3698
3698
|
...n,
|
|
@@ -3701,14 +3701,14 @@ var ai = class extends P {
|
|
|
3701
3701
|
}
|
|
3702
3702
|
retrieve(e, t, n) {
|
|
3703
3703
|
let { conversation_id: r, ...i } = t;
|
|
3704
|
-
return this._client.get(
|
|
3704
|
+
return this._client.get(P`/conversations/${r}/items/${e}`, {
|
|
3705
3705
|
query: i,
|
|
3706
3706
|
...n,
|
|
3707
3707
|
__security: { bearerAuth: !0 }
|
|
3708
3708
|
});
|
|
3709
3709
|
}
|
|
3710
3710
|
list(e, t = {}, n) {
|
|
3711
|
-
return this._client.getAPIList(
|
|
3711
|
+
return this._client.getAPIList(P`/conversations/${e}/items`, A, {
|
|
3712
3712
|
query: t,
|
|
3713
3713
|
...n,
|
|
3714
3714
|
__security: { bearerAuth: !0 }
|
|
@@ -3716,12 +3716,12 @@ var ai = class extends P {
|
|
|
3716
3716
|
}
|
|
3717
3717
|
delete(e, t, n) {
|
|
3718
3718
|
let { conversation_id: r } = t;
|
|
3719
|
-
return this._client.delete(
|
|
3719
|
+
return this._client.delete(P`/conversations/${r}/items/${e}`, {
|
|
3720
3720
|
...n,
|
|
3721
3721
|
__security: { bearerAuth: !0 }
|
|
3722
3722
|
});
|
|
3723
3723
|
}
|
|
3724
|
-
}, oi = class extends
|
|
3724
|
+
}, oi = class extends N {
|
|
3725
3725
|
constructor() {
|
|
3726
3726
|
super(...arguments), this.items = new ai(this._client);
|
|
3727
3727
|
}
|
|
@@ -3733,20 +3733,20 @@ var ai = class extends P {
|
|
|
3733
3733
|
});
|
|
3734
3734
|
}
|
|
3735
3735
|
retrieve(e, t) {
|
|
3736
|
-
return this._client.get(
|
|
3736
|
+
return this._client.get(P`/conversations/${e}`, {
|
|
3737
3737
|
...t,
|
|
3738
3738
|
__security: { bearerAuth: !0 }
|
|
3739
3739
|
});
|
|
3740
3740
|
}
|
|
3741
3741
|
update(e, t, n) {
|
|
3742
|
-
return this._client.post(
|
|
3742
|
+
return this._client.post(P`/conversations/${e}`, {
|
|
3743
3743
|
body: t,
|
|
3744
3744
|
...n,
|
|
3745
3745
|
__security: { bearerAuth: !0 }
|
|
3746
3746
|
});
|
|
3747
3747
|
}
|
|
3748
3748
|
delete(e, t) {
|
|
3749
|
-
return this._client.delete(
|
|
3749
|
+
return this._client.delete(P`/conversations/${e}`, {
|
|
3750
3750
|
...t,
|
|
3751
3751
|
__security: { bearerAuth: !0 }
|
|
3752
3752
|
});
|
|
@@ -3755,7 +3755,7 @@ var ai = class extends P {
|
|
|
3755
3755
|
oi.Items = ai;
|
|
3756
3756
|
//#endregion
|
|
3757
3757
|
//#region node_modules/openai/resources/embeddings.mjs
|
|
3758
|
-
var si = class extends
|
|
3758
|
+
var si = class extends N {
|
|
3759
3759
|
create(e, t) {
|
|
3760
3760
|
let n = !!e.encoding_format, r = n ? e.encoding_format : "base64";
|
|
3761
3761
|
n && D(this._client).debug("embeddings/user defined encoding_format:", e.encoding_format);
|
|
@@ -3769,31 +3769,31 @@ var si = class extends P {
|
|
|
3769
3769
|
});
|
|
3770
3770
|
return n ? i : (D(this._client).debug("embeddings/decoding base64 embeddings from base64"), i._thenUnwrap((e) => (e && e.data && e.data.forEach((e) => {
|
|
3771
3771
|
let t = e.embedding;
|
|
3772
|
-
e.embedding =
|
|
3772
|
+
e.embedding = Pr(t);
|
|
3773
3773
|
}), e)));
|
|
3774
3774
|
}
|
|
3775
|
-
}, ci = class extends
|
|
3775
|
+
}, ci = class extends N {
|
|
3776
3776
|
retrieve(e, t, n) {
|
|
3777
3777
|
let { eval_id: r, run_id: i } = t;
|
|
3778
|
-
return this._client.get(
|
|
3778
|
+
return this._client.get(P`/evals/${r}/runs/${i}/output_items/${e}`, {
|
|
3779
3779
|
...n,
|
|
3780
3780
|
__security: { bearerAuth: !0 }
|
|
3781
3781
|
});
|
|
3782
3782
|
}
|
|
3783
3783
|
list(e, t, n) {
|
|
3784
3784
|
let { eval_id: r, ...i } = t;
|
|
3785
|
-
return this._client.getAPIList(
|
|
3785
|
+
return this._client.getAPIList(P`/evals/${r}/runs/${e}/output_items`, k, {
|
|
3786
3786
|
query: i,
|
|
3787
3787
|
...n,
|
|
3788
3788
|
__security: { bearerAuth: !0 }
|
|
3789
3789
|
});
|
|
3790
3790
|
}
|
|
3791
|
-
}, li = class extends
|
|
3791
|
+
}, li = class extends N {
|
|
3792
3792
|
constructor() {
|
|
3793
3793
|
super(...arguments), this.outputItems = new ci(this._client);
|
|
3794
3794
|
}
|
|
3795
3795
|
create(e, t, n) {
|
|
3796
|
-
return this._client.post(
|
|
3796
|
+
return this._client.post(P`/evals/${e}/runs`, {
|
|
3797
3797
|
body: t,
|
|
3798
3798
|
...n,
|
|
3799
3799
|
__security: { bearerAuth: !0 }
|
|
@@ -3801,13 +3801,13 @@ var si = class extends P {
|
|
|
3801
3801
|
}
|
|
3802
3802
|
retrieve(e, t, n) {
|
|
3803
3803
|
let { eval_id: r } = t;
|
|
3804
|
-
return this._client.get(
|
|
3804
|
+
return this._client.get(P`/evals/${r}/runs/${e}`, {
|
|
3805
3805
|
...n,
|
|
3806
3806
|
__security: { bearerAuth: !0 }
|
|
3807
3807
|
});
|
|
3808
3808
|
}
|
|
3809
3809
|
list(e, t = {}, n) {
|
|
3810
|
-
return this._client.getAPIList(
|
|
3810
|
+
return this._client.getAPIList(P`/evals/${e}/runs`, k, {
|
|
3811
3811
|
query: t,
|
|
3812
3812
|
...n,
|
|
3813
3813
|
__security: { bearerAuth: !0 }
|
|
@@ -3815,14 +3815,14 @@ var si = class extends P {
|
|
|
3815
3815
|
}
|
|
3816
3816
|
delete(e, t, n) {
|
|
3817
3817
|
let { eval_id: r } = t;
|
|
3818
|
-
return this._client.delete(
|
|
3818
|
+
return this._client.delete(P`/evals/${r}/runs/${e}`, {
|
|
3819
3819
|
...n,
|
|
3820
3820
|
__security: { bearerAuth: !0 }
|
|
3821
3821
|
});
|
|
3822
3822
|
}
|
|
3823
3823
|
cancel(e, t, n) {
|
|
3824
3824
|
let { eval_id: r } = t;
|
|
3825
|
-
return this._client.post(
|
|
3825
|
+
return this._client.post(P`/evals/${r}/runs/${e}`, {
|
|
3826
3826
|
...n,
|
|
3827
3827
|
__security: { bearerAuth: !0 }
|
|
3828
3828
|
});
|
|
@@ -3831,7 +3831,7 @@ var si = class extends P {
|
|
|
3831
3831
|
li.OutputItems = ci;
|
|
3832
3832
|
//#endregion
|
|
3833
3833
|
//#region node_modules/openai/resources/evals/evals.mjs
|
|
3834
|
-
var ui = class extends
|
|
3834
|
+
var ui = class extends N {
|
|
3835
3835
|
constructor() {
|
|
3836
3836
|
super(...arguments), this.runs = new li(this._client);
|
|
3837
3837
|
}
|
|
@@ -3843,27 +3843,27 @@ var ui = class extends P {
|
|
|
3843
3843
|
});
|
|
3844
3844
|
}
|
|
3845
3845
|
retrieve(e, t) {
|
|
3846
|
-
return this._client.get(
|
|
3846
|
+
return this._client.get(P`/evals/${e}`, {
|
|
3847
3847
|
...t,
|
|
3848
3848
|
__security: { bearerAuth: !0 }
|
|
3849
3849
|
});
|
|
3850
3850
|
}
|
|
3851
3851
|
update(e, t, n) {
|
|
3852
|
-
return this._client.post(
|
|
3852
|
+
return this._client.post(P`/evals/${e}`, {
|
|
3853
3853
|
body: t,
|
|
3854
3854
|
...n,
|
|
3855
3855
|
__security: { bearerAuth: !0 }
|
|
3856
3856
|
});
|
|
3857
3857
|
}
|
|
3858
3858
|
list(e = {}, t) {
|
|
3859
|
-
return this._client.getAPIList("/evals",
|
|
3859
|
+
return this._client.getAPIList("/evals", k, {
|
|
3860
3860
|
query: e,
|
|
3861
3861
|
...t,
|
|
3862
3862
|
__security: { bearerAuth: !0 }
|
|
3863
3863
|
});
|
|
3864
3864
|
}
|
|
3865
3865
|
delete(e, t) {
|
|
3866
|
-
return this._client.delete(
|
|
3866
|
+
return this._client.delete(P`/evals/${e}`, {
|
|
3867
3867
|
...t,
|
|
3868
3868
|
__security: { bearerAuth: !0 }
|
|
3869
3869
|
});
|
|
@@ -3872,37 +3872,37 @@ var ui = class extends P {
|
|
|
3872
3872
|
ui.Runs = li;
|
|
3873
3873
|
//#endregion
|
|
3874
3874
|
//#region node_modules/openai/resources/files.mjs
|
|
3875
|
-
var di = class extends
|
|
3875
|
+
var di = class extends N {
|
|
3876
3876
|
create(e, t) {
|
|
3877
|
-
return this._client.post("/files",
|
|
3877
|
+
return this._client.post("/files", M({
|
|
3878
3878
|
body: e,
|
|
3879
3879
|
...t,
|
|
3880
3880
|
__security: { bearerAuth: !0 }
|
|
3881
3881
|
}, this._client));
|
|
3882
3882
|
}
|
|
3883
3883
|
retrieve(e, t) {
|
|
3884
|
-
return this._client.get(
|
|
3884
|
+
return this._client.get(P`/files/${e}`, {
|
|
3885
3885
|
...t,
|
|
3886
3886
|
__security: { bearerAuth: !0 }
|
|
3887
3887
|
});
|
|
3888
3888
|
}
|
|
3889
3889
|
list(e = {}, t) {
|
|
3890
|
-
return this._client.getAPIList("/files",
|
|
3890
|
+
return this._client.getAPIList("/files", k, {
|
|
3891
3891
|
query: e,
|
|
3892
3892
|
...t,
|
|
3893
3893
|
__security: { bearerAuth: !0 }
|
|
3894
3894
|
});
|
|
3895
3895
|
}
|
|
3896
3896
|
delete(e, t) {
|
|
3897
|
-
return this._client.delete(
|
|
3897
|
+
return this._client.delete(P`/files/${e}`, {
|
|
3898
3898
|
...t,
|
|
3899
3899
|
__security: { bearerAuth: !0 }
|
|
3900
3900
|
});
|
|
3901
3901
|
}
|
|
3902
3902
|
content(e, t) {
|
|
3903
|
-
return this._client.get(
|
|
3903
|
+
return this._client.get(P`/files/${e}/content`, {
|
|
3904
3904
|
...t,
|
|
3905
|
-
headers:
|
|
3905
|
+
headers: U([{ Accept: "application/binary" }, t?.headers]),
|
|
3906
3906
|
__security: { bearerAuth: !0 },
|
|
3907
3907
|
__binaryResponse: !0
|
|
3908
3908
|
});
|
|
@@ -3916,7 +3916,7 @@ var di = class extends P {
|
|
|
3916
3916
|
for (; !a.status || !r.has(a.status);) if (await ue(t), a = await this.retrieve(e), Date.now() - i > n) throw new l({ message: `Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.` });
|
|
3917
3917
|
return a;
|
|
3918
3918
|
}
|
|
3919
|
-
}, fi = class extends
|
|
3919
|
+
}, fi = class extends N {}, pi = class extends N {
|
|
3920
3920
|
run(e, t) {
|
|
3921
3921
|
return this._client.post("/fine_tuning/alpha/graders/run", {
|
|
3922
3922
|
body: e,
|
|
@@ -3931,7 +3931,7 @@ var di = class extends P {
|
|
|
3931
3931
|
__security: { bearerAuth: !0 }
|
|
3932
3932
|
});
|
|
3933
3933
|
}
|
|
3934
|
-
}, mi = class extends
|
|
3934
|
+
}, mi = class extends N {
|
|
3935
3935
|
constructor() {
|
|
3936
3936
|
super(...arguments), this.graders = new pi(this._client);
|
|
3937
3937
|
}
|
|
@@ -3939,9 +3939,9 @@ var di = class extends P {
|
|
|
3939
3939
|
mi.Graders = pi;
|
|
3940
3940
|
//#endregion
|
|
3941
3941
|
//#region node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
3942
|
-
var hi = class extends
|
|
3942
|
+
var hi = class extends N {
|
|
3943
3943
|
create(e, t, n) {
|
|
3944
|
-
return this._client.getAPIList(
|
|
3944
|
+
return this._client.getAPIList(P`/fine_tuning/checkpoints/${e}/permissions`, O, {
|
|
3945
3945
|
body: t,
|
|
3946
3946
|
method: "post",
|
|
3947
3947
|
...n,
|
|
@@ -3949,14 +3949,14 @@ var hi = class extends P {
|
|
|
3949
3949
|
});
|
|
3950
3950
|
}
|
|
3951
3951
|
retrieve(e, t = {}, n) {
|
|
3952
|
-
return this._client.get(
|
|
3952
|
+
return this._client.get(P`/fine_tuning/checkpoints/${e}/permissions`, {
|
|
3953
3953
|
query: t,
|
|
3954
3954
|
...n,
|
|
3955
3955
|
__security: { adminAPIKeyAuth: !0 }
|
|
3956
3956
|
});
|
|
3957
3957
|
}
|
|
3958
3958
|
list(e, t = {}, n) {
|
|
3959
|
-
return this._client.getAPIList(
|
|
3959
|
+
return this._client.getAPIList(P`/fine_tuning/checkpoints/${e}/permissions`, A, {
|
|
3960
3960
|
query: t,
|
|
3961
3961
|
...n,
|
|
3962
3962
|
__security: { adminAPIKeyAuth: !0 }
|
|
@@ -3964,12 +3964,12 @@ var hi = class extends P {
|
|
|
3964
3964
|
}
|
|
3965
3965
|
delete(e, t, n) {
|
|
3966
3966
|
let { fine_tuned_model_checkpoint: r } = t;
|
|
3967
|
-
return this._client.delete(
|
|
3967
|
+
return this._client.delete(P`/fine_tuning/checkpoints/${r}/permissions/${e}`, {
|
|
3968
3968
|
...n,
|
|
3969
3969
|
__security: { adminAPIKeyAuth: !0 }
|
|
3970
3970
|
});
|
|
3971
3971
|
}
|
|
3972
|
-
}, gi = class extends
|
|
3972
|
+
}, gi = class extends N {
|
|
3973
3973
|
constructor() {
|
|
3974
3974
|
super(...arguments), this.permissions = new hi(this._client);
|
|
3975
3975
|
}
|
|
@@ -3977,15 +3977,15 @@ var hi = class extends P {
|
|
|
3977
3977
|
gi.Permissions = hi;
|
|
3978
3978
|
//#endregion
|
|
3979
3979
|
//#region node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
3980
|
-
var _i = class extends
|
|
3980
|
+
var _i = class extends N {
|
|
3981
3981
|
list(e, t = {}, n) {
|
|
3982
|
-
return this._client.getAPIList(
|
|
3982
|
+
return this._client.getAPIList(P`/fine_tuning/jobs/${e}/checkpoints`, k, {
|
|
3983
3983
|
query: t,
|
|
3984
3984
|
...n,
|
|
3985
3985
|
__security: { bearerAuth: !0 }
|
|
3986
3986
|
});
|
|
3987
3987
|
}
|
|
3988
|
-
}, vi = class extends
|
|
3988
|
+
}, vi = class extends N {
|
|
3989
3989
|
constructor() {
|
|
3990
3990
|
super(...arguments), this.checkpoints = new _i(this._client);
|
|
3991
3991
|
}
|
|
@@ -3997,39 +3997,39 @@ var _i = class extends P {
|
|
|
3997
3997
|
});
|
|
3998
3998
|
}
|
|
3999
3999
|
retrieve(e, t) {
|
|
4000
|
-
return this._client.get(
|
|
4000
|
+
return this._client.get(P`/fine_tuning/jobs/${e}`, {
|
|
4001
4001
|
...t,
|
|
4002
4002
|
__security: { bearerAuth: !0 }
|
|
4003
4003
|
});
|
|
4004
4004
|
}
|
|
4005
4005
|
list(e = {}, t) {
|
|
4006
|
-
return this._client.getAPIList("/fine_tuning/jobs",
|
|
4006
|
+
return this._client.getAPIList("/fine_tuning/jobs", k, {
|
|
4007
4007
|
query: e,
|
|
4008
4008
|
...t,
|
|
4009
4009
|
__security: { bearerAuth: !0 }
|
|
4010
4010
|
});
|
|
4011
4011
|
}
|
|
4012
4012
|
cancel(e, t) {
|
|
4013
|
-
return this._client.post(
|
|
4013
|
+
return this._client.post(P`/fine_tuning/jobs/${e}/cancel`, {
|
|
4014
4014
|
...t,
|
|
4015
4015
|
__security: { bearerAuth: !0 }
|
|
4016
4016
|
});
|
|
4017
4017
|
}
|
|
4018
4018
|
listEvents(e, t = {}, n) {
|
|
4019
|
-
return this._client.getAPIList(
|
|
4019
|
+
return this._client.getAPIList(P`/fine_tuning/jobs/${e}/events`, k, {
|
|
4020
4020
|
query: t,
|
|
4021
4021
|
...n,
|
|
4022
4022
|
__security: { bearerAuth: !0 }
|
|
4023
4023
|
});
|
|
4024
4024
|
}
|
|
4025
4025
|
pause(e, t) {
|
|
4026
|
-
return this._client.post(
|
|
4026
|
+
return this._client.post(P`/fine_tuning/jobs/${e}/pause`, {
|
|
4027
4027
|
...t,
|
|
4028
4028
|
__security: { bearerAuth: !0 }
|
|
4029
4029
|
});
|
|
4030
4030
|
}
|
|
4031
4031
|
resume(e, t) {
|
|
4032
|
-
return this._client.post(
|
|
4032
|
+
return this._client.post(P`/fine_tuning/jobs/${e}/resume`, {
|
|
4033
4033
|
...t,
|
|
4034
4034
|
__security: { bearerAuth: !0 }
|
|
4035
4035
|
});
|
|
@@ -4038,7 +4038,7 @@ var _i = class extends P {
|
|
|
4038
4038
|
vi.Checkpoints = _i;
|
|
4039
4039
|
//#endregion
|
|
4040
4040
|
//#region node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
4041
|
-
var yi = class extends
|
|
4041
|
+
var yi = class extends N {
|
|
4042
4042
|
constructor() {
|
|
4043
4043
|
super(...arguments), this.methods = new fi(this._client), this.jobs = new vi(this._client), this.checkpoints = new gi(this._client), this.alpha = new mi(this._client);
|
|
4044
4044
|
}
|
|
@@ -4046,7 +4046,7 @@ var yi = class extends P {
|
|
|
4046
4046
|
yi.Methods = fi, yi.Jobs = vi, yi.Checkpoints = gi, yi.Alpha = mi;
|
|
4047
4047
|
//#endregion
|
|
4048
4048
|
//#region node_modules/openai/resources/graders/grader-models.mjs
|
|
4049
|
-
var bi = class extends
|
|
4049
|
+
var bi = class extends N {}, xi = class extends N {
|
|
4050
4050
|
constructor() {
|
|
4051
4051
|
super(...arguments), this.graderModels = new bi(this._client);
|
|
4052
4052
|
}
|
|
@@ -4054,16 +4054,16 @@ var bi = class extends P {}, xi = class extends P {
|
|
|
4054
4054
|
xi.GraderModels = bi;
|
|
4055
4055
|
//#endregion
|
|
4056
4056
|
//#region node_modules/openai/resources/images.mjs
|
|
4057
|
-
var Si = class extends
|
|
4057
|
+
var Si = class extends N {
|
|
4058
4058
|
createVariation(e, t) {
|
|
4059
|
-
return this._client.post("/images/variations",
|
|
4059
|
+
return this._client.post("/images/variations", M({
|
|
4060
4060
|
body: e,
|
|
4061
4061
|
...t,
|
|
4062
4062
|
__security: { bearerAuth: !0 }
|
|
4063
4063
|
}, this._client));
|
|
4064
4064
|
}
|
|
4065
4065
|
edit(e, t) {
|
|
4066
|
-
return this._client.post("/images/edits",
|
|
4066
|
+
return this._client.post("/images/edits", M({
|
|
4067
4067
|
body: e,
|
|
4068
4068
|
...t,
|
|
4069
4069
|
stream: e.stream ?? !1,
|
|
@@ -4078,26 +4078,26 @@ var Si = class extends P {
|
|
|
4078
4078
|
__security: { bearerAuth: !0 }
|
|
4079
4079
|
});
|
|
4080
4080
|
}
|
|
4081
|
-
}, Ci = class extends
|
|
4081
|
+
}, Ci = class extends N {
|
|
4082
4082
|
retrieve(e, t) {
|
|
4083
|
-
return this._client.get(
|
|
4083
|
+
return this._client.get(P`/models/${e}`, {
|
|
4084
4084
|
...t,
|
|
4085
4085
|
__security: { bearerAuth: !0 }
|
|
4086
4086
|
});
|
|
4087
4087
|
}
|
|
4088
4088
|
list(e) {
|
|
4089
|
-
return this._client.getAPIList("/models",
|
|
4089
|
+
return this._client.getAPIList("/models", O, {
|
|
4090
4090
|
...e,
|
|
4091
4091
|
__security: { bearerAuth: !0 }
|
|
4092
4092
|
});
|
|
4093
4093
|
}
|
|
4094
4094
|
delete(e, t) {
|
|
4095
|
-
return this._client.delete(
|
|
4095
|
+
return this._client.delete(P`/models/${e}`, {
|
|
4096
4096
|
...t,
|
|
4097
4097
|
__security: { bearerAuth: !0 }
|
|
4098
4098
|
});
|
|
4099
4099
|
}
|
|
4100
|
-
}, wi = class extends
|
|
4100
|
+
}, wi = class extends N {
|
|
4101
4101
|
create(e, t) {
|
|
4102
4102
|
return this._client.post("/moderations", {
|
|
4103
4103
|
body: e,
|
|
@@ -4105,39 +4105,39 @@ var Si = class extends P {
|
|
|
4105
4105
|
__security: { bearerAuth: !0 }
|
|
4106
4106
|
});
|
|
4107
4107
|
}
|
|
4108
|
-
}, Ti = class extends
|
|
4108
|
+
}, Ti = class extends N {
|
|
4109
4109
|
accept(e, t, n) {
|
|
4110
|
-
return this._client.post(
|
|
4110
|
+
return this._client.post(P`/realtime/calls/${e}/accept`, {
|
|
4111
4111
|
body: t,
|
|
4112
4112
|
...n,
|
|
4113
|
-
headers:
|
|
4113
|
+
headers: U([{ Accept: "*/*" }, n?.headers]),
|
|
4114
4114
|
__security: { bearerAuth: !0 }
|
|
4115
4115
|
});
|
|
4116
4116
|
}
|
|
4117
4117
|
hangup(e, t) {
|
|
4118
|
-
return this._client.post(
|
|
4118
|
+
return this._client.post(P`/realtime/calls/${e}/hangup`, {
|
|
4119
4119
|
...t,
|
|
4120
|
-
headers:
|
|
4120
|
+
headers: U([{ Accept: "*/*" }, t?.headers]),
|
|
4121
4121
|
__security: { bearerAuth: !0 }
|
|
4122
4122
|
});
|
|
4123
4123
|
}
|
|
4124
4124
|
refer(e, t, n) {
|
|
4125
|
-
return this._client.post(
|
|
4125
|
+
return this._client.post(P`/realtime/calls/${e}/refer`, {
|
|
4126
4126
|
body: t,
|
|
4127
4127
|
...n,
|
|
4128
|
-
headers:
|
|
4128
|
+
headers: U([{ Accept: "*/*" }, n?.headers]),
|
|
4129
4129
|
__security: { bearerAuth: !0 }
|
|
4130
4130
|
});
|
|
4131
4131
|
}
|
|
4132
4132
|
reject(e, t = {}, n) {
|
|
4133
|
-
return this._client.post(
|
|
4133
|
+
return this._client.post(P`/realtime/calls/${e}/reject`, {
|
|
4134
4134
|
body: t,
|
|
4135
4135
|
...n,
|
|
4136
|
-
headers:
|
|
4136
|
+
headers: U([{ Accept: "*/*" }, n?.headers]),
|
|
4137
4137
|
__security: { bearerAuth: !0 }
|
|
4138
4138
|
});
|
|
4139
4139
|
}
|
|
4140
|
-
}, Ei = class extends
|
|
4140
|
+
}, Ei = class extends N {
|
|
4141
4141
|
create(e, t) {
|
|
4142
4142
|
return this._client.post("/realtime/client_secrets", {
|
|
4143
4143
|
body: e,
|
|
@@ -4145,7 +4145,7 @@ var Si = class extends P {
|
|
|
4145
4145
|
__security: { bearerAuth: !0 }
|
|
4146
4146
|
});
|
|
4147
4147
|
}
|
|
4148
|
-
}, Di = class extends
|
|
4148
|
+
}, Di = class extends N {
|
|
4149
4149
|
constructor() {
|
|
4150
4150
|
super(...arguments), this.clientSecrets = new Ei(this._client), this.calls = new Ti(this._client);
|
|
4151
4151
|
}
|
|
@@ -4201,7 +4201,7 @@ function Ai(e, t) {
|
|
|
4201
4201
|
return e.text?.format?.type === "json_schema" ? "$parseRaw" in e.text?.format ? (e.text?.format).$parseRaw(t) : JSON.parse(t) : null;
|
|
4202
4202
|
}
|
|
4203
4203
|
function ji(e) {
|
|
4204
|
-
return !!
|
|
4204
|
+
return !!Ht(e.text?.format);
|
|
4205
4205
|
}
|
|
4206
4206
|
function Mi(e) {
|
|
4207
4207
|
return e?.$brand === "auto-parseable-tool";
|
|
@@ -4224,7 +4224,7 @@ function Fi(e) {
|
|
|
4224
4224
|
}
|
|
4225
4225
|
//#endregion
|
|
4226
4226
|
//#region node_modules/openai/lib/responses/ResponseStream.mjs
|
|
4227
|
-
var Ii, Li, Q, Ri, zi, Bi, Vi, Hi, Ui = class n extends
|
|
4227
|
+
var Ii, Li, Q, Ri, zi, Bi, Vi, Hi, Ui = class n extends pn {
|
|
4228
4228
|
constructor(t) {
|
|
4229
4229
|
super(), Ii.add(this), Li.set(this, void 0), Q.set(this, void 0), Ri.set(this, void 0), e(this, Li, t, "f");
|
|
4230
4230
|
}
|
|
@@ -4401,15 +4401,15 @@ function Wi(e, t) {
|
|
|
4401
4401
|
}
|
|
4402
4402
|
//#endregion
|
|
4403
4403
|
//#region node_modules/openai/resources/responses/input-items.mjs
|
|
4404
|
-
var Gi = class extends
|
|
4404
|
+
var Gi = class extends N {
|
|
4405
4405
|
list(e, t = {}, n) {
|
|
4406
|
-
return this._client.getAPIList(
|
|
4406
|
+
return this._client.getAPIList(P`/responses/${e}/input_items`, k, {
|
|
4407
4407
|
query: t,
|
|
4408
4408
|
...n,
|
|
4409
4409
|
__security: { bearerAuth: !0 }
|
|
4410
4410
|
});
|
|
4411
4411
|
}
|
|
4412
|
-
}, Ki = class extends
|
|
4412
|
+
}, Ki = class extends N {
|
|
4413
4413
|
count(e = {}, t) {
|
|
4414
4414
|
return this._client.post("/responses/input_tokens", {
|
|
4415
4415
|
body: e,
|
|
@@ -4417,7 +4417,7 @@ var Gi = class extends P {
|
|
|
4417
4417
|
__security: { bearerAuth: !0 }
|
|
4418
4418
|
});
|
|
4419
4419
|
}
|
|
4420
|
-
}, qi = class extends
|
|
4420
|
+
}, qi = class extends N {
|
|
4421
4421
|
constructor() {
|
|
4422
4422
|
super(...arguments), this.inputItems = new Gi(this._client), this.inputTokens = new Ki(this._client);
|
|
4423
4423
|
}
|
|
@@ -4430,7 +4430,7 @@ var Gi = class extends P {
|
|
|
4430
4430
|
})._thenUnwrap((e) => ("object" in e && e.object === "response" && Fi(e), e));
|
|
4431
4431
|
}
|
|
4432
4432
|
retrieve(e, t = {}, n) {
|
|
4433
|
-
return this._client.get(
|
|
4433
|
+
return this._client.get(P`/responses/${e}`, {
|
|
4434
4434
|
query: t,
|
|
4435
4435
|
...n,
|
|
4436
4436
|
stream: t?.stream ?? !1,
|
|
@@ -4438,9 +4438,9 @@ var Gi = class extends P {
|
|
|
4438
4438
|
})._thenUnwrap((e) => ("object" in e && e.object === "response" && Fi(e), e));
|
|
4439
4439
|
}
|
|
4440
4440
|
delete(e, t) {
|
|
4441
|
-
return this._client.delete(
|
|
4441
|
+
return this._client.delete(P`/responses/${e}`, {
|
|
4442
4442
|
...t,
|
|
4443
|
-
headers:
|
|
4443
|
+
headers: U([{ Accept: "*/*" }, t?.headers]),
|
|
4444
4444
|
__security: { bearerAuth: !0 }
|
|
4445
4445
|
});
|
|
4446
4446
|
}
|
|
@@ -4451,7 +4451,7 @@ var Gi = class extends P {
|
|
|
4451
4451
|
return Ui.createResponse(this._client, e, t);
|
|
4452
4452
|
}
|
|
4453
4453
|
cancel(e, t) {
|
|
4454
|
-
return this._client.post(
|
|
4454
|
+
return this._client.post(P`/responses/${e}/cancel`, {
|
|
4455
4455
|
...t,
|
|
4456
4456
|
__security: { bearerAuth: !0 }
|
|
4457
4457
|
});
|
|
@@ -4467,31 +4467,31 @@ var Gi = class extends P {
|
|
|
4467
4467
|
qi.InputItems = Gi, qi.InputTokens = Ki;
|
|
4468
4468
|
//#endregion
|
|
4469
4469
|
//#region node_modules/openai/resources/skills/content.mjs
|
|
4470
|
-
var Ji = class extends
|
|
4470
|
+
var Ji = class extends N {
|
|
4471
4471
|
retrieve(e, t) {
|
|
4472
|
-
return this._client.get(
|
|
4472
|
+
return this._client.get(P`/skills/${e}/content`, {
|
|
4473
4473
|
...t,
|
|
4474
|
-
headers:
|
|
4474
|
+
headers: U([{ Accept: "application/binary" }, t?.headers]),
|
|
4475
4475
|
__security: { bearerAuth: !0 },
|
|
4476
4476
|
__binaryResponse: !0
|
|
4477
4477
|
});
|
|
4478
4478
|
}
|
|
4479
|
-
}, Yi = class extends
|
|
4479
|
+
}, Yi = class extends N {
|
|
4480
4480
|
retrieve(e, t, n) {
|
|
4481
4481
|
let { skill_id: r } = t;
|
|
4482
|
-
return this._client.get(
|
|
4482
|
+
return this._client.get(P`/skills/${r}/versions/${e}/content`, {
|
|
4483
4483
|
...n,
|
|
4484
|
-
headers:
|
|
4484
|
+
headers: U([{ Accept: "application/binary" }, n?.headers]),
|
|
4485
4485
|
__security: { bearerAuth: !0 },
|
|
4486
4486
|
__binaryResponse: !0
|
|
4487
4487
|
});
|
|
4488
4488
|
}
|
|
4489
|
-
}, Xi = class extends
|
|
4489
|
+
}, Xi = class extends N {
|
|
4490
4490
|
constructor() {
|
|
4491
4491
|
super(...arguments), this.content = new Yi(this._client);
|
|
4492
4492
|
}
|
|
4493
4493
|
create(e, t = {}, n) {
|
|
4494
|
-
return this._client.post(
|
|
4494
|
+
return this._client.post(P`/skills/${e}/versions`, wt({
|
|
4495
4495
|
body: t,
|
|
4496
4496
|
...n,
|
|
4497
4497
|
__security: { bearerAuth: !0 }
|
|
@@ -4499,13 +4499,13 @@ var Ji = class extends P {
|
|
|
4499
4499
|
}
|
|
4500
4500
|
retrieve(e, t, n) {
|
|
4501
4501
|
let { skill_id: r } = t;
|
|
4502
|
-
return this._client.get(
|
|
4502
|
+
return this._client.get(P`/skills/${r}/versions/${e}`, {
|
|
4503
4503
|
...n,
|
|
4504
4504
|
__security: { bearerAuth: !0 }
|
|
4505
4505
|
});
|
|
4506
4506
|
}
|
|
4507
4507
|
list(e, t = {}, n) {
|
|
4508
|
-
return this._client.getAPIList(
|
|
4508
|
+
return this._client.getAPIList(P`/skills/${e}/versions`, k, {
|
|
4509
4509
|
query: t,
|
|
4510
4510
|
...n,
|
|
4511
4511
|
__security: { bearerAuth: !0 }
|
|
@@ -4513,7 +4513,7 @@ var Ji = class extends P {
|
|
|
4513
4513
|
}
|
|
4514
4514
|
delete(e, t, n) {
|
|
4515
4515
|
let { skill_id: r } = t;
|
|
4516
|
-
return this._client.delete(
|
|
4516
|
+
return this._client.delete(P`/skills/${r}/versions/${e}`, {
|
|
4517
4517
|
...n,
|
|
4518
4518
|
__security: { bearerAuth: !0 }
|
|
4519
4519
|
});
|
|
@@ -4522,39 +4522,39 @@ var Ji = class extends P {
|
|
|
4522
4522
|
Xi.Content = Yi;
|
|
4523
4523
|
//#endregion
|
|
4524
4524
|
//#region node_modules/openai/resources/skills/skills.mjs
|
|
4525
|
-
var Zi = class extends
|
|
4525
|
+
var Zi = class extends N {
|
|
4526
4526
|
constructor() {
|
|
4527
4527
|
super(...arguments), this.content = new Ji(this._client), this.versions = new Xi(this._client);
|
|
4528
4528
|
}
|
|
4529
4529
|
create(e = {}, t) {
|
|
4530
|
-
return this._client.post("/skills",
|
|
4530
|
+
return this._client.post("/skills", wt({
|
|
4531
4531
|
body: e,
|
|
4532
4532
|
...t,
|
|
4533
4533
|
__security: { bearerAuth: !0 }
|
|
4534
4534
|
}, this._client));
|
|
4535
4535
|
}
|
|
4536
4536
|
retrieve(e, t) {
|
|
4537
|
-
return this._client.get(
|
|
4537
|
+
return this._client.get(P`/skills/${e}`, {
|
|
4538
4538
|
...t,
|
|
4539
4539
|
__security: { bearerAuth: !0 }
|
|
4540
4540
|
});
|
|
4541
4541
|
}
|
|
4542
4542
|
update(e, t, n) {
|
|
4543
|
-
return this._client.post(
|
|
4543
|
+
return this._client.post(P`/skills/${e}`, {
|
|
4544
4544
|
body: t,
|
|
4545
4545
|
...n,
|
|
4546
4546
|
__security: { bearerAuth: !0 }
|
|
4547
4547
|
});
|
|
4548
4548
|
}
|
|
4549
4549
|
list(e = {}, t) {
|
|
4550
|
-
return this._client.getAPIList("/skills",
|
|
4550
|
+
return this._client.getAPIList("/skills", k, {
|
|
4551
4551
|
query: e,
|
|
4552
4552
|
...t,
|
|
4553
4553
|
__security: { bearerAuth: !0 }
|
|
4554
4554
|
});
|
|
4555
4555
|
}
|
|
4556
4556
|
delete(e, t) {
|
|
4557
|
-
return this._client.delete(
|
|
4557
|
+
return this._client.delete(P`/skills/${e}`, {
|
|
4558
4558
|
...t,
|
|
4559
4559
|
__security: { bearerAuth: !0 }
|
|
4560
4560
|
});
|
|
@@ -4563,15 +4563,15 @@ var Zi = class extends P {
|
|
|
4563
4563
|
Zi.Content = Ji, Zi.Versions = Xi;
|
|
4564
4564
|
//#endregion
|
|
4565
4565
|
//#region node_modules/openai/resources/uploads/parts.mjs
|
|
4566
|
-
var Qi = class extends
|
|
4566
|
+
var Qi = class extends N {
|
|
4567
4567
|
create(e, t, n) {
|
|
4568
|
-
return this._client.post(
|
|
4568
|
+
return this._client.post(P`/uploads/${e}/parts`, M({
|
|
4569
4569
|
body: t,
|
|
4570
4570
|
...n,
|
|
4571
4571
|
__security: { bearerAuth: !0 }
|
|
4572
4572
|
}, this._client));
|
|
4573
4573
|
}
|
|
4574
|
-
}, $i = class extends
|
|
4574
|
+
}, $i = class extends N {
|
|
4575
4575
|
constructor() {
|
|
4576
4576
|
super(...arguments), this.parts = new Qi(this._client);
|
|
4577
4577
|
}
|
|
@@ -4583,13 +4583,13 @@ var Qi = class extends P {
|
|
|
4583
4583
|
});
|
|
4584
4584
|
}
|
|
4585
4585
|
cancel(e, t) {
|
|
4586
|
-
return this._client.post(
|
|
4586
|
+
return this._client.post(P`/uploads/${e}/cancel`, {
|
|
4587
4587
|
...t,
|
|
4588
4588
|
__security: { bearerAuth: !0 }
|
|
4589
4589
|
});
|
|
4590
4590
|
}
|
|
4591
4591
|
complete(e, t, n) {
|
|
4592
|
-
return this._client.post(
|
|
4592
|
+
return this._client.post(P`/uploads/${e}/complete`, {
|
|
4593
4593
|
body: t,
|
|
4594
4594
|
...n,
|
|
4595
4595
|
__security: { bearerAuth: !0 }
|
|
@@ -4608,28 +4608,28 @@ var ea = async (e) => {
|
|
|
4608
4608
|
let r = [];
|
|
4609
4609
|
for (let e of t) e.status === "fulfilled" && r.push(e.value);
|
|
4610
4610
|
return r;
|
|
4611
|
-
}, ta = class extends
|
|
4611
|
+
}, ta = class extends N {
|
|
4612
4612
|
create(e, t, n) {
|
|
4613
|
-
return this._client.post(
|
|
4613
|
+
return this._client.post(P`/vector_stores/${e}/file_batches`, {
|
|
4614
4614
|
body: t,
|
|
4615
4615
|
...n,
|
|
4616
|
-
headers:
|
|
4616
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4617
4617
|
__security: { bearerAuth: !0 }
|
|
4618
4618
|
});
|
|
4619
4619
|
}
|
|
4620
4620
|
retrieve(e, t, n) {
|
|
4621
4621
|
let { vector_store_id: r } = t;
|
|
4622
|
-
return this._client.get(
|
|
4622
|
+
return this._client.get(P`/vector_stores/${r}/file_batches/${e}`, {
|
|
4623
4623
|
...n,
|
|
4624
|
-
headers:
|
|
4624
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4625
4625
|
__security: { bearerAuth: !0 }
|
|
4626
4626
|
});
|
|
4627
4627
|
}
|
|
4628
4628
|
cancel(e, t, n) {
|
|
4629
4629
|
let { vector_store_id: r } = t;
|
|
4630
|
-
return this._client.post(
|
|
4630
|
+
return this._client.post(P`/vector_stores/${r}/file_batches/${e}/cancel`, {
|
|
4631
4631
|
...n,
|
|
4632
|
-
headers:
|
|
4632
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4633
4633
|
__security: { bearerAuth: !0 }
|
|
4634
4634
|
});
|
|
4635
4635
|
}
|
|
@@ -4639,15 +4639,15 @@ var ea = async (e) => {
|
|
|
4639
4639
|
}
|
|
4640
4640
|
listFiles(e, t, n) {
|
|
4641
4641
|
let { vector_store_id: r, ...i } = t;
|
|
4642
|
-
return this._client.getAPIList(
|
|
4642
|
+
return this._client.getAPIList(P`/vector_stores/${r}/file_batches/${e}/files`, k, {
|
|
4643
4643
|
query: i,
|
|
4644
4644
|
...n,
|
|
4645
|
-
headers:
|
|
4645
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4646
4646
|
__security: { bearerAuth: !0 }
|
|
4647
4647
|
});
|
|
4648
4648
|
}
|
|
4649
4649
|
async poll(e, t, n) {
|
|
4650
|
-
let r =
|
|
4650
|
+
let r = U([n?.headers, {
|
|
4651
4651
|
"X-Stainless-Poll-Helper": "true",
|
|
4652
4652
|
"X-Stainless-Custom-Poll-Interval": n?.pollIntervalMs?.toString() ?? void 0
|
|
4653
4653
|
}]);
|
|
@@ -4689,45 +4689,45 @@ var ea = async (e) => {
|
|
|
4689
4689
|
}
|
|
4690
4690
|
return await ea(Array(a).fill(s).map(l)), await this.createAndPoll(e, { file_ids: c });
|
|
4691
4691
|
}
|
|
4692
|
-
}, na = class extends
|
|
4692
|
+
}, na = class extends N {
|
|
4693
4693
|
create(e, t, n) {
|
|
4694
|
-
return this._client.post(
|
|
4694
|
+
return this._client.post(P`/vector_stores/${e}/files`, {
|
|
4695
4695
|
body: t,
|
|
4696
4696
|
...n,
|
|
4697
|
-
headers:
|
|
4697
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4698
4698
|
__security: { bearerAuth: !0 }
|
|
4699
4699
|
});
|
|
4700
4700
|
}
|
|
4701
4701
|
retrieve(e, t, n) {
|
|
4702
4702
|
let { vector_store_id: r } = t;
|
|
4703
|
-
return this._client.get(
|
|
4703
|
+
return this._client.get(P`/vector_stores/${r}/files/${e}`, {
|
|
4704
4704
|
...n,
|
|
4705
|
-
headers:
|
|
4705
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4706
4706
|
__security: { bearerAuth: !0 }
|
|
4707
4707
|
});
|
|
4708
4708
|
}
|
|
4709
4709
|
update(e, t, n) {
|
|
4710
4710
|
let { vector_store_id: r, ...i } = t;
|
|
4711
|
-
return this._client.post(
|
|
4711
|
+
return this._client.post(P`/vector_stores/${r}/files/${e}`, {
|
|
4712
4712
|
body: i,
|
|
4713
4713
|
...n,
|
|
4714
|
-
headers:
|
|
4714
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4715
4715
|
__security: { bearerAuth: !0 }
|
|
4716
4716
|
});
|
|
4717
4717
|
}
|
|
4718
4718
|
list(e, t = {}, n) {
|
|
4719
|
-
return this._client.getAPIList(
|
|
4719
|
+
return this._client.getAPIList(P`/vector_stores/${e}/files`, k, {
|
|
4720
4720
|
query: t,
|
|
4721
4721
|
...n,
|
|
4722
|
-
headers:
|
|
4722
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4723
4723
|
__security: { bearerAuth: !0 }
|
|
4724
4724
|
});
|
|
4725
4725
|
}
|
|
4726
4726
|
delete(e, t, n) {
|
|
4727
4727
|
let { vector_store_id: r } = t;
|
|
4728
|
-
return this._client.delete(
|
|
4728
|
+
return this._client.delete(P`/vector_stores/${r}/files/${e}`, {
|
|
4729
4729
|
...n,
|
|
4730
|
-
headers:
|
|
4730
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4731
4731
|
__security: { bearerAuth: !0 }
|
|
4732
4732
|
});
|
|
4733
4733
|
}
|
|
@@ -4736,7 +4736,7 @@ var ea = async (e) => {
|
|
|
4736
4736
|
return await this.poll(e, r.id, n);
|
|
4737
4737
|
}
|
|
4738
4738
|
async poll(e, t, n) {
|
|
4739
|
-
let r =
|
|
4739
|
+
let r = U([n?.headers, {
|
|
4740
4740
|
"X-Stainless-Poll-Helper": "true",
|
|
4741
4741
|
"X-Stainless-Custom-Poll-Interval": n?.pollIntervalMs?.toString() ?? void 0
|
|
4742
4742
|
}]);
|
|
@@ -4776,13 +4776,13 @@ var ea = async (e) => {
|
|
|
4776
4776
|
}
|
|
4777
4777
|
content(e, t, n) {
|
|
4778
4778
|
let { vector_store_id: r } = t;
|
|
4779
|
-
return this._client.getAPIList(
|
|
4779
|
+
return this._client.getAPIList(P`/vector_stores/${r}/files/${e}/content`, O, {
|
|
4780
4780
|
...n,
|
|
4781
|
-
headers:
|
|
4781
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4782
4782
|
__security: { bearerAuth: !0 }
|
|
4783
4783
|
});
|
|
4784
4784
|
}
|
|
4785
|
-
}, ra = class extends
|
|
4785
|
+
}, ra = class extends N {
|
|
4786
4786
|
constructor() {
|
|
4787
4787
|
super(...arguments), this.files = new na(this._client), this.fileBatches = new ta(this._client);
|
|
4788
4788
|
}
|
|
@@ -4790,46 +4790,46 @@ var ea = async (e) => {
|
|
|
4790
4790
|
return this._client.post("/vector_stores", {
|
|
4791
4791
|
body: e,
|
|
4792
4792
|
...t,
|
|
4793
|
-
headers:
|
|
4793
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
4794
4794
|
__security: { bearerAuth: !0 }
|
|
4795
4795
|
});
|
|
4796
4796
|
}
|
|
4797
4797
|
retrieve(e, t) {
|
|
4798
|
-
return this._client.get(
|
|
4798
|
+
return this._client.get(P`/vector_stores/${e}`, {
|
|
4799
4799
|
...t,
|
|
4800
|
-
headers:
|
|
4800
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
4801
4801
|
__security: { bearerAuth: !0 }
|
|
4802
4802
|
});
|
|
4803
4803
|
}
|
|
4804
4804
|
update(e, t, n) {
|
|
4805
|
-
return this._client.post(
|
|
4805
|
+
return this._client.post(P`/vector_stores/${e}`, {
|
|
4806
4806
|
body: t,
|
|
4807
4807
|
...n,
|
|
4808
|
-
headers:
|
|
4808
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4809
4809
|
__security: { bearerAuth: !0 }
|
|
4810
4810
|
});
|
|
4811
4811
|
}
|
|
4812
4812
|
list(e = {}, t) {
|
|
4813
|
-
return this._client.getAPIList("/vector_stores",
|
|
4813
|
+
return this._client.getAPIList("/vector_stores", k, {
|
|
4814
4814
|
query: e,
|
|
4815
4815
|
...t,
|
|
4816
|
-
headers:
|
|
4816
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
4817
4817
|
__security: { bearerAuth: !0 }
|
|
4818
4818
|
});
|
|
4819
4819
|
}
|
|
4820
4820
|
delete(e, t) {
|
|
4821
|
-
return this._client.delete(
|
|
4821
|
+
return this._client.delete(P`/vector_stores/${e}`, {
|
|
4822
4822
|
...t,
|
|
4823
|
-
headers:
|
|
4823
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, t?.headers]),
|
|
4824
4824
|
__security: { bearerAuth: !0 }
|
|
4825
4825
|
});
|
|
4826
4826
|
}
|
|
4827
4827
|
search(e, t, n) {
|
|
4828
|
-
return this._client.getAPIList(
|
|
4828
|
+
return this._client.getAPIList(P`/vector_stores/${e}/search`, O, {
|
|
4829
4829
|
body: t,
|
|
4830
4830
|
method: "post",
|
|
4831
4831
|
...n,
|
|
4832
|
-
headers:
|
|
4832
|
+
headers: U([{ "OpenAI-Beta": "assistants=v2" }, n?.headers]),
|
|
4833
4833
|
__security: { bearerAuth: !0 }
|
|
4834
4834
|
});
|
|
4835
4835
|
}
|
|
@@ -4837,77 +4837,77 @@ var ea = async (e) => {
|
|
|
4837
4837
|
ra.Files = na, ra.FileBatches = ta;
|
|
4838
4838
|
//#endregion
|
|
4839
4839
|
//#region node_modules/openai/resources/videos.mjs
|
|
4840
|
-
var ia = class extends
|
|
4840
|
+
var ia = class extends N {
|
|
4841
4841
|
create(e, t) {
|
|
4842
|
-
return this._client.post("/videos",
|
|
4842
|
+
return this._client.post("/videos", M({
|
|
4843
4843
|
body: e,
|
|
4844
4844
|
...t,
|
|
4845
4845
|
__security: { bearerAuth: !0 }
|
|
4846
4846
|
}, this._client));
|
|
4847
4847
|
}
|
|
4848
4848
|
retrieve(e, t) {
|
|
4849
|
-
return this._client.get(
|
|
4849
|
+
return this._client.get(P`/videos/${e}`, {
|
|
4850
4850
|
...t,
|
|
4851
4851
|
__security: { bearerAuth: !0 }
|
|
4852
4852
|
});
|
|
4853
4853
|
}
|
|
4854
4854
|
list(e = {}, t) {
|
|
4855
|
-
return this._client.getAPIList("/videos",
|
|
4855
|
+
return this._client.getAPIList("/videos", A, {
|
|
4856
4856
|
query: e,
|
|
4857
4857
|
...t,
|
|
4858
4858
|
__security: { bearerAuth: !0 }
|
|
4859
4859
|
});
|
|
4860
4860
|
}
|
|
4861
4861
|
delete(e, t) {
|
|
4862
|
-
return this._client.delete(
|
|
4862
|
+
return this._client.delete(P`/videos/${e}`, {
|
|
4863
4863
|
...t,
|
|
4864
4864
|
__security: { bearerAuth: !0 }
|
|
4865
4865
|
});
|
|
4866
4866
|
}
|
|
4867
4867
|
createCharacter(e, t) {
|
|
4868
|
-
return this._client.post("/videos/characters",
|
|
4868
|
+
return this._client.post("/videos/characters", M({
|
|
4869
4869
|
body: e,
|
|
4870
4870
|
...t,
|
|
4871
4871
|
__security: { bearerAuth: !0 }
|
|
4872
4872
|
}, this._client));
|
|
4873
4873
|
}
|
|
4874
4874
|
downloadContent(e, t = {}, n) {
|
|
4875
|
-
return this._client.get(
|
|
4875
|
+
return this._client.get(P`/videos/${e}/content`, {
|
|
4876
4876
|
query: t,
|
|
4877
4877
|
...n,
|
|
4878
|
-
headers:
|
|
4878
|
+
headers: U([{ Accept: "application/binary" }, n?.headers]),
|
|
4879
4879
|
__security: { bearerAuth: !0 },
|
|
4880
4880
|
__binaryResponse: !0
|
|
4881
4881
|
});
|
|
4882
4882
|
}
|
|
4883
4883
|
edit(e, t) {
|
|
4884
|
-
return this._client.post("/videos/edits",
|
|
4884
|
+
return this._client.post("/videos/edits", M({
|
|
4885
4885
|
body: e,
|
|
4886
4886
|
...t,
|
|
4887
4887
|
__security: { bearerAuth: !0 }
|
|
4888
4888
|
}, this._client));
|
|
4889
4889
|
}
|
|
4890
4890
|
extend(e, t) {
|
|
4891
|
-
return this._client.post("/videos/extensions",
|
|
4891
|
+
return this._client.post("/videos/extensions", M({
|
|
4892
4892
|
body: e,
|
|
4893
4893
|
...t,
|
|
4894
4894
|
__security: { bearerAuth: !0 }
|
|
4895
4895
|
}, this._client));
|
|
4896
4896
|
}
|
|
4897
4897
|
getCharacter(e, t) {
|
|
4898
|
-
return this._client.get(
|
|
4898
|
+
return this._client.get(P`/videos/characters/${e}`, {
|
|
4899
4899
|
...t,
|
|
4900
4900
|
__security: { bearerAuth: !0 }
|
|
4901
4901
|
});
|
|
4902
4902
|
}
|
|
4903
4903
|
remix(e, t, n) {
|
|
4904
|
-
return this._client.post(
|
|
4904
|
+
return this._client.post(P`/videos/${e}/remix`, wt({
|
|
4905
4905
|
body: t,
|
|
4906
4906
|
...n,
|
|
4907
4907
|
__security: { bearerAuth: !0 }
|
|
4908
4908
|
}, this._client));
|
|
4909
4909
|
}
|
|
4910
|
-
}, aa, oa, sa, ca = class extends
|
|
4910
|
+
}, aa, oa, sa, ca = class extends N {
|
|
4911
4911
|
constructor() {
|
|
4912
4912
|
super(...arguments), aa.add(this);
|
|
4913
4913
|
}
|
|
@@ -4917,7 +4917,7 @@ var ia = class extends P {
|
|
|
4917
4917
|
async verifySignature(e, n, r = this._client.webhookSecret, i = 300) {
|
|
4918
4918
|
if (typeof crypto > "u" || typeof crypto.subtle.importKey != "function" || typeof crypto.subtle.verify != "function") throw Error("Webhook signature verification is only supported when the `crypto` global is defined");
|
|
4919
4919
|
t(this, aa, "m", oa).call(this, r);
|
|
4920
|
-
let a =
|
|
4920
|
+
let a = U([n]).values, o = t(this, aa, "m", sa).call(this, a, "webhook-signature"), s = t(this, aa, "m", sa).call(this, a, "webhook-timestamp"), c = t(this, aa, "m", sa).call(this, a, "webhook-id"), l = parseInt(s, 10);
|
|
4921
4921
|
if (isNaN(l)) throw new b("Invalid webhook timestamp format");
|
|
4922
4922
|
let u = Math.floor(Date.now() / 1e3);
|
|
4923
4923
|
if (u - l > i) throw new b("Webhook timestamp is too old");
|
|
@@ -4946,8 +4946,8 @@ aa = /* @__PURE__ */ new WeakSet(), oa = function(e) {
|
|
|
4946
4946
|
//#endregion
|
|
4947
4947
|
//#region node_modules/openai/client.mjs
|
|
4948
4948
|
var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
4949
|
-
constructor({ baseURL: t =
|
|
4950
|
-
la.add(this), da.set(this, void 0), this.completions = new ti(this), this.chat = new
|
|
4949
|
+
constructor({ baseURL: t = W("OPENAI_BASE_URL"), apiKey: n = W("OPENAI_API_KEY") ?? null, adminAPIKey: r = W("OPENAI_ADMIN_KEY") ?? null, organization: i = W("OPENAI_ORG_ID") ?? null, project: o = W("OPENAI_PROJECT_ID") ?? null, webhookSecret: s = W("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity: c, ...l } = {}) {
|
|
4950
|
+
la.add(this), da.set(this, void 0), this.completions = new ti(this), this.chat = new Wn(this), this.embeddings = new si(this), this.files = new di(this), this.images = new Si(this), this.audio = new Cr(this), this.moderations = new wi(this), this.models = new Ci(this), this.fineTuning = new yi(this), this.graders = new xi(this), this.vectorStores = new ra(this), this.webhooks = new ca(this), this.beta = new ei(this), this.batches = new wr(this), this.uploads = new $i(this), this.admin = new _r(this), this.responses = new qi(this), this.realtime = new Di(this), this.conversations = new oi(this), this.evals = new ui(this), this.containers = new ii(this), this.skills = new Zi(this), this.videos = new ia(this);
|
|
4951
4951
|
let u = {
|
|
4952
4952
|
apiKey: n,
|
|
4953
4953
|
adminAPIKey: r,
|
|
@@ -4963,17 +4963,17 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
4963
4963
|
if (!u.dangerouslyAllowBrowser && fe()) throw new a("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n");
|
|
4964
4964
|
this.baseURL = u.baseURL, this.timeout = u.timeout ?? ua.DEFAULT_TIMEOUT, this.logger = u.logger ?? console;
|
|
4965
4965
|
let d = "warn";
|
|
4966
|
-
this.logLevel = d, this.logLevel = Qe(u.logLevel, "ClientOptions.logLevel", this) ?? Qe(
|
|
4967
|
-
let f =
|
|
4966
|
+
this.logLevel = d, this.logLevel = Qe(u.logLevel, "ClientOptions.logLevel", this) ?? Qe(W("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? d, this.fetchOptions = u.fetchOptions, this.maxRetries = u.maxRetries ?? 2, this.fetch = u.fetch ?? be(), e(this, da, Te, "f");
|
|
4967
|
+
let f = W("OPENAI_CUSTOM_HEADERS");
|
|
4968
4968
|
if (f) {
|
|
4969
4969
|
let e = {};
|
|
4970
4970
|
for (let t of f.split("\n")) {
|
|
4971
4971
|
let n = t.indexOf(":");
|
|
4972
4972
|
n >= 0 && (e[t.substring(0, n).trim()] = t.substring(n + 1).trim());
|
|
4973
4973
|
}
|
|
4974
|
-
u.defaultHeaders =
|
|
4974
|
+
u.defaultHeaders = U([e, u.defaultHeaders]);
|
|
4975
4975
|
}
|
|
4976
|
-
this._options = u, c && (this._workloadIdentityAuth = new
|
|
4976
|
+
this._options = u, c && (this._workloadIdentityAuth = new yt(c, this.fetch)), this.apiKey = typeof n == "string" ? n : null, this.adminAPIKey = r, this.organization = i, this.project = o, this.webhookSecret = s;
|
|
4977
4977
|
}
|
|
4978
4978
|
withOptions(e) {
|
|
4979
4979
|
return new this.constructor({
|
|
@@ -5007,14 +5007,14 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5007
5007
|
bearerAuth: !0,
|
|
5008
5008
|
adminAPIKeyAuth: !0
|
|
5009
5009
|
}) {
|
|
5010
|
-
return
|
|
5010
|
+
return U([t.bearerAuth ? await this.bearerAuth(e) : null, t.adminAPIKeyAuth ? await this.adminAPIKeyAuth(e) : null]);
|
|
5011
5011
|
}
|
|
5012
5012
|
async bearerAuth(e) {
|
|
5013
|
-
if (this._workloadIdentityAuth) return
|
|
5014
|
-
if (this.apiKey != null) return
|
|
5013
|
+
if (this._workloadIdentityAuth) return U([{ Authorization: `Bearer ${await this._workloadIdentityAuth.getToken()}` }]);
|
|
5014
|
+
if (this.apiKey != null) return U([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
5015
5015
|
}
|
|
5016
5016
|
async adminAPIKeyAuth(e) {
|
|
5017
|
-
if (this.adminAPIKey != null) return
|
|
5017
|
+
if (this.adminAPIKey != null) return U([{ Authorization: `Bearer ${this.adminAPIKey}` }]);
|
|
5018
5018
|
}
|
|
5019
5019
|
stringifyQuery(e) {
|
|
5020
5020
|
return He(e);
|
|
@@ -5075,7 +5075,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5075
5075
|
})));
|
|
5076
5076
|
}
|
|
5077
5077
|
request(e, t = null) {
|
|
5078
|
-
return new
|
|
5078
|
+
return new pt(this, this.makeRequest(e, t, void 0));
|
|
5079
5079
|
}
|
|
5080
5080
|
async makeRequest(e, t, n) {
|
|
5081
5081
|
let a = await e, o = a.maxRetries ?? this.maxRetries;
|
|
@@ -5086,7 +5086,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5086
5086
|
options: a
|
|
5087
5087
|
});
|
|
5088
5088
|
let p = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"), m = n === void 0 ? "" : `, retryOf: ${n}`, h = Date.now();
|
|
5089
|
-
if (D(this).debug(`[${p}] sending request`,
|
|
5089
|
+
if (D(this).debug(`[${p}] sending request`, rt({
|
|
5090
5090
|
retryOfRequestLogID: n,
|
|
5091
5091
|
method: a.method,
|
|
5092
5092
|
url: d,
|
|
@@ -5098,13 +5098,13 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5098
5098
|
let e = `retrying, ${t} attempts remaining`;
|
|
5099
5099
|
if (a.signal?.aborted) throw new s();
|
|
5100
5100
|
let i = r(v) || /timed? ?out/i.test(String(v) + ("cause" in v ? String(v.cause) : ""));
|
|
5101
|
-
if (t) return D(this).info(`[${p}] connection ${i ? "timed out" : "failed"} - ${e}`), D(this).debug(`[${p}] connection ${i ? "timed out" : "failed"} (${e})`,
|
|
5101
|
+
if (t) return D(this).info(`[${p}] connection ${i ? "timed out" : "failed"} - ${e}`), D(this).debug(`[${p}] connection ${i ? "timed out" : "failed"} (${e})`, rt({
|
|
5102
5102
|
retryOfRequestLogID: n,
|
|
5103
5103
|
url: d,
|
|
5104
5104
|
durationMs: y - h,
|
|
5105
5105
|
message: v.message
|
|
5106
5106
|
})), this.retryRequest(a, t, n ?? p);
|
|
5107
|
-
throw D(this).info(`[${p}] connection ${i ? "timed out" : "failed"} - error; no more retries left`), D(this).debug(`[${p}] connection ${i ? "timed out" : "failed"} (error; no more retries left)`,
|
|
5107
|
+
throw D(this).info(`[${p}] connection ${i ? "timed out" : "failed"} - error; no more retries left`), D(this).debug(`[${p}] connection ${i ? "timed out" : "failed"} (error; no more retries left)`, rt({
|
|
5108
5108
|
retryOfRequestLogID: n,
|
|
5109
5109
|
url: d,
|
|
5110
5110
|
durationMs: y - h,
|
|
@@ -5126,7 +5126,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5126
5126
|
let e = await this.shouldRetry(v);
|
|
5127
5127
|
if (t && e) {
|
|
5128
5128
|
let e = `retrying, ${t} attempts remaining`;
|
|
5129
|
-
return await we(v.body), D(this).info(`${b} - ${e}`), D(this).debug(`[${p}] response error (${e})`,
|
|
5129
|
+
return await we(v.body), D(this).info(`${b} - ${e}`), D(this).debug(`[${p}] response error (${e})`, rt({
|
|
5130
5130
|
retryOfRequestLogID: n,
|
|
5131
5131
|
url: v.url,
|
|
5132
5132
|
status: v.status,
|
|
@@ -5137,7 +5137,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5137
5137
|
let r = e ? "error; no more retries left" : "error; not retryable";
|
|
5138
5138
|
D(this).info(`${b} - ${r}`);
|
|
5139
5139
|
let o = await v.text().catch((e) => i(e).message), s = le(o), c = s ? void 0 : o;
|
|
5140
|
-
throw D(this).debug(`[${p}] response error (${r})`,
|
|
5140
|
+
throw D(this).debug(`[${p}] response error (${r})`, rt({
|
|
5141
5141
|
retryOfRequestLogID: n,
|
|
5142
5142
|
url: v.url,
|
|
5143
5143
|
status: v.status,
|
|
@@ -5146,7 +5146,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5146
5146
|
durationMs: Date.now() - h
|
|
5147
5147
|
})), this.makeStatusError(v.status, s, c, v.headers);
|
|
5148
5148
|
}
|
|
5149
|
-
return D(this).info(b), D(this).debug(`[${p}] response start`,
|
|
5149
|
+
return D(this).info(b), D(this).debug(`[${p}] response start`, rt({
|
|
5150
5150
|
retryOfRequestLogID: n,
|
|
5151
5151
|
url: v.url,
|
|
5152
5152
|
status: v.status,
|
|
@@ -5174,7 +5174,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5174
5174
|
}
|
|
5175
5175
|
requestAPIList(e, t) {
|
|
5176
5176
|
let n = this.makeRequest(t, null, void 0);
|
|
5177
|
-
return new
|
|
5177
|
+
return new gt(this, n, e);
|
|
5178
5178
|
}
|
|
5179
5179
|
async fetchWithAuth(e, t, n, r, i = {
|
|
5180
5180
|
bearerAuth: !0,
|
|
@@ -5259,7 +5259,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5259
5259
|
async buildHeaders({ options: e, method: t, bodyHeaders: n, retryCount: r }) {
|
|
5260
5260
|
let i = {};
|
|
5261
5261
|
this.idempotencyHeader && t !== "get" && (e.idempotencyKey ||= this.defaultIdempotencyKey(), i[this.idempotencyHeader] = e.idempotencyKey);
|
|
5262
|
-
let a =
|
|
5262
|
+
let a = U([
|
|
5263
5263
|
i,
|
|
5264
5264
|
{
|
|
5265
5265
|
Accept: "application/json",
|
|
@@ -5286,7 +5286,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5286
5286
|
body: void 0,
|
|
5287
5287
|
isStreamingBody: !1
|
|
5288
5288
|
};
|
|
5289
|
-
let r =
|
|
5289
|
+
let r = U([n]), i = globalThis.ReadableStream !== void 0 && e instanceof globalThis.ReadableStream, a = !i && (typeof e == "string" || e instanceof ArrayBuffer || ArrayBuffer.isView(e) || globalThis.Blob !== void 0 && e instanceof globalThis.Blob || e instanceof URLSearchParams || e instanceof FormData);
|
|
5290
5290
|
return ArrayBuffer.isView(e) || e instanceof ArrayBuffer || e instanceof DataView || typeof e == "string" && r.values.has("content-type") || globalThis.Blob && e instanceof globalThis.Blob || e instanceof FormData || e instanceof URLSearchParams || i ? {
|
|
5291
5291
|
bodyHeaders: void 0,
|
|
5292
5292
|
body: e,
|
|
@@ -5310,7 +5310,7 @@ var la, ua, da, fa, pa = "workload-identity-auth", $ = class {
|
|
|
5310
5310
|
};
|
|
5311
5311
|
ua = $, da = /* @__PURE__ */ new WeakMap(), la = /* @__PURE__ */ new WeakSet(), fa = function() {
|
|
5312
5312
|
return this.baseURL !== "https://api.openai.com/v1";
|
|
5313
|
-
}, $.OpenAI = ua, $.DEFAULT_TIMEOUT = 6e5, $.OpenAIError = a, $.APIError = o, $.APIConnectionError = c, $.APIConnectionTimeoutError = l, $.APIUserAbortError = s, $.NotFoundError = p, $.ConflictError = m, $.RateLimitError = g, $.BadRequestError = u, $.AuthenticationError = d, $.InternalServerError = _, $.PermissionDeniedError = f, $.UnprocessableEntityError = h, $.InvalidWebhookSignatureError = b, $.toFile =
|
|
5313
|
+
}, $.OpenAI = ua, $.DEFAULT_TIMEOUT = 6e5, $.OpenAIError = a, $.APIError = o, $.APIConnectionError = c, $.APIConnectionTimeoutError = l, $.APIUserAbortError = s, $.NotFoundError = p, $.ConflictError = m, $.RateLimitError = g, $.BadRequestError = u, $.AuthenticationError = d, $.InternalServerError = _, $.PermissionDeniedError = f, $.UnprocessableEntityError = h, $.InvalidWebhookSignatureError = b, $.toFile = Ft, $.Completions = ti, $.Chat = Wn, $.Embeddings = si, $.Files = di, $.Images = Si, $.Audio = Cr, $.Moderations = wi, $.Models = Ci, $.FineTuning = yi, $.Graders = xi, $.VectorStores = ra, $.Webhooks = ca, $.Beta = ei, $.Batches = wr, $.Uploads = $i, $.Admin = _r, $.Responses = qi, $.Realtime = Di, $.Conversations = oi, $.Evals = ui, $.Containers = ii, $.Skills = Zi, $.Videos = ia;
|
|
5314
5314
|
function ma(e) {
|
|
5315
5315
|
if (ha(e)) return "Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });";
|
|
5316
5316
|
}
|
|
@@ -5326,7 +5326,7 @@ function ha(e) {
|
|
|
5326
5326
|
//#endregion
|
|
5327
5327
|
//#region node_modules/openai/azure.mjs
|
|
5328
5328
|
var ga = class extends $ {
|
|
5329
|
-
constructor({ baseURL: e =
|
|
5329
|
+
constructor({ baseURL: e = W("OPENAI_BASE_URL"), apiKey: t = W("AZURE_OPENAI_API_KEY"), apiVersion: n = W("OPENAI_API_VERSION"), endpoint: r, deployment: i, azureADTokenProvider: o, dangerouslyAllowBrowser: s, ...c } = {}) {
|
|
5330
5330
|
if (!n) throw new a("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");
|
|
5331
5331
|
if (typeof o == "function" && (s = !0), !o && !t) throw new a("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");
|
|
5332
5332
|
if (o && t) throw new a("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");
|
|
@@ -5357,7 +5357,7 @@ var ga = class extends $ {
|
|
|
5357
5357
|
bearerAuth: !0,
|
|
5358
5358
|
adminAPIKeyAuth: !0
|
|
5359
5359
|
};
|
|
5360
|
-
return n.bearerAuth && typeof this._options.apiKey == "string" ?
|
|
5360
|
+
return n.bearerAuth && typeof this._options.apiKey == "string" ? U([{ "api-key": this.apiKey }]) : super.authHeaders(e, n);
|
|
5361
5361
|
}
|
|
5362
5362
|
}, _a = new Set([
|
|
5363
5363
|
"/completions",
|
|
@@ -5371,4 +5371,61 @@ var ga = class extends $ {
|
|
|
5371
5371
|
"/images/edits"
|
|
5372
5372
|
]);
|
|
5373
5373
|
//#endregion
|
|
5374
|
-
|
|
5374
|
+
//#region node_modules/openai/bedrock.mjs
|
|
5375
|
+
function va(e) {
|
|
5376
|
+
let t = e?.trim();
|
|
5377
|
+
if (!t) throw new a("Must provide one of the `baseURL` or `awsRegion` arguments, or set the `AWS_BEDROCK_BASE_URL`, `AWS_REGION`, or `AWS_DEFAULT_REGION` environment variable.");
|
|
5378
|
+
return `https://bedrock-mantle.${t}.api.aws/openai/v1`;
|
|
5379
|
+
}
|
|
5380
|
+
function ya(e) {
|
|
5381
|
+
let t = new URL(e), n = t.pathname.match(/\/responses(?:\/.*)?$/);
|
|
5382
|
+
return n?.index !== void 0 && (t.pathname = t.pathname.slice(0, n.index) || "/"), t.toString().replace(/\/$/, "");
|
|
5383
|
+
}
|
|
5384
|
+
function ba(e) {
|
|
5385
|
+
return Object.getOwnPropertyDescriptor(e, "output_text") || Fi(e), e;
|
|
5386
|
+
}
|
|
5387
|
+
function xa(e) {
|
|
5388
|
+
let t = e.stream.bind(e);
|
|
5389
|
+
return e.stream = ((e, n) => {
|
|
5390
|
+
let r = t(e, n), i = r.finalResponse.bind(r);
|
|
5391
|
+
return r.finalResponse = async () => ba(await i()), r;
|
|
5392
|
+
}), e;
|
|
5393
|
+
}
|
|
5394
|
+
var Sa = class extends $ {
|
|
5395
|
+
constructor({ baseURL: e = W("AWS_BEDROCK_BASE_URL"), apiKey: t, awsRegion: n = W("AWS_REGION") ?? W("AWS_DEFAULT_REGION"), bedrockTokenProvider: r, adminAPIKey: i, workloadIdentity: o, ...s } = {}) {
|
|
5396
|
+
if (i || o) throw new a("BedrockOpenAI only supports Bedrock bearer token authentication.");
|
|
5397
|
+
if (t === void 0 && !r && (t = W("AWS_BEARER_TOKEN_BEDROCK") ?? null), typeof t == "function") throw new a("Pass refreshable Bedrock credentials via `bedrockTokenProvider`, not `apiKey`.");
|
|
5398
|
+
if (t && r) throw new a("The `apiKey` and `bedrockTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");
|
|
5399
|
+
if (!t && !r) throw new a("Missing credentials. Please pass an `apiKey` or `bedrockTokenProvider`, or set the `AWS_BEARER_TOKEN_BEDROCK` environment variable.");
|
|
5400
|
+
let c = e?.trim() ? e : va(n);
|
|
5401
|
+
super({
|
|
5402
|
+
apiKey: r ?? t,
|
|
5403
|
+
adminAPIKey: null,
|
|
5404
|
+
baseURL: ya(c),
|
|
5405
|
+
...s
|
|
5406
|
+
}), this.bedrockTokenProvider = r, this.responses = xa(new qi(this));
|
|
5407
|
+
}
|
|
5408
|
+
async prepareOptions(e) {
|
|
5409
|
+
let t = e.__security ?? { bearerAuth: !0 };
|
|
5410
|
+
t.adminAPIKeyAuth && !t.bearerAuth && await this._callApiKey(), await super.prepareOptions(e);
|
|
5411
|
+
}
|
|
5412
|
+
async authHeaders(e, t) {
|
|
5413
|
+
let n = t ?? {
|
|
5414
|
+
bearerAuth: !0,
|
|
5415
|
+
adminAPIKeyAuth: !0
|
|
5416
|
+
};
|
|
5417
|
+
return (n.bearerAuth || n.adminAPIKeyAuth) && this.apiKey !== null ? U([{ Authorization: `Bearer ${this.apiKey}` }]) : super.authHeaders(e, n);
|
|
5418
|
+
}
|
|
5419
|
+
withOptions(e) {
|
|
5420
|
+
let t = e.apiKey === void 0 ? e.bedrockTokenProvider ?? this.bedrockTokenProvider : void 0;
|
|
5421
|
+
return super.withOptions({
|
|
5422
|
+
...e,
|
|
5423
|
+
...t ? {
|
|
5424
|
+
apiKey: void 0,
|
|
5425
|
+
bedrockTokenProvider: t
|
|
5426
|
+
} : {}
|
|
5427
|
+
});
|
|
5428
|
+
}
|
|
5429
|
+
};
|
|
5430
|
+
//#endregion
|
|
5431
|
+
export { c as APIConnectionError, l as APIConnectionTimeoutError, o as APIError, pt as APIPromise, s as APIUserAbortError, d as AuthenticationError, ga as AzureOpenAI, u as BadRequestError, Sa as BedrockOpenAI, m as ConflictError, _ as InternalServerError, b as InvalidWebhookSignatureError, p as NotFoundError, x as OAuthError, $ as OpenAI, $ as default, a as OpenAIError, gt as PagePromise, f as PermissionDeniedError, g as RateLimitError, ee as SubjectTokenProviderError, h as UnprocessableEntityError, Ft as toFile };
|