diff --git a/.gitignore b/.gitignore index 9cd448c7..89ff1d49 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,8 @@ docs/_build/ .scrapy profile_default/ ipython_config.py +development/.buildinfo +development/.doctrees/ # OS generated files .DS_Store diff --git a/development/_components/llm_config_tabs.html b/development/_components/llm_config_tabs.html index e6f61f56..7b5f427a 100644 --- a/development/_components/llm_config_tabs.html +++ b/development/_components/llm_config_tabs.html @@ -184,7 +184,7 @@ Release Notes @@ -248,10 +248,6 @@ - - @@ -278,22 +274,22 @@ @@ -324,7 +320,7 @@ - Agent Spec GitHub repository + Agent Spec GitHub repository @@ -339,76 +335,88 @@ @@ -445,14 +453,17 @@ @@ -469,33 +480,10 @@
-
-

Agent Spec Adapters - AutoGen#

-
-Agent Spec adapter for AutoGen -
-

↑ With the Agent Spec adapter for AutoGen, you can easily import agents from external frameworks using Agent Spec and run them with AutoGen.#

-
-
-

Microsoft AutoGen supports the development of multi-agent conversational systems, -allowing agents to communicate and collaborate to solve tasks.

-
-

Get started#

-

To get started, set up your Python environment (Python 3.10 to 3.12 required), -and then install the PyAgentSpec package with the AutoGen extension.

-
python -m venv .venv
-source .venv/bin/activate  # On Windows: .venv\Scripts\activate
-pip install "pyagentspec[autogen]"
-
-
-

You are now ready to use the adapter:

-
    -
  • Run Agent Spec configurations with AutoGen (see more details below)

  • -
  • Convert AutoGen agents to Agent Spec (see more details below)

  • -
-
-
-

Run Agent Spec configurations with AutoGen#

+
+

Run Agent Spec configurations with AutoGen#

+

This usage example showcases the creation of a simple Agent Spec Agent, subsequently serialized into JSON and converted into an AutoGen +assistant. Also includes mapping of a ServerTool and execution of the conversation.

# Create a Agent Spec agent
 from pyagentspec.agent import Agent
 from pyagentspec.llms.openaicompatibleconfig import OpenAiCompatibleConfig
@@ -550,40 +538,6 @@ 

Get started# AGENT >> The result of the subtraction is 864197532.

-
-
-

Convert AutoGen agents to Agent Spec#

-
# Create an AutoGen Agent
-import os
-os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY"
-from autogen_agentchat.agents import AssistantAgent
-from autogen_ext.models.openai import OpenAIChatCompletionClient
-
-async def add_tool(a: int, b: int) -> int:
-    """Adds a to b and returns the result"""
-    return a + b
-
-autogen_tools = {"add_tool": add_tool}
-
-model_client = OpenAIChatCompletionClient(
-    model="gpt-4.1",
-)
-
-autogen_agent = AssistantAgent(
-    name="assistant",
-    model_client=model_client,
-    tools=list(autogen_tools.values()),
-    system_message="Use tools to solve tasks, and reformulate the answers that you get.",
-    reflect_on_tool_use=True,
-)
-
-# Convert to Agent Spec
-from pyagentspec.adapters.autogen import AgentSpecExporter
-
-agentspec_config = AgentSpecExporter().to_json(autogen_agent)
-
-
-
@@ -597,26 +551,6 @@

Get started - -