链载Ai

标题: 企业级 AI Agent 实战: Coze Studio 部署 智能体应用 [打印本页]

作者: 链载Ai    时间: 3 小时前
标题: 企业级 AI Agent 实战: Coze Studio 部署 智能体应用

最近字节跳动把他们的 AI Agent 开发平台 Coze 开源,并取名 Coze Studio(https://github.com/coze-dev/coze-studio),开源协议直接是 Apache-2.0,极大地丰富企业级 AI Agent 开发的生态系统,为中小企业 AI 应用落地和私有化部署提供了强有力的支撑。

今天主要介绍一下企业级 AI Agent 实战: Coze Studio 部署 + 智能体应用

01 Coze Studio 简介

Github 上该项目的 Starred 和 Fork 数还在不断地高速增长。

Coze Studio 是一站式 AI Agent 开发工具。提供 AI Agent 开发所需的全部核心技术:Prompt、RAG、Plugin、Workflow,使得开发者可以聚焦创造 AI 核心价值。

通过 Coze Studio 提供的可视化设计与编排工具,开发者可以通过零代码或低代码的方式,快速打造和调试智能体、应用和工作流,实现强大的 AI 应用开发和更多定制化业务逻辑,是构建低代码 AI 产品的理想选择。

Coze Studio 定位为"一站式 AI Agent 开发工具“

  1. 全栈解决方案:提供从开发、调试到部署的完整工具链;
  2. 低代码/零代码:极大地降低 AI 应用开发门槛;
  3. 企业级架构:基于微服务架构并遵循领域驱动设计(DDD)原则构建;
  4. 生产就绪:源自于上万家企业、数百万开发者的「扣子开发平台」。

Coze Studio 的功能清单:

02 使用 Docker Compose 部署 Coze Studio

为方便起见,本文在优云智算平台上创建 GPU 算力实例,安装部署 Docker,然后使用 Docker Compose 部署 Coze Studio。

特别提醒:使用GPU 算力实例,方便后续部署大语言模型。如果后续不再使用,建议即时删除算力实例,防止被扣费。

进入优云智算平台,选择相应 GPU 算力,然后根据具体需求选择数据盘、实例规格、镜像等。

本文实例镜像和实例规格核心信息为:

部署好实例后,我们通过 SSH 登录到服务器。

默认用户名为 ubuntu 。

安装部署 Docker:

#添加 Docker 官方的 GPG 密钥
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

#将仓库添加到 Apt 源中
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release &&echo"${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

#安装 Docker、Docker Compose
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

#启动 Docker
sudo systemctl start docker
sudo systemctl status docker

查看 Docker 版本:

sudo docker version

修改 docker 的数据目录、镜像源:

mkdir -p /home/ubuntu/software/docker
sudo vim /etc/docker/daemon.json

修改的 daemon.json 内容如下:

{
"data-root":"/home/ubuntu/software/docker",
"registry-mirrors": [
"https://docker.1panel.live",
"https://docker.nju.edu.cn",
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://mirror.aliyuncs.com",
"https://mirror.baidubce.com",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.rainbond.cc"
]
}

重启 Docker:

sudo systemctl daemon-reload
sudo systemctl restart docker

克隆 Coze Studio 在 Github 上的项目,并配置相应的大语言模型。

本文以 DeepSeek 为例,DeepSeek 的 API Key 需要到 DeepSeek 的开发平台去创建和获取。

cd /home/ubuntu/software
git clone https://github.com/coze-dev/coze-studio.git
cd coze-studio
#复制模型配置模版
cp backend/conf/model/template/model_template_deepseek.yaml backend/conf/model/deepseek.yaml
vim backend/conf/model/deepseek.yaml

设置 meta.conn_config.api_key、meta.conn_config.model 字段,并保存文件。

id:2004
nameeepSeek-V3
icon_uri:default_icon/deepseek_v2.png
icon_url:""
description:
zh:deepseek模型简介
en:deepseekmodeldescription
default_parameters:
-name:temperature
label:
zh:生成随机性
en:Temperature
desc:
zh:'- **temperature**: 调高温度会使得模型的输出更多样性和创新性,反之,降低温度会使输出内容更加遵循指令要求但减少多样性。建议不要与“Top p”同时调整。'
en:'**Temperature**:\n\n- When you increase this value, the model outputs more diverse and innovative content; when you decrease it, the model outputs less diverse content that strictly follows the given instructions.\n- It is recommended not to adjust this value with \"Top p\" at the same time.'
type:float
min:"0"
max:"1"
default_val:
balance:"0.8"
creative:"1"
default_val:"1.0"
precise:"0.3"
precision:1
options:[]
style:
widget:slider
label:
zh:生成随机性
en:Generationdiversity
-name:max_tokens
label:
zh:最大回复长度
en:Responsemaxlength
desc:
zh:控制模型输出的Tokens长度上限。通常100Tokens约等于150个中文汉字。
en:Youcanspecifythemaximumlengthofthetokensoutputthroughthisvalue.Typically,100tokensareapproximatelyequalto150Chinesecharacters.
type:int
min:"1"
max:"4096"
default_val:
default_val:"4096"
options:[]
style:
widget:slider
label:
zh:输入及输出设置
en:Inputandoutputsettings
-name:response_format
label:
zh:输出格式
en:Responseformat
desc:
zh:'- **文本**: 使用普通文本格式回复\n- **JSON**: 将引导模型使用JSON格式输出'
en:'**Response Format**:\n\n- **Text**: Replies in plain text format\n- **Markdown**: Uses Markdown format for replies\n- **JSON**: Uses JSON format for replies'
type:int
min:""
max:""
default_val:
default_val:"0"
options:
-label:Text
value:"0"
-label:JSONObject
value:"1"
style:
widget:radio_buttons
label:
zh:输入及输出设置
en:Inputandoutputsettings
meta:
nameeepSeek-V3
protocol:deepseek
capability:
function_call:false
input_modal:
-text
input_tokens:128000
json_mode:false
max_tokens:128000
output_modal:
-text
output_tokens:16384
prefix_caching:false
reasoning:false
prefill_response:false
conn_config:
base_url:""
api_key:""
timeout:0s
model:"deepseek-chat"
temperature:0.7
frequency_penalty:0
presence_penalty:0
max_tokens:4096
top_p:1
top_k:0
stop:[]
openai:null
claude:null
ark:null
deepseek:
response_format_type:text
qwen:null
gemini:null
custom:{}
status:0

部署并启动服务:

cd /home/ubuntu/software/coze-studio/docker
cp .env.example .env
sudo docker compose --profile "*" up -d

开放外网防火墙端口:

通过浏览器访问 Coze Studio,可以先注册,然后再使用对应的账号登录。

03 创建&配置智能体

创建智能体:

选择大语言模型,并设置好人设,然后可以进行调试。

调试通过后,可以点击“发布”按钮,进行智能体的发布。

04 使用智能体

进入工作空间,在项目开发中,点击使用智能体。







欢迎光临 链载Ai (https://www.lianzai.com/) Powered by Discuz! X3.5