The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
cleanup v3/v2/ (#63634)
Oleksandr Solovyov8285e38f9cd9
diff --git a/e2e/support/helpers/e2e-metabot-helpers.ts b/e2e/support/helpers/e2e-metabot-helpers.tsindex 457516e4d45..bd67fd318ff 100644--- a/e2e/support/helpers/e2e-metabot-helpers.ts+++ b/e2e/support/helpers/e2e-metabot-helpers.ts@@ -93,7 +93,7 @@ export function lastChatMessage() {export const mockMetabotResponse = (response: StaticResponse) => {return cy- .intercept("POST", "/api/ee/metabot-v3/v2/agent-streaming", (req) => {+ .intercept("POST", "/api/ee/metabot-v3/agent-streaming", (req) => {req.reply({...response,headers: {diff --git a/e2e/test/scenarios/metabot/metabot.cy.spec.ts b/e2e/test/scenarios/metabot/metabot.cy.spec.tsindex 659569916f9..7f3fda30ae9 100644--- a/e2e/test/scenarios/metabot/metabot.cy.spec.ts+++ b/e2e/test/scenarios/metabot/metabot.cy.spec.ts@@ -9,9 +9,7 @@ describe("Metabot UI", () => {beforeEach(() => {H.restore();cy.signInAsAdmin();- cy.intercept("POST", "/api/ee/metabot-v3/v2/agent-streaming").as(- "agentReq",- );+ cy.intercept("POST", "/api/ee/metabot-v3/agent-streaming").as("agentReq");cy.intercept("GET", "/api/automagic-dashboards/database/*/candidates").as("xrayCandidates",);diff --git a/enterprise/backend/src/metabase_enterprise/metabot_v3/api.clj b/enterprise/backend/src/metabase_enterprise/metabot_v3/api.cljindex 1a7c8de75e2..cd1703a3504 100644--- a/enterprise/backend/src/metabase_enterprise/metabot_v3/api.clj+++ b/enterprise/backend/src/metabase_enterprise/metabot_v3/api.clj@@ -65,7 +65,7 @@(store-message! conversation_id profile-id (metabot-v3.u/aisdk->messages "assistant" lines)):store-in-db)})))-(api.macros/defendpoint :post "/v2/agent-streaming"+(api.macros/defendpoint :post "/agent-streaming""Send a chat message to the LLM via the AI Proxy."[_route-params_query-paramsdiff --git a/enterprise/backend/test/metabase_enterprise/metabot_v3/api_test.clj b/enterprise/backend/test/metabase_enterprise/metabot_v3/api_test.cljindex 367c34ab7a7..b42167e9c56 100644--- a/enterprise/backend/test/metabase_enterprise/metabot_v3/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/metabot_v3/api_test.clj@@ -30,7 +30,7 @@(mt/with-model-cleanup [:model/MetabotMessage[:model/MetabotConversation :created_at]](reset! ai-requests [])- (let [response (mt/user-http-request :rasta :post 202 "ee/metabot-v3/v2/agent-streaming"+ (let [response (mt/user-http-request :rasta :post 202 "ee/metabot-v3/agent-streaming"(-> {:message (:content question):context {}:conversation_id conversation-iddiff --git a/enterprise/frontend/src/embedding-sdk-bundle/components/public/MetabotQuestion/MetabotQuestion.stories.tsx b/enterprise/frontend/src/embedding-sdk-bundle/components/public/MetabotQuestion/MetabotQuestion.stories.tsxindex d4739b92ded..a7e0f4089ef 100644--- a/enterprise/frontend/src/embedding-sdk-bundle/components/public/MetabotQuestion/MetabotQuestion.stories.tsx+++ b/enterprise/frontend/src/embedding-sdk-bundle/components/public/MetabotQuestion/MetabotQuestion.stories.tsx@@ -59,7 +59,7 @@ export const MetabotError = {parameters: {msw: {handlers: [- http.post("*/api/ee/metabot-v3/v2/agent-streaming", () => {+ http.post("*/api/ee/metabot-v3/agent-streaming", () => {return new HttpResponse(null, {status: 500,});diff --git a/enterprise/frontend/src/embedding-sdk-shared/test/mocks/mock-metabot-response.ts b/enterprise/frontend/src/embedding-sdk-shared/test/mocks/mock-metabot-response.tsindex d77a78e7d5b..65b717a09b3 100644--- a/enterprise/frontend/src/embedding-sdk-shared/test/mocks/mock-metabot-response.ts+++ b/enterprise/frontend/src/embedding-sdk-shared/test/mocks/mock-metabot-response.ts@@ -4,7 +4,7 @@ export const MOCK_AD_HOC_QUESTION_ID ="/question#eyJkYXRhc2V0X3F1ZXJ5IjogeyJkYXRhYmFzZSI6IDEsICJ0eXBlIjogInF1ZXJ5IiwgInF1ZXJ5IjogeyJzb3VyY2UtdGFibGUiOiAiY2FyZF9fMSJ9fSwgImRpc3BsYXkiOiAidGFibGUiLCAiZGlzcGxheUlzTG9ja2VkIjogdHJ1ZSwgInZpc3VhbGl6YXRpb25fc2V0dGluZ3MiOiB7fX0=";export const mockStreamResponse = (chunks: string[]) => {- return http.post("*/api/ee/metabot-v3/v2/agent-streaming", () => {+ return http.post("*/api/ee/metabot-v3/agent-streaming", () => {const encoder = new TextEncoder();const stream = new ReadableStream({diff --git a/enterprise/frontend/src/metabase-enterprise/metabot/metabot.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/metabot/metabot.unit.spec.tsxindex d18fd903b9c..4b5f9c5eba5 100644--- a/enterprise/frontend/src/metabase-enterprise/metabot/metabot.unit.spec.tsx+++ b/enterprise/frontend/src/metabase-enterprise/metabot/metabot.unit.spec.tsx@@ -57,7 +57,7 @@ jest.mock("metabase/lib/download", () => ({}));const mockAgentEndpoint = (params: MockStreamedEndpointParams) =>- mockStreamedEndpoint("/api/ee/metabot-v3/v2/agent-streaming", params);+ mockStreamedEndpoint("/api/ee/metabot-v3/agent-streaming", params);function setup(options: {@@ -365,7 +365,7 @@ describe("metabot-streaming", () => {it("should not show retry option for error messages", async () => {setup();- fetchMock.post(`path:/api/ee/metabot-v3/v2/agent-streaming`, 500);+ fetchMock.post(`path:/api/ee/metabot-v3/agent-streaming`, 500);await enterChatMessage("Who is your favorite?");@@ -680,7 +680,7 @@ describe("metabot-streaming", () => {describe("errors", () => {it("should handle service error response", async () => {setup();- fetchMock.post(`path:/api/ee/metabot-v3/v2/agent-streaming`, 500);+ fetchMock.post(`path:/api/ee/metabot-v3/agent-streaming`, 500);await enterChatMessage("Who is your favorite?");@@ -693,7 +693,7 @@ describe("metabot-streaming", () => {it("should handle non-successful responses", async () => {setup();- fetchMock.post(`path:/api/ee/metabot-v3/v2/agent-streaming`, 400);+ fetchMock.post(`path:/api/ee/metabot-v3/agent-streaming`, 400);await enterChatMessage("Who is your favorite?");@@ -736,7 +736,7 @@ describe("metabot-streaming", () => {it("should remove previous error messages and prompt when submiting next prompt", async () => {setup();- fetchMock.post(`path:/api/ee/metabot-v3/v2/agent-streaming`, 500);+ fetchMock.post(`path:/api/ee/metabot-v3/agent-streaming`, 500);await enterChatMessage("Who is your favorite?");diff --git a/enterprise/frontend/src/metabase-enterprise/metabot/state/actions.ts b/enterprise/frontend/src/metabase-enterprise/metabot/state/actions.tsindex 878fba6ac43..ac48a81b624 100644--- a/enterprise/frontend/src/metabase-enterprise/metabot/state/actions.ts+++ b/enterprise/frontend/src/metabase-enterprise/metabot/state/actions.ts@@ -187,7 +187,7 @@ export const sendAgentRequest = createAsyncThunk<const response = await aiStreamingQuery({- url: "/api/ee/metabot-v3/v2/agent-streaming",+ url: "/api/ee/metabot-v3/agent-streaming",// NOTE: StructuredDatasetQuery as part of the EntityInfo in MetabotChatContext// is upsetting the types, casting for nowbody: body as JSONValue,@@ -235,7 +235,7 @@ export const sendAgentRequest = createAsyncThunk<export const cancelInflightAgentRequests = createAsyncThunk("metabase-enterprise/metabot/cancelInflightAgentRequests",(_args) => {- getInflightRequestsForUrl("/api/ee/metabot-v3/v2/agent-streaming").forEach(+ getInflightRequestsForUrl("/api/ee/metabot-v3/agent-streaming").forEach((req) => req.abortController.abort(),);},