Fix confidence score in task actions (#458)
This commit is contained in:
@@ -187,7 +187,7 @@ export type Option = {
|
|||||||
|
|
||||||
export type ActionApiResponse = {
|
export type ActionApiResponse = {
|
||||||
reasoning: string;
|
reasoning: string;
|
||||||
confidence_float: number;
|
confidence_float?: number;
|
||||||
action_type: ActionType;
|
action_type: ActionType;
|
||||||
text: string | null;
|
text: string | null;
|
||||||
option: Option | null;
|
option: Option | null;
|
||||||
@@ -196,7 +196,7 @@ export type ActionApiResponse = {
|
|||||||
|
|
||||||
export type Action = {
|
export type Action = {
|
||||||
reasoning: string;
|
reasoning: string;
|
||||||
confidence: number;
|
confidence?: number;
|
||||||
type: ActionType;
|
type: ActionType;
|
||||||
input: string;
|
input: string;
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
|||||||
@@ -3,6 +3,12 @@ import { Action, ActionTypes, ReadableActionTypes } from "@/api/types";
|
|||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
|
import {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
} from "@/components/ui/tooltip";
|
||||||
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
||||||
import { cn } from "@/util/utils";
|
import { cn } from "@/util/utils";
|
||||||
import {
|
import {
|
||||||
@@ -105,9 +111,20 @@ function ScrollableActionList({
|
|||||||
<div className="flex gap-2 items-center">
|
<div className="flex gap-2 items-center">
|
||||||
<span>#{index + 1}</span>
|
<span>#{index + 1}</span>
|
||||||
<Badge>{ReadableActionTypes[action.type]}</Badge>
|
<Badge>{ReadableActionTypes[action.type]}</Badge>
|
||||||
<div>{action.confidence}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className="flex items-center gap-2">
|
||||||
|
{typeof action.confidence === "number" && (
|
||||||
|
<TooltipProvider>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger>
|
||||||
|
<Badge variant="secondary">
|
||||||
|
{action.confidence}
|
||||||
|
</Badge>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>Confidence Score</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
)}
|
||||||
{action.success ? (
|
{action.success ? (
|
||||||
<CheckCircledIcon className="w-6 h-6 text-success" />
|
<CheckCircledIcon className="w-6 h-6 text-success" />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user