Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ignore:
- "**/wire.go"
- "**/wire_gen.go"
- "**/errno/**"
- "**/main.go"

parsers:
gcov:
Expand Down
19 changes: 10 additions & 9 deletions README.cn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<h1>CozeLoop 社区版</h1>
<h1>CozeLoop 开源版</h1>
<p><strong> AI Agent 开发与运维的平台级解决方案</strong></p>
<p>
<a href="#CozeLoop-能做什么">CozeLoop</a> •
Expand All @@ -20,7 +20,7 @@

[CozeLoop ](https://www.coze.cn/loop) (CozeLoop) 是一个面向开发者,专注于 AI Agent 开发与运维的平台级解决方案。 它可以解决 AI Agent 开发过程中面临的各种挑战,提供从开发、调试、评估、到监控的全生命周期管理能力。

CozeLoop 在商业化版本的基础上,推出社区版免费对开发者开放核心基础功能模块,以开源模式共享核心技术框架,开发者可根据业务需求定制与扩展,便于社区共建、分享交流,助力开发者零门槛参与 AI Agent 的探索与实践。
CozeLoop 在商业化版本的基础上,推出开源版免费对开发者开放核心基础功能模块,以开源模式共享核心技术框架,开发者可根据业务需求定制与扩展,便于社区共建、分享交流,助力开发者零门槛参与 AI Agent 的探索与实践。

## CozeLoop 能做什么?
CozeLoop 通过提供全生命周期的管理能力,帮助开发者更高效地开发和运维 AI Agent。无论是提示词工程、AI Agent 评测,还是上线后的监控与调优,CozeLoop 都提供了强大的工具和智能化的支持,极大地简化了 AI Agent 的开发流程,提升了 AI Agent 的运行效果和稳定性。
Expand All @@ -30,7 +30,7 @@ CozeLoop 通过提供全生命周期的管理能力,帮助开发者更高效
* **观测**:CozeLoop 为开发者提供了全链路执行过程的可视化观测能力,完整记录从用户输入到 AI 输出的每个处理环节,包括 Prompt 解析、模型调用和工具执行等关键节点,并自动捕获中间结果和异常状态。

## 功能清单
| **功能** | **功能点** | **商业版** | **社区版** |
| **功能** | **功能点** | **商业版** | **开源版** |
| --- | --- | --- | --- |
| Prompt 调试 | Playground 调试、对比、版本管理 | ✔️ | ✔️ |
| | Prompt 优化 | ✔️ | - |
Expand All @@ -48,19 +48,19 @@ CozeLoop 通过提供全生命周期的管理能力,帮助开发者更高效
| | 企业团队与权限 | ✔️ | - |
## 快速开始
参考[快速开始](https://github.com/coze-dev/cozeloop/wiki/2.-%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B),了解如何安装部署 CozeLoop 最新版本。
## 使用 CozeLoop 社区版
## 使用 CozeLoop 开源版

* [Prompt 开发与调试](https://loop.coze.cn/open/docs/cozeloop/create-prompt):CozeLoop 提供了完整的提示词开发流程。
* [评测](https://loop.coze.cn/open/docs/cozeloop/create-prompt):CozeLoop 的评测功能提供标准评测数据管理、自动化评估引擎和综合的实验结果统计。
* [Trace 上报与查询](https://loop.coze.cn/open/docs/cozeloop/trace-integrate):CozeLoop 支持对平台上创建的 Prompt 调试的 Trace 自动上报,实时追踪每一条 Trace 数据。
* [社区版使用CozeLoop SDK](https://github.com/coze-dev/cozeloop/wiki/8.-%E7%A4%BE%E5%8C%BA%E7%89%88%E4%BD%BF%E7%94%A8-CozeLoop-SDK):CozeLoop 三个语言的 [SDK](https://loop.coze.cn/open/docs/cozeloop/sdk) 均适用于商业版和社区版。对于社区版,开发者只需要初始化时修改部分参数配置。
* [开源版使用CozeLoop SDK](https://github.com/coze-dev/cozeloop/wiki/8.-%E5%BC%80%E6%BA%90%E7%89%88%E4%BD%BF%E7%94%A8-CozeLoop-SDK):CozeLoop 三个语言的 [SDK](https://loop.coze.cn/open/docs/cozeloop/sdk) 均适用于商业版和开源版。对于开源版,开发者只需要初始化时修改部分参数配置。

## 开发指南

* [系统架构](https://github.com/coze-dev/cozeloop/wiki/3.-%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84):了解CozeLoop 社区版的技术架构与核心组件
* [启动模式](https://github.com/coze-dev/cozeloop/wiki/4.-%E6%9C%8D%E5%8A%A1%E5%90%AF%E5%8A%A8%E6%A8%A1%E5%BC%8F):安装部署CozeLoop 社区版时,默认使用开发模式,此模式下修改后端文件无需重新部署服务。
* [模型配置](https://github.com/coze-dev/cozeloop/wiki/5.-%E6%A8%A1%E5%9E%8B%E9%85%8D%E7%BD%AE):CozeLoop 社区版通过 Eino 框架支持多种 LLM 模型,参考此文档查看支持的模型列表,了解如何配置模型。
* [代码开发与测试](https://github.com/coze-dev/cozeloop/wiki/6.-%E4%BB%A3%E7%A0%81%E5%BC%80%E5%8F%91%E4%B8%8E%E6%B5%8B%E8%AF%95):了解如何基于CozeLoop 社区版进行二次开发与测试
* [系统架构](https://github.com/coze-dev/cozeloop/wiki/3.-%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84):了解CozeLoop 开源版的技术架构与核心组件
* [启动模式](https://github.com/coze-dev/cozeloop/wiki/4.-%E6%9C%8D%E5%8A%A1%E5%90%AF%E5%8A%A8%E6%A8%A1%E5%BC%8F):安装部署CozeLoop 开源版时,默认使用开发模式,此模式下修改后端文件无需重新部署服务。
* [模型配置](https://github.com/coze-dev/cozeloop/wiki/5.-%E6%A8%A1%E5%9E%8B%E9%85%8D%E7%BD%AE):CozeLoop 开源版通过 Eino 框架支持多种 LLM 模型,参考此文档查看支持的模型列表,了解如何配置模型。
* [代码开发与测试](https://github.com/coze-dev/cozeloop/wiki/6.-%E4%BB%A3%E7%A0%81%E5%BC%80%E5%8F%91%E4%B8%8E%E6%B5%8B%E8%AF%95):了解如何基于CozeLoop 开源版进行二次开发与测试
* [故障排查](https://github.com/coze-dev/cozeloop/wiki/7.-%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5):了解如何查看容器状态、系统日志。

## License
Expand All @@ -72,6 +72,7 @@ CozeLoop 通过提供全生命周期的管理能力,帮助开发者更高效
请**不要**创建公开的 GitHub Issue。
## 加入社区
飞书移动端扫描以下二维码,加入CozeLoop 技术交流群。

![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/d67b3c814a4742a58b127ed311eb84af~tplv-goo7wpa0wc-image.image)

## 致谢
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<h1>CozeLoop Community Edition</h1>
<h1>CozeLoop Open-source Edition</h1>
<p><strong> Platform-level solution for developing and operating AI agent</strong></p>
<p>
<a href="#What-can-CozeLoop-do">CozeLoop</a> •
Expand All @@ -20,7 +20,7 @@ English | [中文](README.cn.md)

[CozeLoop ](https://www.coze.cn/loop) (CozeLoop) is a developer-oriented, platform-level solution focused on the development and operation of AI agents. It addresses various challenges faced during the AI agent development process, providing full lifecycle management capabilities from development, debugging, evaluation, to monitoring.

Based on the commercial version, CozeLoop introduces a community edition that offers developers free access to core foundational feature modules. By sharing its core technology framework in an open-source model, developers can customize and extend according to business needs, facilitating community co-construction, sharing, and exchange, helping developers participate in AI agent exploration and practice with zero barriers.
Based on the commercial version, CozeLoop introduces a open-source edition that offers developers free access to core foundational feature modules. By sharing its core technology framework in an open-source model, developers can customize and extend according to business needs, facilitating community co-construction, sharing, and exchange, helping developers participate in AI agent exploration and practice with zero barriers.

## What can CozeLoop do?
CozeLoop helps developers efficiently develop and operate AI agents by providing full-lifecycle management capabilities. Whether it's prompt engineering, AI agent evaluation, or monitoring and optimization after deployment, CozeLoop offers powerful tools and intelligent support, significantly simplifying the AI agent development process and improving the performance and stability of AI agents.
Expand All @@ -30,7 +30,7 @@ CozeLoop helps developers efficiently develop and operate AI agents by providing
* **Observation**: CozeLoop provides developers with visual observation capabilities for the full-chain execution process, fully recording each processing step from user input to AI output. This includes key nodes such as prompt parsing, model invocation, and tool execution, while automatically capturing intermediate results and abnormal states.

## Feature list
| **Feature** | **Feature points** | **Commercial version** | **Community Edition** |
| **Feature** | **Feature points** | **Commercial version** | **Open-source Edition** |
| --- | --- | --- | --- |
| Prompt debugging | Playground debugging, comparison, and version management | ✔️ | ✔️ |
| | Prompt optimization | ✔️ | - |
Expand All @@ -48,19 +48,19 @@ CozeLoop helps developers efficiently develop and operate AI agents by providing
| | Enterprise teams and permissions | ✔️ | - |
## Quickstart
Refer to the [Quickstart](https://github.com/coze-dev/cozeloop/wiki/2.-Quickstart) to learn how to install and deploy the latest version of CozeLoop.
## Using CozeLoop Community Edition
## Using CozeLoop Open-source Edition

* [Prompt development and debugging](https://loop.coze.cn/open/docs/cozeloop/create-prompt): CozeLoop provides a complete prompt development workflow.
* [Evaluation](https://loop.coze.cn/open/docs/cozeloop/create-prompt): CozeLoop's evaluation functionality offers standardized evaluation data management, automated assessment engines, and comprehensive experimental result statistics.
* [Trace reporting and querying](https://loop.coze.cn/open/docs/cozeloop/trace-integrate): CozeLoop supports automatic Trace reporting for prompt debugging conducted on the platform, enabling real-time tracking of each Trace data.
* [Community Edition usage of the CozeLoop SDK](https://github.com/coze-dev/cozeloop/wiki/8.-Community-edition-uses-CozeLoop-SDK): The CozeLoop SDK in three languages is suitable for both commercial and community editions. For the Community Edition, developers only need to modify some parameter configurations during initialization.
* [Open-source Edition usage of the CozeLoop SDK](https://github.com/coze-dev/cozeloop/wiki/8.-Open-source-edition-uses-CozeLoop-SDK): The CozeLoop SDK in three languages is suitable for both commercial and open-source editions. For the Open-source Edition, developers only need to modify some parameter configurations during initialization.

## Development guide

* [System architecture](https://github.com/coze-dev/cozeloop/wiki/3.-Architecture): Learn about the technical architecture and core components of CozeLoop Community Edition.
* [Startup mode](https://github.com/coze-dev/cozeloop/wiki/4.-Service-startup-modes): When installing and deploying CozeLoop Community Edition, the default development mode allows backend file modifications without requiring service redeployment.
* [Model configuration](https://github.com/coze-dev/cozeloop/wiki/5.-Model-configuration): CozeLoop Community Edition supports various LLM models through the Eino framework. Refer to this document to view the supported model list and learn how to configure models.
* [Code development and testing](https://github.com/coze-dev/cozeloop/wiki/6.-Code-development-and-testing): Learn how to perform secondary development and testing based on CozeLoop Community Edition.
* [System architecture](https://github.com/coze-dev/cozeloop/wiki/3.-Architecture): Learn about the technical architecture and core components of CozeLoop Open-source Edition.
* [Startup mode](https://github.com/coze-dev/cozeloop/wiki/4.-Service-startup-modes): When installing and deploying CozeLoop Open-source Edition, the default development mode allows backend file modifications without requiring service redeployment.
* [Model configuration](https://github.com/coze-dev/cozeloop/wiki/5.-Model-configuration): CozeLoop Open-source Edition supports various LLM models through the Eino framework. Refer to this document to view the supported model list and learn how to configure models.
* [Code development and testing](https://github.com/coze-dev/cozeloop/wiki/6.-Code-development-and-testing): Learn how to perform secondary development and testing based on CozeLoop Open-source Edition.
* [Fault troubleshooting](https://github.com/coze-dev/cozeloop/wiki/7.-Troubleshooting): Learn how to check container status and system logs.

## License
Expand All @@ -72,6 +72,7 @@ If you identify potential security issues in this project or believe you may hav
Please **do not** create public GitHub Issues.
## Join the Community
Scan the QR code below on the Lark mobile app to join the CozeLoop technical discussion group

![Image](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/8fae8f0e7b124831b1dd94aa9a5c60c1~tplv-goo7wpa0wc-image.image)
## Acknowledgments
Thanks to all developers and community members who contributed to the CozeLoop project Special thanks:
Expand Down
3 changes: 3 additions & 0 deletions backend/api/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions backend/api/handler/coze/loop/apis/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/cloudwego/kitex/pkg/endpoint"
"github.com/cloudwego/kitex/pkg/kerrors"

"github.com/coze-dev/cozeloop/backend/infra/i18n"
cachemw "github.com/coze-dev/cozeloop/backend/infra/middleware/ctxcache"
logmw "github.com/coze-dev/cozeloop/backend/infra/middleware/logs"
"github.com/coze-dev/cozeloop/backend/infra/middleware/validator"
Expand Down Expand Up @@ -65,6 +66,11 @@ type APIHandler struct {
*DataHandler
*ObservabilityHandler
*FoundationHandler
Translater i18n.ITranslater
}

func (a *APIHandler) GetTranslater() i18n.ITranslater {
return a.Translater
}

type EvaluationHandler struct {
Expand Down
3 changes: 2 additions & 1 deletion backend/api/router/coze/loop/apis/middleware.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions backend/api/router/coze/loop/apis/middleware/locale.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: Apache-2.0

package middleware

import (
"context"
"strings"

"github.com/cloudwego/hertz/pkg/app"

"github.com/coze-dev/cozeloop/backend/pkg/consts"
"github.com/coze-dev/cozeloop/backend/pkg/contexts"
)

var supportedLocales = []string{
consts.LocaleZhCN,
consts.LocalEnUS,
}

func LocaleMW() app.HandlerFunc {
return func(ctx context.Context, c *app.RequestContext) {
c.Next(contexts.WithLocale(ctx, parseLocale(c)))
}
}

func parseLocale(c *app.RequestContext) string {
if locale := string(c.Cookie(consts.CookieLanguageKey)); isValidLocale(locale) {
return locale
}
return consts.LocaleDefault
}

func isValidLocale(locale string) bool {
if len(locale) == 0 {
return false
}
for _, supported := range supportedLocales {
if strings.EqualFold(locale, supported) {
return true
}
}
return false
}
Loading
Loading