feat: support image inputs in assistant tests
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
type BatchToolCallRecord,
|
||||
type BatchTurnResult,
|
||||
} from "@/data/batch-run";
|
||||
import { testAssetsApi } from "@/lib/api";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type BatchCaseDetailDrawerProps = {
|
||||
@@ -98,7 +99,7 @@ export function BatchCaseDetailDrawer({
|
||||
<section className="rounded-2xl border border-hairline bg-canvas-soft px-4 py-3.5">
|
||||
<p className="text-xs font-medium text-foreground">执行契约</p>
|
||||
<p className="mt-1 text-xs leading-5 text-muted-soft">
|
||||
正在执行固定文字脚本;完成后将展示每一轮回复、工具调用和全部评估标准。
|
||||
正在执行固定多模态脚本;完成后将展示每轮回复、工具调用和评估标准。
|
||||
</p>
|
||||
</section>
|
||||
<ExecutionTimeline status={item.status} />
|
||||
@@ -235,9 +236,19 @@ function TurnResultCard({ turn }: { turn: BatchTurnResult }) {
|
||||
</p>
|
||||
<div className="mt-2 grid gap-2 text-xs leading-5 sm:grid-cols-[72px_minmax(0,1fr)]">
|
||||
<span className="text-muted-soft">用户输入</span>
|
||||
<p className="whitespace-pre-wrap text-muted-foreground">
|
||||
{turn.userInput}
|
||||
</p>
|
||||
<div className="space-y-2 text-muted-foreground">
|
||||
{turn.image ? (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
src={testAssetsApi.contentUrl(turn.image.assetId)}
|
||||
alt={turn.image.filename}
|
||||
className="max-h-48 w-full max-w-xs rounded-xl object-cover"
|
||||
/>
|
||||
) : null}
|
||||
{turn.userInput ? (
|
||||
<p className="whitespace-pre-wrap">{turn.userInput}</p>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="text-muted-soft">Agent 回复</span>
|
||||
<p className="whitespace-pre-wrap text-muted-foreground">
|
||||
{turn.assistantReply}
|
||||
|
||||
Reference in New Issue
Block a user