Skip to content

Commit

Permalink
Improves editing UI for tools in AGS (#5539)
Browse files Browse the repository at this point in the history
<!-- Thank you for your contribution! Please review
https://microsoft.github.io/autogen/docs/Contribute before opening a
pull request. -->

<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->
<img width="1560" alt="image"
src="https://github.com/user-attachments/assets/da3d781f-2572-4bd7-802d-1d3900f6c6d9"
/>

## Why are these changes needed?

Improves  editing UI for tools in AGS
- add remove tools 
- add/remove imports 
- show source code section of FunctionTool in  in code editor

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

## Checks

- [ ] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [ ] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [ ] I've made sure all auto checks have passed.
  • Loading branch information
victordibia authored Feb 18, 2025
1 parent 9a10427 commit e02db84
Show file tree
Hide file tree
Showing 12 changed files with 1,088 additions and 545 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,20 @@ export type AgentMessageConfig =
| ToolCallMessageConfig
| ToolCallResultMessageConfig;

// Tool Configs
export interface FromModuleImport {
module: string;
imports: string[];
}

// Import can be either a string (direct import) or a FromModuleImport
export type Import = string | FromModuleImport;

// The complete FunctionToolConfig interface
export interface FunctionToolConfig {
source_code: string;
name: string;
description: string;
global_imports: any[]; // Sequence[Import] equivalent
global_imports: Import[];
has_cancellation_support: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ const PROVIDERS = {

// Models
OPENAI: "autogen_ext.models.openai.OpenAIChatCompletionClient",
AZURE_OPENAI:
"autogen_ext.models.azure_openai.AzureOpenAIChatCompletionClient",
AZURE_OPENAI: "autogen_ext.models.openai.AzureOpenAIChatCompletionClient",

// Tools
FUNCTION_TOOL: "autogen_core.tools.FunctionTool",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
//team/builder/builder.tsx
import React, {
useCallback,
useContext,
useEffect,
useRef,
useState,
} from "react";
import React, { useCallback, useEffect, useRef, useState } from "react";
import {
DndContext,
useSensor,
Expand All @@ -26,7 +20,7 @@ import {
MiniMap,
} from "@xyflow/react";
import "@xyflow/react/dist/style.css";
import { Button, Layout, message, Modal, Switch, Tooltip } from "antd";
import { Button, Layout, message, Switch, Tooltip } from "antd";
import {
Cable,
CheckCircle,
Expand All @@ -39,7 +33,7 @@ import {
} from "lucide-react";
import { useTeamBuilderStore } from "./store";
import { ComponentLibrary } from "./library";
import { ComponentTypes, Team, Session } from "../../../types/datamodel";
import { ComponentTypes, Team } from "../../../types/datamodel";
import { CustomNode, CustomEdge, DragItem } from "./types";
import { edgeTypes, nodeTypes } from "./nodes";

Expand All @@ -49,11 +43,8 @@ import TeamBuilderToolbar from "./toolbar";
import { MonacoEditor } from "../../monaco";
import { NodeEditor } from "./node-editor/node-editor";
import debounce from "lodash.debounce";
import { appContext } from "../../../../hooks/provider";
import { sessionAPI } from "../../playground/api";
import TestDrawer from "./testdrawer";
import { teamAPI, validationAPI, ValidationResponse } from "../api";
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
import { validationAPI, ValidationResponse } from "../api";
import { ValidationErrors } from "./validationerrors";

const { Sider, Content } = Layout;
Expand Down
Loading

0 comments on commit e02db84

Please sign in to comment.