diff --git a/agenta-web/src/components/Playground/Views/ParametersView.tsx b/agenta-web/src/components/Playground/Views/ParametersView.tsx index ee77c85ac2..397dbeeaf7 100644 --- a/agenta-web/src/components/Playground/Views/ParametersView.tsx +++ b/agenta-web/src/components/Playground/Views/ParametersView.tsx @@ -1,7 +1,7 @@ import {Environment, IPromptRevisions, Parameter, Variant} from "@/lib/Types" import type {CollapseProps} from "antd" import {Button, Col, Collapse, Row, Space, Tooltip, message} from "antd" -import React, {useContext, useEffect, useState} from "react" +import React, {useEffect, useState} from "react" import {createUseStyles} from "react-jss" import {ModelParameters, ObjectParameters, StringParameters} from "./ParametersCards" import PublishVariantModal from "./PublishVariantModal" diff --git a/agenta-web/src/components/Playground/Views/TestView.tsx b/agenta-web/src/components/Playground/Views/TestView.tsx index dc3e13e5bd..0667fbedde 100644 --- a/agenta-web/src/components/Playground/Views/TestView.tsx +++ b/agenta-web/src/components/Playground/Views/TestView.tsx @@ -2,14 +2,7 @@ import React, {useContext, useEffect, useRef, useState} from "react" import {Button, Input, Card, Row, Col, Space, Form, Modal} from "antd" import {CaretRightOutlined, CloseCircleOutlined, PlusOutlined} from "@ant-design/icons" import {callVariant, promptRevision} from "@/lib/services/api" -import { - ChatMessage, - ChatRole, - GenericObject, - IPromptVersioning, - Parameter, - Variant, -} from "@/lib/Types" +import {ChatMessage, ChatRole, GenericObject, Parameter, Variant} from "@/lib/Types" import {batchExecute, randString, removeKeys} from "@/lib/helpers/utils" import LoadTestsModal from "../LoadTestsModal" import AddToTestSetDrawer from "../AddToTestSetDrawer/AddToTestSetDrawer" @@ -29,7 +22,6 @@ import dayjs from "dayjs" import relativeTime from "dayjs/plugin/relativeTime" import duration from "dayjs/plugin/duration" import {useQueryParam} from "@/hooks/useQuery" -import {dynamicComponent} from "@/lib/helpers/dynamic" dayjs.extend(relativeTime) dayjs.extend(duration) diff --git a/agenta-web/src/lib/Types.ts b/agenta-web/src/lib/Types.ts index dc853a7534..42a0ef4c8a 100644 --- a/agenta-web/src/lib/Types.ts +++ b/agenta-web/src/lib/Types.ts @@ -169,12 +169,6 @@ export interface Parameter { maximum?: number } -export interface DeploymentRevisionConfig { - config_name: string - current_version: number - parameters: Record -} - export interface IPromptRevisions { config: { config_name: string @@ -185,29 +179,6 @@ export interface IPromptRevisions { revision: number } -export interface IEnvironmentRevision { - revision: number - modified_by: string - created_at: string -} - -export interface IPromptVersioning { - app_id: string - app_name: string - base_id: string - base_name: string - config_name: string - organization_id: string - parameters: Record - previous_variant_name: string | null - revision: number - revisions: [IPromptRevisions] - uri: string - user_id: string - variant_id: string - variant_name: string -} - export interface EvaluationResponseType { id: string variant_ids: string[] @@ -312,17 +283,6 @@ export interface Environment { revision: string | null } -export interface DeploymentRevisions extends Environment { - revisions: { - created_at: string - deployed_app_variant_revision: string - deployment: string - id: string - modified_by: string - revision: number - }[] -} - export interface CustomEvaluation { id: string app_name: string diff --git a/agenta-web/src/lib/hooks/useVariant.ts b/agenta-web/src/lib/hooks/useVariant.ts index 62dd5d0c7b..b05e4f164f 100644 --- a/agenta-web/src/lib/hooks/useVariant.ts +++ b/agenta-web/src/lib/hooks/useVariant.ts @@ -1,8 +1,7 @@ import {useState, useEffect} from "react" -import {promptVersioning, saveNewVariant, updateVariantParams} from "@/lib/services/api" -import {Variant, Parameter, IPromptRevisions} from "@/lib/Types" +import {saveNewVariant, updateVariantParams} from "@/lib/services/api" +import {Variant, Parameter} from "@/lib/Types" import {getAllVariantParameters, updateInputParams} from "@/lib/helpers/variantHelper" -import {isDemo} from "../helpers/utils" import {PERMISSION_ERR_MSG} from "../helpers/axiosConfig" /** diff --git a/agenta-web/src/lib/services/api.ts b/agenta-web/src/lib/services/api.ts index cdba47bf3c..6da01e0cbf 100644 --- a/agenta-web/src/lib/services/api.ts +++ b/agenta-web/src/lib/services/api.ts @@ -12,7 +12,6 @@ import { AppTemplate, GenericObject, Environment, - DeploymentRevisionConfig, CreateCustomEvaluation, ExecuteCustomEvalCode, AICritiqueCreate, @@ -669,46 +668,6 @@ export const fetchEnvironments = async (appId: string): Promise = return data } -export const fetchDeploymentRevisionConfig = async ( - deploymentRevisionId: string, -): Promise => { - const response = await fetch( - `${getAgentaApiUrl()}/api/configs/deployment/${deploymentRevisionId}/`, - ) - - if (response.status !== 200) { - throw new Error("Failed to fetch deployment revision configuration") - } - - const data = (await response.json()) as DeploymentRevisionConfig - return data -} - -export const fetchDeploymentRevisions = async ( - appId: string, - environmentName: string, - ignoreAxiosError: boolean = false, -) => { - const {data} = await axios.get( - `${getAgentaApiUrl()}/api/apps/${appId}/revisions/${environmentName}/`, - { - _ignoreError: ignoreAxiosError, - } as any, - ) - return data -} - -export const revertDeploymentRevision = async ( - deploymentRevisionId: string, - ignoreAxiosError: boolean = false, -) => { - const response = await axios.post( - `${getAgentaApiUrl()}/api/configs/deployment/${deploymentRevisionId}/revert/`, - {_ignoreError: ignoreAxiosError} as any, - ) - return response -} - export const publishVariant = async (variantId: string, environmentName: string) => { await axios.post(`${getAgentaApiUrl()}/api/environments/deploy/`, { environment_name: environmentName,