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: add dify retriever #79

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

wangle201210
Copy link

feat: add dify retriever

en: add dify retriever
zh(optional): 添加 dify retriever

#74

@CLAassistant
Copy link

CLAassistant commented Jan 22, 2025

CLA assistant check
All committers have signed the CLA.

@wangle201210 wangle201210 changed the title add dify retriever feat: add dify retriever Jan 22, 2025
@BytePender
Copy link
Contributor

可以仿照 components/model/openai 提供对应的 examples,方便用户使用

components/retriever/dify/dify.go Outdated Show resolved Hide resolved
components/retriever/dify/retriever.go Outdated Show resolved Hide resolved
components/retriever/dify/dify.go Outdated Show resolved Hide resolved
components/retriever/dify/dify.go Outdated Show resolved Hide resolved
components/retriever/dify/retriever.go Outdated Show resolved Hide resolved
components/retriever/dify/retriever.go Outdated Show resolved Hide resolved
components/retriever/dify/retriever.go Outdated Show resolved Hide resolved
components/retriever/dify/retriever.go Outdated Show resolved Hide resolved
components/retriever/dify/dify.go Outdated Show resolved Hide resolved
components/retriever/dify/dify.go Show resolved Hide resolved
components/retriever/dify/retriever.go Outdated Show resolved Hide resolved
}

type Segment struct {
Id string `json:"id"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面的几个 缩写站在 Golang 的习惯上,是不是应该全大写

ID、DocumentID、getURL()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他的我这边没问题了


var (
Endpoint = "https://api.dify.ai/v1"
APIKey = "dataset-api-key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APIKey、DatasetID 可以考虑从环境变量读取,像其他组件的示例一样, 这样用户跑 examples 时,可以不用改代码。 整体风格也能保持统一

// APIKey 是 Dify API 的认证密钥
APIKey string
// Endpoint 是 Dify API 的服务地址
Endpoint string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释里稍微说明下 default 取值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants