Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
094600ee26 | ||
|
|
c03e4c8359 | ||
|
|
584f94e1ef | ||
|
|
6c4223de92 | ||
|
|
f67db8ea86 | ||
|
|
bc54cc852e | ||
|
|
7cb8069d60 | ||
|
|
87b84d94ff | ||
|
|
4d29bae67f | ||
|
|
d640e975bd | ||
|
|
e4bd0ca43b | ||
|
|
8b001c4cdf | ||
|
|
6cacb47d3d | ||
|
|
a65d597032 | ||
|
|
151bd5f66f | ||
|
|
69a9545869 | ||
|
|
b01e07e348 |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
custom: https://afdian.com/a/glidea
|
||||
@@ -113,7 +113,7 @@ Give zenfeed a try! **AI + RSS** might be a better way to consume information in
|
||||
|
||||
> [!IMPORTANT]
|
||||
> zenfeed uses model services from [SiliconFlow](https://cloud.siliconflow.cn/en) by default.
|
||||
> * Models: `Qwen/Qwen3-8B` (Free) and `Pro/BAAI/bge-m3`.
|
||||
> * Models: `Qwen/Qwen3-8B` (Free) and `Qwen/Qwen3-Embedding-4B`.
|
||||
> * If you don't have a SiliconFlow account yet, use this [**invitation link**](https://cloud.siliconflow.cn/i/U2VS0Q5A) to get a **¥14** credit.
|
||||
> * If you need to use other providers or models, or for more detailed custom deployments, please refer to the [Configuration Documentation](https://github.com/glidea/zenfeed/blob/main/docs/config.md) to edit `docker-compose.yml`.
|
||||
|
||||
|
||||
31
README.md
31
README.md
@@ -9,13 +9,7 @@
|
||||
* 面向开发者:一站式接入几乎所有AI应用开发需要用到的模型和API,一站式付费,统一接入。
|
||||
* 面向企业:管理与使用界面分离,一人管理,多人使用,降低中小企业使用AI的门槛和成本。
|
||||
|
||||
> 以下是我的个人感受
|
||||
> * 播客生成效果不错,产品设计也不错,能基于 RSS 内容生成,修改播客脚本... 比市面其它播客产品更全面
|
||||
> * 中转价格大多与官方一致,比如硅基 qwen3 8b 同样免费
|
||||
> * 支持 MCP,Agent 托管
|
||||
> * 拥抱开源,平台上各种 AI 应用都是开源的。可以看他们的 [开源账户](https://github.com/302ai)
|
||||
|
||||
看都看了,GitHub 一键登录 [注册一个](https://share.302.ai/mFS9MS) 试试吧!立即获得 1 美元额度
|
||||
GitHub 一键登录 [注册一个](https://share.302.ai/mFS9MS) 试试吧!立即获得 1 美元额度
|
||||
|
||||
---
|
||||
|
||||
@@ -41,6 +35,8 @@ zenfeed 是你的 <strong>AI 信息中枢</strong>。它既是<strong>智能 RSS
|
||||
<p align="center">
|
||||
<a href="https://zenfeed.xyz"><b>在线体验 (仅 RSS 阅读)</b></a>
|
||||
|
|
||||
<a href="https://github.com/xusonfan/zenfeedApp"><b>安卓版体验 (仅 RSS 阅读)</b></a>
|
||||
|
|
||||
<a href="docs/tech/hld-zh.md"><b>技术文档</b></a>
|
||||
|
|
||||
<a href="#-安装与使用"><b>快速开始</b></a>
|
||||
@@ -52,6 +48,7 @@ zenfeed 是你的 <strong>AI 信息中枢</strong>。它既是<strong>智能 RSS
|
||||
---
|
||||
|
||||
**epub2rss**: 把 epub 电子书转成每日更新一个章节的 RSS Feed,[join waitlist](https://epub2rss.pages.dev/)
|
||||
|
||||
**one-coffee**: 一款类似 syft,万物追踪的日报产品(差异点:支持播客等多模态;高质量信源,主攻 AI 领域)。下方加我微信加入 waitlist
|
||||
|
||||
---
|
||||
@@ -135,7 +132,8 @@ RSS(简易信息聚合)诞生于 Web 1.0 时代,旨在解决信息分散
|
||||
|
||||
> [!IMPORTANT]
|
||||
> zenfeed 默认使用 [硅基流动](https://cloud.siliconflow.cn/) 提供的模型服务。
|
||||
> * 模型: `Qwen/Qwen3-8B` (免费) 和 `Pro/BAAI/bge-m3`。
|
||||
> * 模型: `Qwen/Qwen3-8B` (免费) 和 `Qwen/Qwen3-Embedding-4B`。
|
||||
> * **!!!如果你愿意赞助本项目,将获赠一定额度的 Gemini 2.5 Pro/Flash!!! (见下方)**
|
||||
> * 如果你还没有硅基账号,使用 [**邀请链接**](https://cloud.siliconflow.cn/i/U2VS0Q5A) 可获得 **14 元** 赠送额度。
|
||||
> * 如果需要使用其他厂商或模型,或进行更详细的自定义部署,请参考 [配置文档](https://github.com/glidea/zenfeed/blob/main/docs/config-zh.md) 来编辑 `docker-compose.yml`。
|
||||
|
||||
@@ -171,6 +169,7 @@ $env:API_KEY = "sk-..."; docker-compose -p zenfeed up -d
|
||||
> * **安全提示:** zenfeed 尚无认证机制,将服务暴露到公网可能会泄露您的 `API_KEY`。请务必配置严格的安全组规则,仅对信任的 IP 开放访问。
|
||||
|
||||
### 3. 开始使用
|
||||
> 安卓版:https://github.com/xusonfan/zenfeedApp
|
||||
|
||||
#### 添加 RSS 订阅源
|
||||
|
||||
@@ -206,18 +205,26 @@ $env:API_KEY = "sk-..."; docker-compose -p zenfeed up -d
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<img src="docs/images/wechat.png" alt="Wechat QR Code" width="150">
|
||||
<img src="https://github.com/glidea/zenfeed/blob/main/docs/images/wechat.png?raw=true" alt="Wechat QR Code" width="300">
|
||||
<br>
|
||||
<strong>加群讨论</strong>
|
||||
<strong>AI 学习交流社群</strong>
|
||||
</td>
|
||||
<td align="center">
|
||||
<img src="docs/images/sponsor.png" alt="Sponsor QR Code" width="150">
|
||||
<img src="https://github.com/glidea/banana-prompt-quicker/blob/main/images/glidea.png?raw=true" width="250">
|
||||
<br>
|
||||
<strong>请杯咖啡 🧋</strong>
|
||||
<strong><a href="https://glidea.zenfeed.xyz/">我的其它项目</a></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
<img src="https://github.com/glidea/banana-prompt-quicker/blob/main/images/readnote.png?raw=true" width="400">
|
||||
<br>
|
||||
<strong><a href="https://www.xiaohongshu.com/user/profile/5f7dc54d0000000001004afb">📕 小红书账号 - 持续分享 AI 原创</a></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
都看到这里了,顺手点个 **Star ⭐️** 呗,这是我持续维护的最大动力!
|
||||
|
||||
有好玩的 AI 工作也请联系我!
|
||||
|
||||
@@ -60,7 +60,7 @@ configs:
|
||||
api_key: ${API_KEY:-your-api-key}
|
||||
- name: embed
|
||||
provider: siliconflow
|
||||
embedding_model: Pro/BAAI/bge-m3
|
||||
embedding_model: Qwen/Qwen3-Embedding-4B
|
||||
api_key: ${API_KEY:-your-api-key}
|
||||
scrape:
|
||||
rsshub_endpoint: http://rsshub:1200
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
| `scrape.past` | `time.Duration` | 抓取 Feed 的回溯时间窗口。例如 `1h` 表示只抓取过去 1 小时的 Feed。 | `24h` | 否 |
|
||||
| `scrape.interval` | `time.Duration` | 抓取每个源的频率 (全局默认值)。例如 `1h`。 | `1h` | 否 |
|
||||
| `scrape.rsshub_endpoint` | `string` | RSSHub 的端点。你可以部署自己的 RSSHub 服务器或使用公共实例 (参见 [RSSHub 文档](https://docs.rsshub.app/guide/instances))。例如 `https://rsshub.app`。 | | 是 (如果使用了 `rsshub_route_path`) |
|
||||
| `scrape.rsshub_access_key` | `string` | RSSHub 的访问密钥。用于访问控制。(详情见 [RSSHub文档访问控制](https://docs.rsshub.app/deploy/config#access-control-configurations)) | | 否 |
|
||||
| `scrape.sources` | `对象列表` | 用于抓取 Feed 的源列表。详见下方的 **抓取源配置**。 | `[]` | 是 (至少一个) |
|
||||
|
||||
### 抓取源配置 (`scrape.sources[]`)
|
||||
|
||||
@@ -59,6 +59,7 @@ This section configures parameters related to the Jina AI Reader API, primarily
|
||||
| `scrape.past` | `time.Duration` | Time window to look back when scraping feeds. E.g., `1h` means only scrape feeds from the past 1 hour. | `24h` | No |
|
||||
| `scrape.interval` | `time.Duration` | Frequency to scrape each source (global default). E.g., `1h`. | `1h` | No |
|
||||
| `scrape.rsshub_endpoint` | `string` | Endpoint for RSSHub. You can deploy your own RSSHub server or use a public instance (see [RSSHub Documentation](https://docs.rsshub.app/guide/instances)). E.g., `https://rsshub.app`. | | Yes (if `rsshub_route_path` is used) |
|
||||
| `scrape.rsshub_access_key` | `string` | The access key for RSSHub. Used for access control. (see [RSSHub config](https://docs.rsshub.app/deploy/config#access-control-configurations))| | No |
|
||||
| `scrape.sources` | `list of objects` | List of sources to scrape feeds from. See **Scrape Source Configuration** below. | `[]` | Yes (at least one) |
|
||||
|
||||
### Scrape Source Configuration (`scrape.sources[]`)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 897 KiB |
@@ -77,7 +77,7 @@ storage:
|
||||
- `speakers`: 定义播客的演讲者。
|
||||
- `name`: 演讲者的名字。
|
||||
- `role`: 演讲者的角色和人设,将影响脚本内容。
|
||||
- `voice`: 演讲者的声音。请参考 [Google Cloud TTS 文档](https://cloud.google.com/text-to-speech/docs/voices) 获取可用的声音名称(例如 `en-US-Standard-C`,`en-US-News-N`)。
|
||||
- `voice`: 演讲者的声音。请参考 [Gemini TTS 文档](https://ai.google.dev/gemini-api/docs/speech-generation#voices)。
|
||||
|
||||
**示例 `config.yaml`:**
|
||||
|
||||
@@ -85,20 +85,23 @@ storage:
|
||||
storage:
|
||||
feed:
|
||||
rewrites:
|
||||
- source_label: "content"
|
||||
label: "podcast_url"
|
||||
- source_label: content # 基于原文
|
||||
transform:
|
||||
to_podcast:
|
||||
llm: "openai-chat"
|
||||
tts_llm: "gemini-tts"
|
||||
transcript_additional_prompt: "使用中文回复"
|
||||
estimate_maximum_duration: 3m0s # 接近 3 分钟
|
||||
transcript_additional_prompt: 对话引人入胜,流畅自然,拒绝 AI 味,使用中文回复 # 脚本内容要求
|
||||
llm: xxxx # 负责生成脚本的 llm
|
||||
tts_llm: gemini-tts # 仅支持 gemini tts,推荐使用 https://github.com/glidea/one-balance 轮询
|
||||
speakers:
|
||||
- name: "主持人小雅"
|
||||
role: "一位经验丰富、声音甜美、风格活泼的科技播客主持人。擅长联系实际生活场景。"
|
||||
voice: "zh-CN-Standard-A" # 女声
|
||||
- name: "技术评论员老王"
|
||||
role: "一位对技术有深入见解、观点犀利的评论员,说话直接,偶尔有些愤世嫉俗。"
|
||||
voice: "zh-CN-Standard-B" # 男声
|
||||
- name: 小雅
|
||||
role: >-
|
||||
一位经验丰富、声音甜美、风格活泼的科技播客主持人。前财经记者、媒体人出身,因为工作原因长期关注科技行业,后来凭着热爱和出色的口才转行做了全职内容创作者。擅长从普通用户视角出发,把复杂的技术概念讲得生动有趣,是她发掘了老王,并把他‘骗’来一起做播客的‘始作俑者’。
|
||||
voice: Autonoe
|
||||
- name: 老王
|
||||
role: >-
|
||||
一位资深科技评论员,互联网老兵。亲身经历过中国互联网从草莽到巨头的全过程,当过程序员,做过产品经理,也创过业。因此他对行业的各种‘风口’和‘概念’有自己独到的、甚至有些刻薄的见解。观点犀利,一针见血,说话直接,热衷于给身边的一切产品挑刺。被‘忽悠’上了‘贼船’,表面上经常吐槽,但内心很享受这种分享观点的感觉。
|
||||
voice: Puck
|
||||
label: podcast_url
|
||||
```
|
||||
|
||||
配置完成后,Zenfeed 将在每次抓取到新文章时,自动执行上述流程。可以在通知模版中使用 podcast_url label,或 Web 中直接收听(Web 固定读取 podcast_url label,若使用别的名称则无法读取)
|
||||
@@ -95,10 +95,11 @@ type LLM struct {
|
||||
}
|
||||
|
||||
type Scrape struct {
|
||||
Past timeutil.Duration `yaml:"past,omitempty" json:"past,omitempty" desc:"The lookback time window for scraping feeds. e.g. 1h means only scrape feeds in the past 1 hour. Default: 3d"`
|
||||
Interval timeutil.Duration `yaml:"interval,omitempty" json:"interval,omitempty" desc:"How often to scrape each source, it is a global interval. e.g. 1h. Default: 1h"`
|
||||
RSSHubEndpoint string `yaml:"rsshub_endpoint,omitempty" json:"rsshub_endpoint,omitempty" desc:"The endpoint of the RSSHub. You can deploy your own RSSHub server or use the public one (https://docs.rsshub.app/guide/instances). e.g. https://rsshub.app. It is required when sources[].rss.rsshub_route_path is set."`
|
||||
Sources []ScrapeSource `yaml:"sources,omitempty" json:"sources,omitempty" desc:"The sources for scraping feeds."`
|
||||
Past timeutil.Duration `yaml:"past,omitempty" json:"past,omitempty" desc:"The lookback time window for scraping feeds. e.g. 1h means only scrape feeds in the past 1 hour. Default: 3d"`
|
||||
Interval timeutil.Duration `yaml:"interval,omitempty" json:"interval,omitempty" desc:"How often to scrape each source, it is a global interval. e.g. 1h. Default: 1h"`
|
||||
RSSHubEndpoint string `yaml:"rsshub_endpoint,omitempty" json:"rsshub_endpoint,omitempty" desc:"The endpoint of the RSSHub. You can deploy your own RSSHub server or use the public one (https://docs.rsshub.app/guide/instances). e.g. https://rsshub.app. It is required when sources[].rss.rsshub_route_path is set."`
|
||||
RSSHubAccessKey string `yaml:"rsshub_access_key,omitempty" json:"rsshub_access_key,omitempty" desc:"The access key for RSSHub. Used for access control. (see [RSSHub config](https://docs.rsshub.app/deploy/config#access-control-configurations))"`
|
||||
Sources []ScrapeSource `yaml:"sources,omitempty" json:"sources,omitempty" desc:"The sources for scraping feeds."`
|
||||
}
|
||||
|
||||
type Storage struct {
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
"io"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -407,6 +408,9 @@ func (c *cached) String(ctx context.Context, messages []string) (string, error)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if strings.Trim(value, " \n\r\t") == "" {
|
||||
return "", errors.New("empty response") // Gemini may occur this.
|
||||
}
|
||||
|
||||
// TODO: reduce copies.
|
||||
if err = c.kvStorage.Set(ctx, []byte(keyStr), []byte(value), 65*time.Minute); err != nil {
|
||||
|
||||
@@ -80,6 +80,7 @@ func (c *Config) From(app *config.App) {
|
||||
URL: app.Scrape.Sources[i].RSS.URL,
|
||||
RSSHubEndpoint: app.Scrape.RSSHubEndpoint,
|
||||
RSSHubRoutePath: app.Scrape.Sources[i].RSS.RSSHubRoutePath,
|
||||
RSSHubAccessKey: app.Scrape.RSSHubAccessKey,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ type ScrapeSourceRSS struct {
|
||||
URL string
|
||||
RSSHubEndpoint string
|
||||
RSSHubRoutePath string
|
||||
RSSHubAccessKey string
|
||||
}
|
||||
|
||||
func (c *ScrapeSourceRSS) Validate() error {
|
||||
@@ -46,9 +47,22 @@ func (c *ScrapeSourceRSS) Validate() error {
|
||||
return errors.New("URL must be a valid HTTP/HTTPS URL")
|
||||
}
|
||||
|
||||
// Append access key as query parameter if provided
|
||||
c.appendAccessKey()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ScrapeSourceRSS) appendAccessKey() {
|
||||
if c.RSSHubEndpoint != "" && c.RSSHubAccessKey != "" && !strings.Contains(c.URL, "key=") {
|
||||
if strings.Contains(c.URL, "?") {
|
||||
c.URL += "&key=" + c.RSSHubAccessKey
|
||||
} else {
|
||||
c.URL += "?key=" + c.RSSHubAccessKey
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Factory code block ---
|
||||
func newRSSReader(config *ScrapeSourceRSS) (reader, error) {
|
||||
if err := config.Validate(); err != nil {
|
||||
|
||||
@@ -122,6 +122,55 @@ func TestNewRSS(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Scenario: "Valid Configuration - RSSHub with Access Key",
|
||||
Given: "a valid configuration with RSSHub details and access key",
|
||||
When: "creating a new RSS reader",
|
||||
Then: "should succeed, construct the URL with access key, and return a valid reader",
|
||||
GivenDetail: givenDetail{
|
||||
config: &ScrapeSourceRSS{
|
||||
RSSHubEndpoint: "http://rsshub.app/",
|
||||
RSSHubRoutePath: "/_/test",
|
||||
RSSHubAccessKey: "testkey",
|
||||
},
|
||||
},
|
||||
WhenDetail: whenDetail{},
|
||||
ThenExpected: thenExpected{
|
||||
wantErr: false,
|
||||
validateFunc: func(t *testing.T, r reader) {
|
||||
Expect(r).NotTo(BeNil())
|
||||
rssReader, ok := r.(*rssReader)
|
||||
Expect(ok).To(BeTrue())
|
||||
Expect(rssReader.config.URL).To(Equal("http://rsshub.app/_/test?key=testkey"))
|
||||
Expect(rssReader.config.RSSHubEndpoint).To(Equal("http://rsshub.app/"))
|
||||
Expect(rssReader.config.RSSHubRoutePath).To(Equal("/_/test"))
|
||||
Expect(rssReader.config.RSSHubAccessKey).To(Equal("testkey"))
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Scenario: "Valid Configuration - URL with Access Key",
|
||||
Given: "a valid configuration with URL and access key",
|
||||
When: "creating a new RSS reader",
|
||||
Then: "should succeed, append access key to URL, and return a valid reader",
|
||||
GivenDetail: givenDetail{
|
||||
config: &ScrapeSourceRSS{
|
||||
URL: "http://example.com/feed",
|
||||
RSSHubAccessKey: "testkey",
|
||||
},
|
||||
},
|
||||
WhenDetail: whenDetail{},
|
||||
ThenExpected: thenExpected{
|
||||
wantErr: false,
|
||||
validateFunc: func(t *testing.T, r reader) {
|
||||
Expect(r).NotTo(BeNil())
|
||||
rssReader, ok := r.(*rssReader)
|
||||
Expect(ok).To(BeTrue())
|
||||
Expect(rssReader.config.URL).To(Equal("http://example.com/feed"))
|
||||
Expect(rssReader.config.RSSHubAccessKey).To(Equal("testkey"))
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// --- Run tests ---
|
||||
|
||||
Reference in New Issue
Block a user