第一个autogen与docker项目

前提条件:在windows上安装docker

代码如下:

python 复制代码
import os
import autogen
from autogen import AssistantAgent, UserProxyAgent

llm_config = {
    "config_list": [
        {
            "model": "GLM-4-Plus",
            "api_key": "your api key",
            "base_url": "https://open.bigmodel.cn/api/paas/v4/",
        }
    ]
}

with autogen.coding.DockerCommandLineCodeExecutor(work_dir="coding") as code_executor:
    assistant = AssistantAgent("assistant", llm_config=llm_config)
    user_proxy = UserProxyAgent(
        "user_proxy", code_execution_config={"executor": code_executor}
    )

    # Start the chat
    user_proxy.initiate_chat(
        assistant,
        message="1 plus 1 equals what?",
    )

运行结果:

查看安装的镜像:

bash 复制代码
docker images

希望这些内容对你有所帮助!如果有任何问题,欢迎在评论区留言。

相关推荐
伊布拉西莫6 天前
[autogen]AgentChat-Advanced翻译与实践
autogen
伊布拉西莫7 天前
[autogen]AgentChat-Tutorial翻译与实践
autogen
Wise玩转AI11 天前
AI智能体开发实战AutoGen篇(四)——会干活的导诊 Agent(Planner + Tools 实战)
人工智能·python·microsoft·ai智能体·autogen
Wise玩转AI14 天前
医院智能体系统实战:基于 autogen 0.7 + DeepSeek 的多阶段工程落地(一)项目总览
人工智能·chatgpt·ai智能体·autogen
七夜zippoe22 天前
基于AutoGen搭建数据分析智能体:自动处理Excel并生成可视化报告
数据分析·autogen·多智能体系统·excel自动化·可视化报告
摘星编程5 个月前
微软AutoGen:多智能体协作的工业级解决方案
autogen·多智能体系统·工业级ai解决方案·人工智能协作·微软ai技术
满怀10157 个月前
【AutoGen革命】多智能体协作系统的架构设计与工程实践
autogen·多智能体系统·ai工程化·llm应用开发·微软ai
坐吃山猪9 个月前
AutoGen多角色、多用户、多智能体对话系统
python·autogen·chainlit·deepseek
杭州刘同学9 个月前
autogen studio如何修改数据库为mysql
mysql·autogen
梦丶晓羽10 个月前
微软AutoGen高级功能——Memory
人工智能·python·microsoft·autogen