mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-13 16:25:05 -05:00
fix: Address code review feedback - use step title as key and add type safety
Co-authored-by: itsababseh <36419647+itsababseh@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
@@ -293,7 +293,7 @@ class AgentCreationStep(BaseModel):
|
||||
|
||||
title: str
|
||||
description: str
|
||||
status: str = "pending" # pending, in_progress, completed
|
||||
status: Literal["pending", "in_progress", "completed"] = "pending"
|
||||
|
||||
|
||||
class AgentCreationStepsResponse(ToolResponseBase):
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CheckCircleIcon, CircleIcon } from "@phosphor-icons/react";
|
||||
export interface AgentCreationChecklistStep {
|
||||
title: string;
|
||||
description: string;
|
||||
status: "pending" | "completed";
|
||||
status: "pending" | "in_progress" | "completed";
|
||||
}
|
||||
|
||||
interface Props {
|
||||
@@ -17,8 +17,8 @@ export function AgentCreationChecklistCard({ steps }: Props) {
|
||||
Creating your custom agent...
|
||||
</p>
|
||||
<div className="space-y-2">
|
||||
{steps.map((step, index) => (
|
||||
<div key={index} className="flex items-start gap-3">
|
||||
{steps.map((step) => (
|
||||
<div key={step.title} className="flex items-start gap-3">
|
||||
<div className="mt-0.5 flex-shrink-0">
|
||||
{step.status === "completed" ? (
|
||||
<CheckCircleIcon
|
||||
|
||||
Reference in New Issue
Block a user