最近有看到這個項目的介紹, 來玩玩看好了
個人習慣是先看官方的github頁面
https://github.com/microsoft/magentic-ui/tree/main
Before installing, please read the pre-requisites carefully. Magentic-UI requires Docker to run, and if you are on Windows, you will need WSL2. We recommend using uv for a quicker installation. If you are using Mac or Linux, you can skip the WSL2 step.
這邊有說他需要Docker 才能run起來, 所以記得先安裝 Docker(如果你還沒有安裝的話)
python3 -m venv .venv
source .venv/bin/activate
pip install magentic-ui
# export OPENAI_API_KEY=<YOUR API KEY>
magentic ui --port 8081
安裝步驟不難, 因為是使用他事先編譯好的套件 magentic-ui ,
建議一定要用虛擬環境, 不然這個環境安裝好了, 結果其他的環境就衝突了
在windows 下, export 要改成 set , 不然就是要使用Powershell, 因為 export 是unix的語法..
當執行到 magentic ui --port 8081 的時候, 果然就報錯了

只需要先打開docker ,
然後再執行一遍 magentic ui --port 8081

他就可以繼續執行下去, 經過一段時間, 他終於更新完畢


就可以看到這個畫面
最近剛好在研究米餅, 就輸入 我想要知道米餅的需要使用的米種

他就會先列出他要做的步驟.. 然後你就可以針對他做的步驟看看有沒有需要修改, 有需要修改就直接在step 裡面去修改, 改好後按下 accept plan 他就會開始執行

其實他的ai 也是用openai 的model, 預設應該是 gpt-4O , 好處是他會把步驟先列出來, 然後妳可以去檢視他的步驟, 這點應該是跟其他的ai工具比較不一樣的地方
如果想要換其他的model , 右上角有個齒輪的符號, 按下去就會跳出設定的畫面
點選左邊下面的Model Configuration , 然後按下右邊中間的 Select LLM for Clients
就可以更換模型

也可以用 import YAML的方式
官方給了下面兩個例子
# config.yaml
######################################
# Default OpenAI model configuration #
######################################
model_config: &client
provider: autogen_ext.models.openai.OpenAIChatCompletionClient
config:
model: gpt-4o
api_key: <YOUR API KEY>
max_retries: 10
##########################
# Clients for each agent #
##########################
orchestrator_client: *client
coder_client: *client
web_surfer_client: *client
file_surfer_client: *client
action_guard_client: *client
把它存檔成 config.yaml , 記得要把 api_key 填上去
然後再執行 magentic ui , 帶上參數 --config path/to/config.yaml
這邊path/to/config.yaml 是指config.yaml 存放的路徑和檔名
magentic ui --config path/to/config.yaml