diff --git a/agenta-backend/agenta_backend/models/api/api_models.py b/agenta-backend/agenta_backend/models/api/api_models.py index 787638d26..c9d2444f2 100644 --- a/agenta-backend/agenta_backend/models/api/api_models.py +++ b/agenta-backend/agenta_backend/models/api/api_models.py @@ -107,6 +107,9 @@ class AppVariantResponse(BaseModel): config_name: str uri: Optional[str] revision: int + created_at: Optional[str] = None + updated_at: Optional[str] = None + modified_by_id: Optional[str] = None class AppVariantRevision(BaseModel): diff --git a/agenta-backend/agenta_backend/models/api/user_models.py b/agenta-backend/agenta_backend/models/api/user_models.py index 10c4573e9..1959587f2 100644 --- a/agenta-backend/agenta_backend/models/api/user_models.py +++ b/agenta-backend/agenta_backend/models/api/user_models.py @@ -12,8 +12,9 @@ class TimestampModel(BaseModel): class User(TimestampModel): id: Optional[str] = None uid: str - username: str email: str + username: str + profile_picture: Optional[str] = None organizations: Optional[List[str]] = None diff --git a/agenta-backend/agenta_backend/models/converters.py b/agenta-backend/agenta_backend/models/converters.py index 72a0d174d..826e91890 100644 --- a/agenta-backend/agenta_backend/models/converters.py +++ b/agenta-backend/agenta_backend/models/converters.py @@ -331,6 +331,9 @@ async def app_variant_db_to_output(app_variant_db: AppVariantDB) -> AppVariantRe config_name=app_variant_db.config_name, # type: ignore uri=uri, revision=app_variant_db.revision, # type: ignore + created_at=str(app_variant_db.updated_at), + updated_at=str(app_variant_db.created_at), + modified_by_id=str(app_variant_db.modified_by_id), ) if isCloudEE(): diff --git a/agenta-backend/agenta_backend/routers/user_profile.py b/agenta-backend/agenta_backend/routers/user_profile.py index 6b787a6fd..a546af829 100644 --- a/agenta-backend/agenta_backend/routers/user_profile.py +++ b/agenta-backend/agenta_backend/routers/user_profile.py @@ -1,5 +1,7 @@ -import os +from typing import Optional + from fastapi import HTTPException, Request + from agenta_backend.services import db_manager from agenta_backend.utils.common import APIRouter from agenta_backend.models.api.user_models import User @@ -7,20 +9,25 @@ router = APIRouter() -@router.get("/", operation_id="user_profile") -async def user_profile( - request: Request, -): +@router.get("/", operation_id="fetch_user_profile") +async def user_profile(request: Request, user_id: Optional[str] = None): try: - user = await db_manager.get_user(request.state.user_id) + if user_id is not None: + user = await db_manager.get_user_with_id(user_id=user_id) + else: + user = await db_manager.get_user(request.state.user_id) + + assert ( + user is not None + ), "User not found. Please ensure that the user_id is specified correctly." return User( id=str(user.id), uid=str(user.uid), - username=str(user.username), email=str(user.email), + username=str(user.username), created_at=str(user.created_at), updated_at=str(user.updated_at), - ).dict(exclude_unset=True) + ).model_dump(exclude_unset=True) except Exception as e: raise HTTPException(status_code=500, detail=str(e)) diff --git a/agenta-backend/agenta_backend/services/db_manager.py b/agenta-backend/agenta_backend/services/db_manager.py index 714aa92c6..054949655 100644 --- a/agenta-backend/agenta_backend/services/db_manager.py +++ b/agenta-backend/agenta_backend/services/db_manager.py @@ -209,7 +209,8 @@ async def fetch_app_variant_by_id( assert app_variant_id is not None, "app_variant_id cannot be None" async with db_engine.get_session() as session: base_query = select(AppVariantDB).options( - joinedload(AppVariantDB.base), joinedload(AppVariantDB.app) + joinedload(AppVariantDB.base), + joinedload(AppVariantDB.app), ) if isCloudEE(): query = base_query.options( @@ -852,7 +853,7 @@ async def get_user_with_id(user_id: str): user = result.scalars().first() if user is None: logger.error("Failed to get user with id") - raise Exception("Error while getting user") + raise NoResultFound(f"User with id {user_id} not found") return user @@ -1145,7 +1146,10 @@ async def list_app_variants(app_id: str): async with db_engine.get_session() as session: result = await session.execute( select(AppVariantDB) - .options(joinedload(AppVariantDB.app), joinedload(AppVariantDB.base)) + .options( + joinedload(AppVariantDB.app), + joinedload(AppVariantDB.base), + ) .filter_by(app_id=uuid.UUID(app_uuid)) ) app_variants = result.scalars().all() @@ -1842,7 +1846,10 @@ async def get_app_variant_instance_by_id(variant_id: str) -> AppVariantDB: async with db_engine.get_session() as session: result = await session.execute( select(AppVariantDB) - .options(joinedload(AppVariantDB.base), joinedload(AppVariantDB.app)) + .options( + joinedload(AppVariantDB.base), + joinedload(AppVariantDB.app), + ) .filter_by(id=uuid.UUID(variant_id)) ) app_variant_db = result.scalars().first() diff --git a/agenta-backend/agenta_backend/tests/variants_user_profile_router/test_user_profile.py b/agenta-backend/agenta_backend/tests/variants_user_profile_router/test_user_profile.py index 14a14e7ca..1fd8a4aec 100644 --- a/agenta-backend/agenta_backend/tests/variants_user_profile_router/test_user_profile.py +++ b/agenta-backend/agenta_backend/tests/variants_user_profile_router/test_user_profile.py @@ -1,4 +1,5 @@ import os +from uuid import uuid4 import httpx import pytest @@ -22,7 +23,7 @@ @pytest.mark.asyncio -async def test_user_profile(): +async def test_fetch_user_profile_without_user_id(): async with db_engine.get_session() as session: result = await session.execute(select(UserDB).filter_by(uid="0")) user_db = result.scalars().first() @@ -36,7 +37,7 @@ async def test_user_profile(): email=str(user_db.email), created_at=str(user_db.created_at), updated_at=str(user_db.updated_at), - ).dict(exclude_unset=True) + ).model_dump(exclude_unset=True) response = await test_client.get(f"{BACKEND_API_HOST}/profile/") @@ -45,3 +46,40 @@ async def test_user_profile(): assert response.json()["uid"] == user_db_dict["uid"] assert response.json()["email"] == user_db_dict["email"] assert response.json()["username"] == user_db_dict["username"] + + +async def test_fetch_user_profile_with_valid_user_id(): + async with db_engine.get_session() as session: + result = await session.execute(select(UserDB).filter_by(uid="0")) + user_db = result.scalars().first() + if not user_db: + assert False + + user_db_dict = User( + id=str(user_db.id), + uid=str(user_db.uid), + username=str(user_db.username), + email=str(user_db.email), + created_at=str(user_db.created_at), + updated_at=str(user_db.updated_at), + ).model_dump(exclude_unset=True) + + response = await test_client.get( + f"{BACKEND_API_HOST}/profile/?user_id={str(user_db.id)}" + ) + + assert response.status_code == 200 + assert response.json()["id"] == user_db_dict["id"] + assert response.json()["uid"] == user_db_dict["uid"] + assert response.json()["email"] == user_db_dict["email"] + assert response.json()["username"] == user_db_dict["username"] + + +async def test_fetch_user_profile_with_non_existent_user_id_error(): + user_non_existent_id = str(uuid4()) + response = await test_client.get( + f"{BACKEND_API_HOST}/profile/?user_id={user_non_existent_id}" + ) + + assert response.status_code == 500 + assert response.json()["detail"] == f"User with id {user_non_existent_id} not found" diff --git a/agenta-cli/agenta/client/backend/types/app_variant_response.py b/agenta-cli/agenta/client/backend/types/app_variant_response.py index 9ce97e20c..7f74bd0b1 100644 --- a/agenta-cli/agenta/client/backend/types/app_variant_response.py +++ b/agenta-cli/agenta/client/backend/types/app_variant_response.py @@ -26,6 +26,9 @@ class AppVariantResponse(pydantic.BaseModel): revision: int organization_id: typing.Optional[str] workspace_id: typing.Optional[str] + created_at: typing.Optional[dt.datetime] = None + updated_at: typing.Optional[dt.datetime] = None + modified_by_id: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/agenta-web/cypress.config.ts b/agenta-web/cypress.config.ts index cd7aba93f..df6fb8c6c 100644 --- a/agenta-web/cypress.config.ts +++ b/agenta-web/cypress.config.ts @@ -9,8 +9,12 @@ export default defineConfig({ screenshotOnRunFailure: false, e2e: { baseUrl: "http://localhost:3000", - defaultCommandTimeout: 30000, - requestTimeout: 10000, + defaultCommandTimeout: 120000, + requestTimeout: 120000, + pageLoadTimeout: 120000, + responseTimeout: 120000, + taskTimeout: 120000, + execTimeout: 120000, setupNodeEvents(on) { on("task", { log(message) { diff --git a/agenta-web/cypress/e2e/eval.comparison.cy.ts b/agenta-web/cypress/e2e/eval.comparison.cy.ts index 5e972bc2e..cf97725ac 100644 --- a/agenta-web/cypress/e2e/eval.comparison.cy.ts +++ b/agenta-web/cypress/e2e/eval.comparison.cy.ts @@ -8,7 +8,6 @@ describe("Evaluation Comparison Test", function () { cy.get("@app_id").then((appId) => { app_id = appId }) - cy.get('[data-cy="playground-save-changes-button"]').eq(0).click() }) context("When creating an app variant", () => { diff --git a/agenta-web/cypress/e2e/eval.evaluations.cy.ts b/agenta-web/cypress/e2e/eval.evaluations.cy.ts index 2192e9a7e..248a4e477 100644 --- a/agenta-web/cypress/e2e/eval.evaluations.cy.ts +++ b/agenta-web/cypress/e2e/eval.evaluations.cy.ts @@ -5,7 +5,6 @@ describe("Evaluations CRUD Operations Test", function () { cy.get("@app_id").then((appId) => { app_id = appId }) - cy.get('[data-cy="playground-save-changes-button"]').eq(0).click() }) context("Executing Evaluations CRUD operations", () => { diff --git a/agenta-web/cypress/e2e/eval.scenarios.cy.ts b/agenta-web/cypress/e2e/eval.scenarios.cy.ts index 9419dd2c6..51d9bf371 100644 --- a/agenta-web/cypress/e2e/eval.scenarios.cy.ts +++ b/agenta-web/cypress/e2e/eval.scenarios.cy.ts @@ -5,7 +5,6 @@ describe("Evaluation Scenarios Test", function () { cy.get("@app_id").then((appId) => { app_id = appId }) - cy.get('[data-cy="playground-save-changes-button"]').eq(0).click() }) context("Executing Evaluation Scenarios Workflow", () => { diff --git a/agenta-web/cypress/e2e/playground.cy.ts b/agenta-web/cypress/e2e/playground.cy.ts index 871b2d2b6..55617d1bb 100644 --- a/agenta-web/cypress/e2e/playground.cy.ts +++ b/agenta-web/cypress/e2e/playground.cy.ts @@ -1,9 +1,15 @@ describe("Playground Prompt Test", function () { + let app_id before(() => { cy.createVariant() + cy.get("@app_id").then((appId) => { + app_id = appId + }) }) - it("Should test prompt functionality in the Playground", () => { + cy.visit(`/apps/${app_id}/playground`) + cy.url().should("include", "/playground") + cy.contains(/modify parameters/i) cy.get('[data-cy^="testview-input-parameters"]').eq(0).type("Germany") cy.get('[data-cy="testview-input-parameters-run-button"]').click() cy.intercept("POST", "**/demo/app/generate", { diff --git a/agenta-web/cypress/support/commands/evaluations.ts b/agenta-web/cypress/support/commands/evaluations.ts index 71be863e6..78215ed34 100644 --- a/agenta-web/cypress/support/commands/evaluations.ts +++ b/agenta-web/cypress/support/commands/evaluations.ts @@ -28,7 +28,7 @@ Cypress.Commands.add("createVariant", () => { } }) - cy.contains("Single Prompt") + cy.contains("Single Prompt OpenAI") .parentsUntil('[data-cy^="app-template-card"]') .last() .contains("create app", {matchCase: false}) @@ -51,7 +51,6 @@ Cypress.Commands.add("createVariant", () => { cy.wrap(app_id).as("app_id") }) - cy.contains(/modify parameters/i) cy.removeLlmProviderKey() }) diff --git a/agenta-web/package-lock.json b/agenta-web/package-lock.json index 8cb43ffaa..dcc069473 100644 --- a/agenta-web/package-lock.json +++ b/agenta-web/package-lock.json @@ -20,6 +20,7 @@ "@mdx-js/react": "^2.3.0", "@monaco-editor/react": "^4.5.2", "@next/mdx": "^13.4.13", + "@phosphor-icons/react": "^2.1.7", "@remixicon/react": "^4.1.1", "@sentry/nextjs": "^8.18.0", "@tailwindcss/forms": "^0.5.7", @@ -1924,6 +1925,19 @@ "@opentelemetry/api": "^1.1.0" } }, + "node_modules/@phosphor-icons/react": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@phosphor-icons/react/-/react-2.1.7.tgz", + "integrity": "sha512-g2e2eVAn1XG2a+LI09QU3IORLhnFNAFkNbo2iwbX6NOKSLOwvEMmTa7CgOzEbgNWR47z8i8kwjdvYZ5fkGx1mQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": ">= 16.8", + "react-dom": ">= 16.8" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", diff --git a/agenta-web/package.json b/agenta-web/package.json index 065d91f07..7d571f9c6 100644 --- a/agenta-web/package.json +++ b/agenta-web/package.json @@ -31,6 +31,7 @@ "@mdx-js/react": "^2.3.0", "@monaco-editor/react": "^4.5.2", "@next/mdx": "^13.4.13", + "@phosphor-icons/react": "^2.1.7", "@remixicon/react": "^4.1.1", "@sentry/nextjs": "^8.18.0", "@tailwindcss/forms": "^0.5.7", diff --git a/agenta-web/public/assets/slack.png b/agenta-web/public/assets/slack.png deleted file mode 100644 index 9ded7efaa..000000000 Binary files a/agenta-web/public/assets/slack.png and /dev/null differ diff --git a/agenta-web/src/components/AppSelector/AppCard.tsx b/agenta-web/src/components/AppSelector/AppCard.tsx index 23ece4e7a..bab8dc9e7 100644 --- a/agenta-web/src/components/AppSelector/AppCard.tsx +++ b/agenta-web/src/components/AppSelector/AppCard.tsx @@ -1,76 +1,54 @@ -import {Modal, Card, Avatar} from "antd" -import {DeleteOutlined} from "@ant-design/icons" +import {Card, Dropdown, Button, Typography, Tag} from "antd" +import {MoreOutlined} from "@ant-design/icons" import {deleteApp} from "@/services/app-selector/api" import {useState} from "react" -import Link from "next/link" import {renameVariablesCapitalizeAll} from "@/lib/helpers/utils" import {createUseStyles} from "react-jss" -import {ListAppsItem} from "@/lib/Types" +import {JSSTheme, ListAppsItem} from "@/lib/Types" import {useAppsData} from "@/contexts/app.context" +import {Note, PencilLine, Trash} from "@phosphor-icons/react" +import {useRouter} from "next/router" +import {formatDay} from "@/lib/helpers/dateTimeHelper" +import DeleteAppModal from "./modals/DeleteAppModal" -const useStyles = createUseStyles({ +const {Text} = Typography + +const useStyles = createUseStyles((theme: JSSTheme) => ({ card: { width: 300, - height: 120, display: "flex", flexDirection: "column", - justifyContent: "space-between", - overflow: "hidden", - boxShadow: "0px 4px 8px rgba(0, 0, 0, 0.1)", - "& svg": { - color: "#ef4146", + transition: "all 0.025s ease-in", + cursor: "pointer", + "& > .ant-card-head": { + minHeight: 0, + padding: theme.paddingSM, + + "& .ant-card-head-title": { + fontSize: theme.fontSizeLG, + fontWeight: theme.fontWeightMedium, + }, }, - "& .ant-card-meta": { - height: "110%", - display: "flex", - alignItems: "center", - justifyContent: "center", + "& > .ant-card-body": { + padding: theme.paddingSM, }, - "& .ant-card-meta-title div": { - textAlign: "center", + "&:hover": { + boxShadow: theme.boxShadow, }, }, - cardCover: { - "z-index": 1, - position: "absolute", - top: 0, - right: 0, - left: 0, - background: "transparent", - margin: "auto", - width: "300px", - height: "70px", + app_card_link: { display: "flex", - overflow: "hidden", - "flex-direction": "column", - "justify-content": "space-between", - }, - cardLink: { - padding: "24px", + flexDirection: "column", + gap: "8px", + "& > div": { + display: "flex", + alignItems: "center", + justifyContent: "space-between", + textDecoration: "none", + color: theme.colorText, + }, }, -}) - -const DeleteModal: React.FC<{ - open: boolean - handleOk: () => Promise - handleCancel: () => void - appName: string - confirmLoading: boolean -}> = ({open, handleOk, handleCancel, appName, confirmLoading}) => { - return ( - -

Are you sure you want to delete {appName}?

-
- ) -} +})) const AppCard: React.FC<{ app: ListAppsItem @@ -78,10 +56,7 @@ const AppCard: React.FC<{ const [visibleDelete, setVisibleDelete] = useState(false) const [confirmLoading, setConfirmLoading] = useState(false) const {mutate} = useAppsData() - - const showDeleteModal = () => { - setVisibleDelete(true) - } + const router = useRouter() const handleDeleteOk = async () => { setConfirmLoading(true) @@ -107,27 +82,70 @@ const AppCard: React.FC<{ <> ]} + title={renameVariablesCapitalizeAll(app.app_name)} + onClick={() => router.push(`/apps/${app.app_id}/overview`)} + extra={ + , + onClick: (e: any) => { + e.domEvent.stopPropagation() + router.push(`/apps/${app.app_id}/overview`) + }, + }, + {type: "divider"}, + // { + // key: "rename_app", + // label: "Rename", + // icon: , + // onClick: (e: any) => { + // e.domEvent.stopPropagation() + // }, + // }, + { + key: "delete_app", + label: "Delete", + icon: , + danger: true, + onClick: (e: any) => { + e.domEvent.stopPropagation() + setVisibleDelete(true) + }, + }, + ], + }} + > + +
{Array.isArray(apps) && ( <> - { - if ( - isDemo() && - selectedOrg?.is_paying == false && - apps.length > 2 - ) { - showMaxAppError() - } else { - showCreateAppModal() - } - }} - > - Create new app
} - avatar={} - /> -
- {apps.map((app, index: number) => (
@@ -330,7 +322,7 @@ const AppSelector: React.FC = () => {
- + ) : ( + +const DeleteAppModal = ({appName, confirmLoading, ...props}: DeleteAppModalProps) => { + return ( + +

Are you sure you want to delete {appName}?

+
+ ) +} + +export default DeleteAppModal diff --git a/agenta-web/src/components/DeleteEvaluationModal/DeleteEvaluationModal.tsx b/agenta-web/src/components/DeleteEvaluationModal/DeleteEvaluationModal.tsx new file mode 100644 index 000000000..88eb09811 --- /dev/null +++ b/agenta-web/src/components/DeleteEvaluationModal/DeleteEvaluationModal.tsx @@ -0,0 +1,60 @@ +import {_Evaluation, JSSTheme} from "@/lib/Types" +import {DeleteOutlined} from "@ant-design/icons" +import {Modal, Typography} from "antd" +import React from "react" +import {createUseStyles} from "react-jss" + +type DeleteAutoEvalModalProps = { + evaluationType: string +} & React.ComponentProps + +const useStyles = createUseStyles((theme: JSSTheme) => ({ + container: { + "& h1": { + fontSize: theme.fontSizeLG, + lineHeight: theme.lineHeightLG, + fontWeight: theme.fontWeightStrong, + marginBottom: theme.paddingXS, + }, + }, + delText: { + color: theme.colorPrimary, + fontSize: theme.fontSizeLG, + fontWeight: theme.fontWeightMedium, + lineHeight: theme.lineHeightLG, + textTransform: "capitalize", + }, +})) +const DeleteEvaluationModal = ({evaluationType, ...props}: DeleteAutoEvalModalProps) => { + const classes = useStyles() + + return ( + , type: "primary"}} + centered + zIndex={2000} + > +
+ Are you sure you want to delete? + +
+ + A deleted {evaluationType} cannot be restored. + + +
+ You are about to delete: + + {evaluationType} + +
+
+
+
+ ) +} + +export default DeleteEvaluationModal diff --git a/agenta-web/src/components/Evaluations/AutomaticEvaluationResult.tsx b/agenta-web/src/components/Evaluations/AutomaticEvaluationResult.tsx index 564e32f04..2b6ef8ef5 100644 --- a/agenta-web/src/components/Evaluations/AutomaticEvaluationResult.tsx +++ b/agenta-web/src/components/Evaluations/AutomaticEvaluationResult.tsx @@ -7,40 +7,18 @@ import {Button, Spin, Statistic, Table, Typography} from "antd" import {useRouter} from "next/router" import {useEffect, useState} from "react" import {ColumnsType} from "antd/es/table" -import {Evaluation, GenericObject, StyleProps} from "@/lib/Types" +import {Evaluation, SingleModelEvaluationListTableDataType, StyleProps} from "@/lib/Types" import {DeleteOutlined} from "@ant-design/icons" import {EvaluationFlow, EvaluationType} from "@/lib/enums" import {createUseStyles} from "react-jss" import {useAppTheme} from "../Layout/ThemeContextProvider" import {calculateResultsDataAvg} from "@/lib/helpers/evaluate" -import {fromEvaluationResponseToEvaluation} from "@/lib/transformers" +import { + fromEvaluationResponseToEvaluation, + singleModelTestEvaluationTransformer, +} from "@/lib/transformers" import {variantNameWithRev} from "@/lib/helpers/variantHelper" -interface EvaluationListTableDataType { - key: string - variants: string[] - testset: { - _id: string - name: string - } - evaluationType: string - status: EvaluationFlow - scoresData: { - nb_of_rows: number - wrong?: GenericObject[] - correct?: GenericObject[] - true?: GenericObject[] - false?: GenericObject[] - variant: string[] - } - avgScore: number - custom_code_eval_id: string - resultsData: {[key: string]: number} - createdAt: string - revisions: string[] - variant_revision_ids: string[] -} - const useStyles = createUseStyles({ container: { marginBottom: 20, @@ -85,7 +63,9 @@ export default function AutomaticEvaluationResult({ setIsEvalModalOpen, }: AutomaticEvaluationResultProps) { const router = useRouter() - const [evaluationsList, setEvaluationsList] = useState([]) + const [evaluationsList, setEvaluationsList] = useState< + SingleModelEvaluationListTableDataType[] + >([]) const [selectedRowKeys, setSelectedRowKeys] = useState([]) const [selectionType] = useState<"checkbox" | "radio">("checkbox") const {appTheme} = useAppTheme() @@ -108,20 +88,7 @@ export default function AutomaticEvaluationResult({ const newEvals = results.map((result, ix) => { const item = evals[ix] if ([EvaluationType.single_model_test].includes(item.evaluationType)) { - return { - key: item.id, - createdAt: item.createdAt, - variants: item.variants, - scoresData: result.scores_data, - evaluationType: item.evaluationType, - status: item.status, - testset: item.testset, - custom_code_eval_id: item.evaluationTypeSettings.customCodeEvaluationId, - resultsData: result.results_data, - avgScore: result.avg_score, - revisions: item.revisions, - variant_revision_ids: item.variant_revision_ids, - } + return singleModelTestEvaluationTransformer({item, result}) } }) @@ -159,12 +126,12 @@ export default function AutomaticEvaluationResult({ } } - const columns: ColumnsType = [ + const columns: ColumnsType = [ { title: "Variant", dataIndex: "variants", key: "variants", - render: (value, record: EvaluationListTableDataType) => { + render: (value, record: SingleModelEvaluationListTableDataType) => { return (
handleNavigation(value[0].variantName, record.revisions[0])} @@ -184,7 +151,7 @@ export default function AutomaticEvaluationResult({ title: "Test set", dataIndex: "testsetName", key: "testsetName", - render: (value: any, record: EvaluationListTableDataType, index: number) => { + render: (value: any, record: SingleModelEvaluationListTableDataType, index: number) => { return {record.testset.name} }, }, @@ -192,7 +159,7 @@ export default function AutomaticEvaluationResult({ title: "Average score", dataIndex: "averageScore", key: "averageScore", - render: (value: any, record: EvaluationListTableDataType, index: number) => { + render: (value: any, record: SingleModelEvaluationListTableDataType, index: number) => { let score = 0 if (record.scoresData) { score = @@ -237,7 +204,7 @@ export default function AutomaticEvaluationResult({ title: "Action", dataIndex: "action", key: "action", - render: (value: any, record: EvaluationListTableDataType, index: number) => { + render: (value: any, record: SingleModelEvaluationListTableDataType, index: number) => { let actionText = "View evaluation" if (record.status !== EvaluationFlow.EVALUATION_FINISHED) { actionText = "Continue evaluation" @@ -258,7 +225,10 @@ export default function AutomaticEvaluationResult({ ] const rowSelection = { - onChange: (selectedRowKeys: React.Key[], selectedRows: EvaluationListTableDataType[]) => { + onChange: ( + selectedRowKeys: React.Key[], + selectedRows: SingleModelEvaluationListTableDataType[], + ) => { setSelectedRowKeys(selectedRowKeys) }, } @@ -274,8 +244,8 @@ export default function AutomaticEvaluationResult({ ) setSelectedRowKeys([]) - } catch { - } finally { + } catch (error) { + console.error(error) } } diff --git a/agenta-web/src/components/Evaluations/EvaluationCardView/EvaluationVotePanel.tsx b/agenta-web/src/components/Evaluations/EvaluationCardView/EvaluationVotePanel.tsx index 1ec319ac2..25576a347 100644 --- a/agenta-web/src/components/Evaluations/EvaluationCardView/EvaluationVotePanel.tsx +++ b/agenta-web/src/components/Evaluations/EvaluationCardView/EvaluationVotePanel.tsx @@ -95,7 +95,16 @@ const ComparisonVote: React.FC = ({ {variants.map((variant, ix) => ( - + agenta v{packageJsonData.version}
- - - {children} - {contextHolder} - - + + + + {children} + {contextHolder} + + +