Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "api"
version = "0.59.1"
version = "0.59.2"
description = "Agenta API"
authors = [
{ name = "Mahmoud Mabrouk", email = "[email protected]" },
Expand Down
8 changes: 6 additions & 2 deletions sdk/agenta/client/backend/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def __init__(
_defaulted_timeout = (
timeout
if timeout is not None
else 60 if httpx_client is None else httpx_client.timeout.read
else 60
if httpx_client is None
else httpx_client.timeout.read
)
self._client_wrapper = SyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
Expand Down Expand Up @@ -652,7 +654,9 @@ def __init__(
_defaulted_timeout = (
timeout
if timeout is not None
else 60 if httpx_client is None else httpx_client.timeout.read
else 60
if httpx_client is None
else httpx_client.timeout.read
)
self._client_wrapper = AsyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
Expand Down
2 changes: 1 addition & 1 deletion sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta"
version = "0.59.1"
version = "0.59.2"
description = "The SDK for agenta is an open-source LLMOps platform."
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion web/ee/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agenta/ee",
"version": "0.59.1",
"version": "0.59.2",
"private": true,
"engines": {
"node": ">=18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {memo} from "react"

import {useRouter} from "next/router"

import EvalRunOverviewViewerSkeleton from "../../components/EvalRunOverviewViewer/assets/EvalRunOverviewViewerSkeleton"
import EvalRunHeaderSkeleton from "../components/EvalRunHeader/assets/EvalRunHeaderSkeleton"
import EvalRunOverviewViewerSkeleton from "../components/EvalRunOverviewViewer/assets/EvalRunOverviewViewerSkeleton"
import EvalRunPromptConfigViewerSkeleton from "../components/EvalRunPromptConfigViewer/assets/EvalRunPromptConfigViewerSkeleton"
import EvalRunTestCaseViewerSkeleton from "../components/EvalRunTestCaseViewer/assets/EvalRunTestCaseViewerSkeleton"

Expand All @@ -19,7 +19,7 @@ const AutoEvalRunSkeleton = () => {
) : viewType === "prompt" ? (
<EvalRunPromptConfigViewerSkeleton />
) : (
<EvalRunOverviewViewerSkeleton />
<EvalRunOverviewViewerSkeleton className="px-6" />
)}
</section>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import dynamic from "next/dynamic"
import EvalNameTag from "@/oss/components/EvalRunDetails/AutoEvalRun/assets/EvalNameTag"
import {EVAL_TAG_COLOR} from "@/oss/components/EvalRunDetails/AutoEvalRun/assets/utils"
import {useRunId} from "@/oss/contexts/RunIdContext"
import {
evalAtomStore,
evaluationRunStateFamily,
} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms"
import {evaluationRunStateFamily} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms"
import {useInvocationResult} from "@/oss/lib/hooks/useInvocationResult"

const GenerationResultUtils = dynamic(
Expand All @@ -35,8 +32,7 @@ const RunTraceHeader = ({
showComparisons?: boolean
}) => {
const baseRunId = useRunId()
const store = evalAtomStore()
const state = useAtomValue(evaluationRunStateFamily(rId), {store})
const state = useAtomValue(evaluationRunStateFamily(rId))
const enriched = state?.enrichedRun
const {trace: runTrace} = useInvocationResult({
scenarioId: scId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ const failureRunTypes = [EvaluationStatus.FAILED, EvaluationStatus.FAILURE, Eval
const EMPTY_COMPARISON_RUN_IDS: string[] = []

const FocusDrawerContent = () => {
const appState = useAppState()
const store = evalAtomStore()
const router = useRouter()
const appState = useAppState()

const [windowHight, setWindowHight] = useState(0)
const [activeKeys, setActiveKeys] = useState<(string | number)[]>([
Expand Down Expand Up @@ -92,7 +91,7 @@ const FocusDrawerContent = () => {
() => comparisonRunsStepsAtom(comparisonRunIds),
[comparisonRunIds],
)
const comparisonRunsSteps = useAtomValue(comparisonRunsStepsAtomInstance, {store})
const comparisonRunsSteps = useAtomValue(comparisonRunsStepsAtomInstance)
// // Derive whether to show comparison mode
const showComparisons = useMemo(
() => Boolean(isBaseRun && comparisonRunIds.length > 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,13 @@ const EvalRunScoreTable = ({className}: {className?: string}) => {
{"h-[calc(100%-60px)]": !isComparison},
])}
>
<div className={clsx(["overflow-y-auto", {"w-[50%]": !isComparison}])}>
<div
className={clsx([
"overflow-y-auto",
{"w-[50%]": !isComparison},
{"w-full": chartMetrics.length < 3},
])}
>
<Table
dataSource={dataSource}
columns={useMemo(() => {
Expand Down Expand Up @@ -484,24 +490,26 @@ const EvalRunScoreTable = ({className}: {className?: string}) => {
rowKey={(r) => r.key}
/>
</div>
<EvaluatorMetricsSpiderChart
className={clsx([
"min-h-[400px] h-[400px]",
{"w-[50%] !h-full": !isComparison},
])}
metrics={chartMetrics}
series={useMemo(() => {
return allRunIds.map((id, idx) => {
const state = evalById[id]
const compareIdx = state?.compareIndex || idx + 1
return {
key: idx === 0 ? "value" : `value-${idx + 1}`,
color: (EVAL_COLOR as any)[compareIdx] || "#3B82F6",
name: state?.enrichedRun?.name || `Eval ${compareIdx}`,
}
})
}, [allRunIds, evalById])}
/>
{chartMetrics.length < 3 ? null : (
<EvaluatorMetricsSpiderChart
className={clsx([
"min-h-[400px] h-[400px]",
{"w-[50%] !h-full": !isComparison},
])}
metrics={chartMetrics}
series={useMemo(() => {
return allRunIds.map((id, idx) => {
const state = evalById[id]
const compareIdx = state?.compareIndex || idx + 1
return {
key: idx === 0 ? "value" : `value-${idx + 1}`,
color: (EVAL_COLOR as any)[compareIdx] || "#3B82F6",
name: state?.enrichedRun?.name || `Eval ${compareIdx}`,
}
})
}, [allRunIds, evalById])}
/>
)}
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ const EvaluatorMetricsChart = ({
}
return []
}, [metric, isBooleanMetric, hasDistribution, isNumeric])
console.log("chartData", chartData)

const showHistogram = !isCompare || selectedItem === "histogram"
const showAverageBars = isCompare && selectedItem === "average"

const formatYAxisTick = useCallback(
(value: number) => {
Expand Down
2 changes: 1 addition & 1 deletion web/ee/src/components/EvalRunDetails/AutoEvalRun/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import AutoEvalRunSkeleton from "./assets/AutoEvalRunSkeleton"
import {AutoEvalRunDetailsProps} from "./assets/types"
import EvalRunHeader from "./components/EvalRunHeader"

const EvalRunOverviewViewer = dynamic(() => import("./components/EvalRunOverviewViewer"), {
const EvalRunOverviewViewer = dynamic(() => import("../components/EvalRunOverviewViewer"), {
ssr: false,
})
const EvalRunPromptConfigViewer = dynamic(() => import("./components/EvalRunPromptConfigViewer"), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Button} from "antd"
import {useAtomValue} from "jotai"

import {AnnotationDto} from "@/oss/lib/hooks/useAnnotations/types"
import {evalAtomStore} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms"
import {scenarioUiFlagsFamily} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms/progress"
import {getProjectValues} from "@/oss/state/project"

Expand All @@ -27,8 +26,7 @@ const AnnotateScenarioButton = ({
className,
}: AnnotateScenarioButtonProps) => {
const [annotating, setAnnotating] = useState(false)
const store = evalAtomStore()
const uiFlags = useAtomValue(scenarioUiFlagsFamily({scenarioId, runId}), {store})
const uiFlags = useAtomValue(scenarioUiFlagsFamily({scenarioId, runId}))
const isLoading = annotating || uiFlags.isAnnotating || uiFlags.isRevalidating

const onAnnotate = useCallback(async () => {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {memo, useCallback, useMemo} from "react"

import deepEqual from "fast-deep-equal"
import {useAtomValue} from "jotai"
import {selectAtom} from "jotai/utils"

import {evaluationEvaluatorsFamily} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms"

import EvaluatorMetricsCard from "./EvaluatorMetricsCard"
import {memo} from "react"
import EvalRunOverviewViewer from "../../../components/EvalRunOverviewViewer"

/**
* Displays run-level evaluation results grouped by evaluator.
Expand All @@ -15,23 +8,9 @@ import EvaluatorMetricsCard from "./EvaluatorMetricsCard"
* are handled inside each card.
*/
const EvalResultsView = ({runId}: {runId: string}) => {
const slugSelector = useCallback(
(list: any[] | undefined): string[] =>
(list || []).map((ev) => ev.slug || ev.id || ev.name),
[],
)

const slugsAtom = useMemo(
() => selectAtom(evaluationEvaluatorsFamily(runId), slugSelector, deepEqual),
[runId],
)
const evaluatorSlugs = useAtomValue(slugsAtom)

return (
<section className="flex flex-wrap gap-2 overflow-y-auto p-1">
{evaluatorSlugs.map((slug) => (
<EvaluatorMetricsCard key={slug} runId={runId} evaluatorSlug={slug} />
))}
<section className="overflow-y-auto flex flex-col gap-4">
<EvalRunOverviewViewer />
</section>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {memo, useCallback, useState} from "react"

import RunButton from "@agenta/oss/src/components/Playground/assets/RunButton"
import {useAtomValue} from "jotai"
import {getDefaultStore, useAtomValue} from "jotai"
import {loadable} from "jotai/utils"

// agenta hooks & utils
Expand All @@ -11,7 +11,6 @@ import {useEvalScenarioQueue} from "@/oss/lib/hooks/useEvalScenarioQueue"
import {
scenarioStepFamily,
scenariosFamily,
evalAtomStore,
} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms"
import {scenarioMetricsMapFamily} from "@/oss/lib/hooks/useEvaluationRunData/assets/atoms/runScopedMetrics"

Expand All @@ -35,19 +34,18 @@ const EMPTY_ROWS: any[] = []
const EvalRunBatchActions = ({name}: {name: string}) => {
const [rows, setRows] = useState<any[]>(EMPTY_ROWS)
const runId = useRunId()
const store = evalAtomStore()

const {enqueueScenario} = useEvalScenarioQueue({concurrency: 5, runId})

// Lightweight subscription: only track the count of runnable scenarios - use global store
const hasRunnable = useAtomValue(hasRunnableScenarioFamily(runId), {store})
const hasRunnable = useAtomValue(hasRunnableScenarioFamily(runId))
const isRunAllDisabled = !hasRunnable

const handleRunAll = useCallback(async () => {
if (!runId) return

try {
const store = evalAtomStore()
const store = getDefaultStore()

// Get all scenarios for this run (same as single run approach)
const scenarios = store.get(scenariosFamily(runId))
Expand Down Expand Up @@ -132,7 +130,7 @@ const EvalRunBatchActions = ({name}: {name: string}) => {
if (!runId) return []

// 1. Gather the scenario IDs present in the current evaluation (sync)
const store = evalAtomStore()
const store = getDefaultStore()
const scenarios = store.get(scenariosFamily(runId))
const ids = scenarios.map((s: any) => s.id)

Expand Down
Loading