+
-
- {!loading ? (
-
+ {loading ? (
+
) : (
-
-
-
+
)}
-
+
diff --git a/python/packages/autogen-studio/frontend/src/components/views/playground/chat/messagelist.tsx b/python/packages/autogen-studio/frontend/src/components/views/playground/chat/messagelist.tsx
index 613f96fd2289..d25a508e7bef 100644
--- a/python/packages/autogen-studio/frontend/src/components/views/playground/chat/messagelist.tsx
+++ b/python/packages/autogen-studio/frontend/src/components/views/playground/chat/messagelist.tsx
@@ -14,9 +14,12 @@ import {
Loader2,
CheckCircle,
AlertTriangle,
+ TriangleAlertIcon,
+ GroupIcon,
} from "lucide-react";
import AgentFlow from "./agentflow/agentflow";
import ThreadView from "./threadview";
+import LoadingDots from "../../shared/atoms";
interface MessageListProps {
messages: Message[];
@@ -26,6 +29,7 @@ interface MessageListProps {
>;
onRetry: (content: string) => void;
onCancel: (runId: string) => void;
+ onInputResponse: (runId: string, response: string) => void;
loading?: boolean;
teamConfig?: TeamConfig;
}
@@ -41,6 +45,7 @@ export const MessageList: React.FC
= ({
setThreadMessages,
onRetry,
onCancel,
+ onInputResponse, // New prop
loading = false,
teamConfig,
}) => {
@@ -75,7 +80,7 @@ export const MessageList: React.FC = ({
}
}
});
- }, [threadMessages]); // This will trigger when any thread messages update
+ }, [threadMessages]);
const toggleThread = (runId: string) => {
setThreadMessages((prev) => ({
@@ -107,21 +112,43 @@ export const MessageList: React.FC = ({
size={20}
className="inline-block mr-1 text-accent animate-spin"
/>{" "}
- Processing ...
+ Processing{" "}
+
+
+ );
+ case "awaiting_input": // New status
+ return (
+
+ {" "}
+ Waiting for your input
);
-
case "complete":
return (
-
+
+ {" "}
+ Task completed
+
);
case "error":
return (
-
+
+
{" "}
+ An error occurred.
+
);
case "cancelled":
return (
-
+
+ {" "}
+ Task was cancelled.
+
);
default:
return null;
@@ -135,26 +162,51 @@ export const MessageList: React.FC
= ({
const thread = threadMessages[botMessage.run_id];
const hasThread = thread && thread.messages.length > 0;
const isStreaming = thread?.status === "streaming";
+ const isAwaitingInput = thread?.status === "awaiting_input"; // New check
+
+ const isFirstMessage = pairIndex === 0;
return (
- {/* User message - first */}
+ {/* User message */}
+ {
+
+ {/*
Task Run 1.
*/}
+
+ Run {pairIndex + 1}
+ {!isFirstMessage && (
+ <>
+ {" "}
+ |{" "}
+ {" "}
+ Note: Each run does not share data with previous runs in
+ the same session yet.{" "}
+ >
+ )}
+
+
+ }
-
- {/* Team response - second */}
+
+ {/* Team response */}
-
+
Agent Team
@@ -162,18 +214,18 @@ export const MessageList: React.FC = ({
{/* Main response container */}
-
-
+
+
{getStatusIcon(thread?.status)}{" "}
- {thread?.finalResult?.content}
+ {!isAwaitingInput && thread?.finalResult?.content}
- {/* Thread section with left border for hierarchy */}
+ {/* Thread section */}
{hasThread && (
-
+
);
+
+export const LoadingDots = ({ size = 8 }) => {
+ return (
+
+
+
+
+
+ );
+};
+
+export default LoadingDots;
diff --git a/python/packages/autogen-studio/frontend/src/components/views/shared/session/api.ts b/python/packages/autogen-studio/frontend/src/components/views/shared/session/api.ts
index 65ce38c2e0b5..cccd6ad61a76 100644
--- a/python/packages/autogen-studio/frontend/src/components/views/shared/session/api.ts
+++ b/python/packages/autogen-studio/frontend/src/components/views/shared/session/api.ts
@@ -14,7 +14,7 @@ export class SessionAPI {
async listSessions(userId: string): Promise
{
const response = await fetch(
- `${this.getBaseUrl()}/sessions?user_id=${userId}`,
+ `${this.getBaseUrl()}/sessions/?user_id=${userId}`,
{
headers: this.getHeaders(),
}
@@ -47,7 +47,7 @@ export class SessionAPI {
user_id: userId, // Ensure user_id is included
};
- const response = await fetch(`${this.getBaseUrl()}/sessions`, {
+ const response = await fetch(`${this.getBaseUrl()}/sessions/`, {
method: "POST",
headers: this.getHeaders(),
body: JSON.stringify(session),
diff --git a/python/packages/autogen-studio/frontend/src/components/views/shared/session/manager.tsx b/python/packages/autogen-studio/frontend/src/components/views/shared/session/manager.tsx
index 4f36680c4a3f..e2f0a9ce7d0e 100644
--- a/python/packages/autogen-studio/frontend/src/components/views/shared/session/manager.tsx
+++ b/python/packages/autogen-studio/frontend/src/components/views/shared/session/manager.tsx
@@ -149,12 +149,12 @@ export const SessionManager: React.FC = () => {
icon={}
>
New Session{" "}
- {sessions.length === 0 && (
-
+ {/* {sessions.length === 0 && (
+
- )}
+ )} */}
diff --git a/python/packages/autogen-studio/frontend/src/components/views/shared/team/api.ts b/python/packages/autogen-studio/frontend/src/components/views/shared/team/api.ts
index f2a4a6b0f262..8d13aa6a488f 100644
--- a/python/packages/autogen-studio/frontend/src/components/views/shared/team/api.ts
+++ b/python/packages/autogen-studio/frontend/src/components/views/shared/team/api.ts
@@ -14,7 +14,7 @@ export class TeamAPI {
async listTeams(userId: string): Promise
{
const response = await fetch(
- `${this.getBaseUrl()}/teams?user_id=${userId}`,
+ `${this.getBaseUrl()}/teams/?user_id=${userId}`,
{
headers: this.getHeaders(),
}
@@ -42,7 +42,7 @@ export class TeamAPI {
user_id: userId,
};
- const response = await fetch(`${this.getBaseUrl()}/teams`, {
+ const response = await fetch(`${this.getBaseUrl()}/teams/`, {
method: "POST",
headers: this.getHeaders(),
body: JSON.stringify(team),
diff --git a/python/packages/autogen-studio/frontend/src/components/views/shared/team/editor.tsx b/python/packages/autogen-studio/frontend/src/components/views/shared/team/editor.tsx
index 36c1e41f5d1b..a1fc87836eab 100644
--- a/python/packages/autogen-studio/frontend/src/components/views/shared/team/editor.tsx
+++ b/python/packages/autogen-studio/frontend/src/components/views/shared/team/editor.tsx
@@ -7,9 +7,39 @@ import type { Team, TeamConfig } from "../../../types/datamodel";
import { MonacoEditor } from "../monaco";
const defaultTeamConfig: TeamConfig = {
- name: "",
- participants: [],
+ version: "1.0.0",
+ component_type: "team",
+ name: "weather_team",
+ participants: [
+ {
+ component_type: "agent",
+ name: "writing_agent",
+ agent_type: "AssistantAgent",
+ system_message:
+ "You are a helpful assistant. Solve tasks carefully. When done respond with TERMINATE",
+ model_client: {
+ component_type: "model",
+ model: "gpt-4o-2024-08-06",
+ model_type: "OpenAIChatCompletionClient",
+ },
+ tools: [
+ {
+ component_type: "tool",
+ name: "get_weather",
+ description: "Get the weather for a city",
+ content:
+ 'async def get_weather(city: str) -> str:\n return f"The weather in {city} is 73 degrees and Sunny."',
+ tool_type: "PythonFunction",
+ },
+ ],
+ },
+ ],
team_type: "RoundRobinGroupChat",
+ termination_condition: {
+ component_type: "termination",
+ termination_type: "MaxMessageTermination",
+ max_messages: 10,
+ },
};
type FieldType = {
@@ -122,48 +152,57 @@ export const TeamEditor: React.FC = ({
width={800}
forceRender
>
-