generated from cloudwego/.github
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add eino assistant as example (#3)
* feat: add eino assistant as example
- Loading branch information
1 parent
7578934
commit d5636b2
Showing
56 changed files
with
8,499 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,4 @@ output/* | |
|
||
# Vscode files | ||
.vscode | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ark model: https://console.volcengine.com/ark | ||
# 必填, | ||
# 火山云方舟 ChatModel 的 Endpoint ID | ||
export ARK_CHAT_MODEL="" | ||
# 火山云方舟 向量化模型的 Endpoint ID | ||
export ARK_EMBEDDING_MODEL="" | ||
# 火山云方舟的 API Key | ||
export ARK_API_KEY="" | ||
|
||
# langfuse: https://cloud.langfuse.com/ | ||
# 下面两个环境变量如果为空,则不开启 langfuse callback | ||
# Langfuse Project 的 Public Key | ||
export LANGFUSE_PUBLIC_KEY="" | ||
# Langfuse Project 的 Secret Key。 注意,Secret Key 仅可在被创建时查看一次 | ||
export LANGFUSE_SECRET_KEY="" | ||
|
||
# Redis Server 的地址,不填写时,默认是 localhost:6379 | ||
export REDIS_ADDR= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
### JetBrains template | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
.idea/ | ||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/artifacts | ||
# .idea/compiler.xml | ||
# .idea/jarRepositories.xml | ||
# .idea/modules.xml | ||
# .idea/*.iml | ||
# .idea/modules | ||
# *.iml | ||
# *.ipr | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# SonarLint plugin | ||
.idea/sonarlint/ | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Android studio 3.1+ serialized cache file | ||
.idea/caches/build_file_checksums.ser | ||
|
||
### GoLand template | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/artifacts | ||
# .idea/compiler.xml | ||
# .idea/jarRepositories.xml | ||
# .idea/modules.xml | ||
# .idea/*.iml | ||
# .idea/modules | ||
# *.iml | ||
# *.ipr | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# SonarLint plugin | ||
.idea/sonarlint/ | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Android studio 3.1+ serialized cache file | ||
.idea/caches/build_file_checksums.ser | ||
|
||
.vscode/ | ||
log/ | ||
cmd/einoagent/data/ | ||
__debug_bin* | ||
/einoagent | ||
.DS_Store | ||
/data/ | ||
/einoagent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## 说明 | ||
|
||
### docker 启动 redis 作为向量数据库 | ||
|
||
```bash | ||
docker-compose up -d | ||
# 可以在 http://127.0.0.1:8001 看到 redis 的 web 界面 | ||
# redis 监听在 127.0.0.1:6379, 使用 redis-cli ping 可测试 | ||
``` | ||
|
||
### 环境变量 | ||
|
||
所需的大模型和 API Key. | ||
豆包大模型地址: https://console.volcengine.com/ark/region:ark+cn-beijing/model | ||
> ChatModel 推荐: [Doubao-pro-4k (functioncall)](https://console.volcengine.com/ark/region:ark+cn-beijing/model/detail?Id=doubao-pro-4k) | ||
> EmbeddingModel 推荐: [Doubao-embedding-large](https://console.volcengine.com/ark/region:ark+cn-beijing/model/detail?Id=doubao-embedding-large) | ||
> 进入页面后点击 `推理` 按钮,即可创建按量计费的模型接入点,对应的 `ep-xxx` 就是所需的 model 名称 | ||
```bash | ||
export ARK_API_KEY=xxx | ||
export ARK_CHAT_MODEL=xxx | ||
export ARK_EMBEDDING_MODEL=xxx | ||
``` | ||
|
||
### 启动 eino agent server | ||
|
||
```bash | ||
# 为了使用 data 目录,需要在 eino_assistant 目录下执行指令 | ||
go run cmd/einoagent/*.go | ||
``` | ||
|
||
### 访问 | ||
|
||
访问 http://127.0.0.1:8080/ 即可看到效果 | ||
|
||
### 命令行运行 index (可选) | ||
|
||
```bash | ||
# 因示例的Markdown文件存放在 cmd/knowledgeindexing/eino-docs 目录,代码中指定了相对路径 ./eino-docs,所以需在 cmd/knowledgeindexing 运行指令 | ||
cd cmd/knowledgeindexing | ||
go run main.go | ||
``` |
Oops, something went wrong.