第一个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

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

相关推荐
张彦峰ZYF16 天前
多智能体(Multi-Agent)系统在人工智能中的应用与发展
人工智能·autogen·metagpt·multi-agent·agentscope·camel ai·agentverse
シ風箏20 天前
AutoGen【部署 02】Linux环境安装部署AutoGenStudio并调用本地 qwen2.5:0.5b 大模型举例
linux·autogen·本地大模型·autogenstudio
七夜zippoe1 个月前
AutoGen数据分析智能体实战:让Excel自动说话
人工智能·数据分析·excel·智能体·autogen
伊布拉西莫2 个月前
[autogen]AgentChat-Advanced翻译与实践
autogen
伊布拉西莫2 个月前
[autogen]AgentChat-Tutorial翻译与实践
autogen
Wise玩转AI2 个月前
AI智能体开发实战AutoGen篇(四)——会干活的导诊 Agent(Planner + Tools 实战)
人工智能·python·microsoft·ai智能体·autogen
Wise玩转AI2 个月前
医院智能体系统实战:基于 autogen 0.7 + DeepSeek 的多阶段工程落地(一)项目总览
人工智能·chatgpt·ai智能体·autogen
七夜zippoe2 个月前
基于AutoGen搭建数据分析智能体:自动处理Excel并生成可视化报告
数据分析·autogen·多智能体系统·excel自动化·可视化报告
摘星编程6 个月前
微软AutoGen:多智能体协作的工业级解决方案
autogen·多智能体系统·工业级ai解决方案·人工智能协作·微软ai技术
满怀10159 个月前
【AutoGen革命】多智能体协作系统的架构设计与工程实践
autogen·多智能体系统·ai工程化·llm应用开发·微软ai