mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-14 08:45:12 -05:00
Compare commits
4 Commits
fix/claude
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54a3b6121e | ||
|
|
e5f267df81 | ||
|
|
4fc3c70f77 | ||
|
|
efe0cd3bf8 |
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any
|
from typing import Any, Literal
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
@@ -40,6 +40,8 @@ class ResponseType(str, Enum):
|
|||||||
OPERATION_IN_PROGRESS = "operation_in_progress"
|
OPERATION_IN_PROGRESS = "operation_in_progress"
|
||||||
# Input validation
|
# Input validation
|
||||||
INPUT_VALIDATION_ERROR = "input_validation_error"
|
INPUT_VALIDATION_ERROR = "input_validation_error"
|
||||||
|
# Agent creation steps
|
||||||
|
AGENT_CREATION_STEPS = "agent_creation_steps"
|
||||||
|
|
||||||
|
|
||||||
# Base response model
|
# Base response model
|
||||||
@@ -286,6 +288,21 @@ class ClarificationNeededResponse(ToolResponseBase):
|
|||||||
questions: list[ClarifyingQuestion] = Field(default_factory=list)
|
questions: list[ClarifyingQuestion] = Field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
|
class AgentCreationStep(BaseModel):
|
||||||
|
"""A single step in the agent creation process."""
|
||||||
|
|
||||||
|
title: str
|
||||||
|
description: str
|
||||||
|
status: Literal["pending", "in_progress", "completed"] = "pending"
|
||||||
|
|
||||||
|
|
||||||
|
class AgentCreationStepsResponse(ToolResponseBase):
|
||||||
|
"""Response showing the steps for agent creation as a checklist."""
|
||||||
|
|
||||||
|
type: ResponseType = ResponseType.AGENT_CREATION_STEPS
|
||||||
|
steps: list[AgentCreationStep] = Field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
# Documentation search models
|
# Documentation search models
|
||||||
class DocSearchResult(BaseModel):
|
class DocSearchResult(BaseModel):
|
||||||
"""A single documentation search result."""
|
"""A single documentation search result."""
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ import {
|
|||||||
} from "../../components/ToolAccordion/AccordionContent";
|
} from "../../components/ToolAccordion/AccordionContent";
|
||||||
import { ToolAccordion } from "../../components/ToolAccordion/ToolAccordion";
|
import { ToolAccordion } from "../../components/ToolAccordion/ToolAccordion";
|
||||||
import { useAsymptoticProgress } from "../../hooks/useAsymptoticProgress";
|
import { useAsymptoticProgress } from "../../hooks/useAsymptoticProgress";
|
||||||
|
import {
|
||||||
|
AgentCreationChecklistCard,
|
||||||
|
AgentCreationChecklistStep,
|
||||||
|
} from "./components/AgentCreationChecklistCard";
|
||||||
import {
|
import {
|
||||||
ClarificationQuestionsCard,
|
ClarificationQuestionsCard,
|
||||||
ClarifyingQuestion,
|
ClarifyingQuestion,
|
||||||
@@ -153,6 +157,9 @@ export function CreateAgentTool({ part }: Props) {
|
|||||||
<ToolAccordion {...getAccordionMeta(output)}>
|
<ToolAccordion {...getAccordionMeta(output)}>
|
||||||
{isOperating && (
|
{isOperating && (
|
||||||
<ContentGrid>
|
<ContentGrid>
|
||||||
|
<AgentCreationChecklistCard
|
||||||
|
steps={getAgentCreationSteps(progress)}
|
||||||
|
/>
|
||||||
<ProgressBar value={progress} className="max-w-[280px]" />
|
<ProgressBar value={progress} className="max-w-[280px]" />
|
||||||
<ContentHint>
|
<ContentHint>
|
||||||
This could take a few minutes, grab a coffee ☕
|
This could take a few minutes, grab a coffee ☕
|
||||||
@@ -233,3 +240,32 @@ export function CreateAgentTool({ part }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAgentCreationSteps(progress: number): AgentCreationChecklistStep[] {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
title: "Analyzing your request",
|
||||||
|
description:
|
||||||
|
"Understanding your requirements and breaking down the goal into actionable steps",
|
||||||
|
status: progress > 10 ? "completed" : "pending",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Searching for relevant blocks",
|
||||||
|
description:
|
||||||
|
"Finding the best building blocks to accomplish your agent's tasks",
|
||||||
|
status: progress > 30 ? "completed" : "pending",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Designing the workflow",
|
||||||
|
description:
|
||||||
|
"Creating the agent structure and connecting blocks together",
|
||||||
|
status: progress > 60 ? "completed" : "pending",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Validating and optimizing",
|
||||||
|
description:
|
||||||
|
"Ensuring the agent works correctly and optimizing the workflow",
|
||||||
|
status: progress > 85 ? "completed" : "pending",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import { CheckCircleIcon, CircleIcon } from "@phosphor-icons/react";
|
||||||
|
|
||||||
|
export interface AgentCreationChecklistStep {
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
status: "pending" | "in_progress" | "completed";
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
steps: AgentCreationChecklistStep[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AgentCreationChecklistCard({ steps }: Props) {
|
||||||
|
return (
|
||||||
|
<div className="space-y-3">
|
||||||
|
<p className="text-sm text-muted-foreground">
|
||||||
|
Creating your custom agent...
|
||||||
|
</p>
|
||||||
|
<div className="space-y-2">
|
||||||
|
{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
|
||||||
|
size={20}
|
||||||
|
weight="fill"
|
||||||
|
className="text-green-500"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CircleIcon
|
||||||
|
size={20}
|
||||||
|
weight="regular"
|
||||||
|
className="text-neutral-400"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="flex-1 space-y-1">
|
||||||
|
<div
|
||||||
|
className={`text-sm font-medium ${
|
||||||
|
step.status === "completed"
|
||||||
|
? "text-neutral-900 dark:text-neutral-100"
|
||||||
|
: "text-muted-foreground"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{step.title}
|
||||||
|
</div>
|
||||||
|
<div className="text-xs text-muted-foreground">
|
||||||
|
{step.description}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user