Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: manually mirror eino's code from bytedance #1

Merged
merged 8 commits into from
Dec 11, 2024
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/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 5m
57 changes: 56 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,61 @@ name: Tests
on: [ push, pull_request ]

jobs:
unit_test:
name: "eino unit test"
runs-on: ubuntu-latest
steps:
- name: unit test
uses: actions/codecov
inputs:
driver: go
commands:
- modules=`find . -name "go.mod" -exec dirname {} \;`
- echo $modules
- list=""
- coverpkg=""
- if [[ ! -f "go.work" ]];then go work init;fi
- for module in $modules; do go work use $module; list=$module"/... "$list; coverpkg=$module"/...,"$coverpkg; done
- go work sync
- go test -coverprofile=coverage.out -gcflags="all=-l -N" -coverpkg=$coverpkg $list
config:
status:
project:
eino:
minimum_coverage: 65%
paths:
- "!tests"
- "!examples/**"
- "!*/examples/**"
- "!*/mock/**"
eino-changed:
base: "change"
threshold: 0.8%
paths:
- "!tests"
- "!examples/**"
- "!*/examples/**"
- "!*/mock/**"
diff:
eino:
line_limit: 10 # 增量行数少于多少行时,默认置成功
minimum_coverage: 50%
paths:
- "!tests"
- "!examples/**"
- "!*/examples/**"
- "!*/mock/**"
- name: Sonar
uses: actions/sonar@v1
inputs:
coverage_path: /tmp/coverage.out
coverage_type: go
disable_quality_gates: true
exclusions_list:
- "!tests"
- "examples/**"
- "*/mock/**"
language: go
unit-benchmark-test:
runs-on: ubuntu-latest
steps:
Expand All @@ -21,7 +76,7 @@ jobs:
compatibility-test:
strategy:
matrix:
go: [ "1.19", "1.20", "1.21", "1.22" ]
go: [ "1.18", "1.19", "1.20", "1.21", "1.22" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ output/*
# Vscode files
.vscode

/patches

9 changes: 5 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ linters-settings:
- stdmethods
linters:
enable:
- gofumpt
- goimports
- gofmt
disable:
- errcheck
- typecheck
- deadcode
- varcheck
- staticcheck
- unused
- gosimple
- ineffassign
- gofumpt
issues:
exclude-use-default: true
exclude-files:
- ".*\\.mock\\.go$"
exclude-dirs:
exclude-dirs:
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# .github
# Eino

English | [中文](README.zh_CN.md)

## Overview


## Security

If you discover a potential security issue in this project, or think you may
have discovered a security issue, we ask that you notify Bytedance Security via our [security center](https://security.bytedance.com/src) or [vulnerability reporting email]([email protected]).

Please do **not** create a public GitHub issue.

## License

This project is licensed under the [Apache-2.0 License](LICENSE.txt).
54 changes: 54 additions & 0 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Eino

[English](README.md) | 中文


## 概括

Eino['aino] (近似音: i know) 旨在提供 Golang 语言的 AI 应用开发框架。 Eino 参考了开源社区中诸多优秀的 AI 应用开发框架,例如 LangChain、LangGraph、LlamaIndex 等,提供了更符合 Golang 编程习惯的 AI 应用开发框架。

Eino 提供了丰富的辅助AI应用开发的原子组件、集成组件、组件编排、切面扩展等能力,可以帮助开发者更加简单便捷地开发出架构清晰、易维护、高可用的AI应用。

## 框架特点

- **丰富的组件**

将多场景普遍使用的能力,抽象成可独立使用、可编排使用的组件,开箱即用。例如 ChatModel、PromptTemplate、Retriever、Loader 等。

组件又可细分为:功能不可细拆的原子组件、由一到多中组件以某种范式组合而成的集成组件。

- **易用的图编排**

将各组件实例,作为图的节点,以图的点边关系连接,以边的方向逐步执行节点并传输数据流,将AI应用的逻辑以图的方式进行编排和执行。

图编排可极大简化 **并行**、**异步** 逻辑的开发,并优化其代码结构

- **完善的流处理**

根据输入、输出是否为流式,可划分成 4 种交互模式。 图编排可根据上下游节点的输入、输出是否是流,自动进行 流 和 非流 的转换,极大地方便开发者对AI应用提供流的能力

| 函数名 | 模式说明 |
|-----------|-----------|
| Invoke | 输入是非流、输出是非流 |
| Stream | 输入是非流、输出是流 |
| Collect | 输入是流、输出是非流 |
| Transform | 输入是流、输出是流 |

- **高扩展性的切面**

图编排为图、节点的执行前后提供切面的注入、执行机制。开发者可基于此机制,在不侵入主流程的前提下,灵活地设计和注入自己的切面能力。例如 Trace、埋点、日志等


## 详细文档

// TODO:链接用户手册等文档

## 安全

如果你在该项目中发现潜在的安全问题,或你认为可能发现了安全问题,请通过我们的[安全中心](https://security.bytedance.com/src)或[漏洞报告邮箱]([email protected])通知字节跳动安全团队。

请**不要**创建公开的 GitHub Issue。

## 开源许可证

本项目依据 [Apache-2.0 许可证](LICENSE.txt) 授权。
12 changes: 12 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Typo check: https://github.com/crate-ci/typos
[default]

[default.extend-words]
Invokable = "Invokable"
invokable = "invokable"
InvokableLambda = "InvokableLambda"
InvokableRun = "InvokableRun"
outter = "outter"
Opion = "Opion"
TOpion = "TOpion"
renderring = "renderring"


[files]
extend-exclude = ["go.mod", "go.sum", "check_branch_name.sh"]
Loading
Loading