mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 在 OpenAi 结构中添加 CrawlTimeOut 字段,用于设置资讯采集超时时间 - 修改相关函数以支持新的超时设置,包括 GetFinancialReports、GetTelegraphList、GetTopNewsList等 - 在前端设置页面添加 Crawler Timeout 设置项 - 优化浏览器检查逻辑,优先检查 Chrome 浏览器
27 lines
407 B
Go
27 lines
407 B
Go
package data
|
|
|
|
import (
|
|
"context"
|
|
"go-stock/backend/db"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewDeepSeekOpenAiConfig(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
ai := NewDeepSeekOpenAi(context.TODO())
|
|
res := ai.NewChatStream("北京文化", "sz000802")
|
|
for {
|
|
select {
|
|
case msg := <-res:
|
|
if msg == "" {
|
|
continue
|
|
}
|
|
t.Log(msg)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestGetTopNewsList(t *testing.T) {
|
|
GetTopNewsList(30)
|
|
}
|