diff --git a/service/src/chatgpt/index.ts b/service/src/chatgpt/index.ts
index 9c788fc3..55318248 100644
--- a/service/src/chatgpt/index.ts
+++ b/service/src/chatgpt/index.ts
@@ -141,7 +141,7 @@ async function chatReplyProcess(options: RequestOptions) {
// https://docs.tavily.com/documentation/best-practices/best-practices-search#search-depth%3Dadvanced-ideal-for-higher-relevance-in-search-results
searchDepth: 'advanced',
chunksPerSource: 3,
- includeRawContent: true,
+ includeRawContent: searchConfig.options?.includeRawContent ?? false,
// 0 <= x <= 20 https://docs.tavily.com/documentation/api-reference/endpoint/search#body-max-results
// https://docs.tavily.com/documentation/best-practices/best-practices-search#max-results-limiting-the-number-of-results
maxResults: searchConfig.options?.maxResults || 10,
diff --git a/service/src/index.ts b/service/src/index.ts
index 84109520..7c8a1671 100644
--- a/service/src/index.ts
+++ b/service/src/index.ts
@@ -857,7 +857,7 @@ router.post('/search-test', rootAuth, async (req, res) => {
{
searchDepth: 'advanced',
chunksPerSource: 3,
- includeRawContent: true,
+ includeRawContent: search.options?.includeRawContent ?? false,
maxResults,
timeout: 120,
},
diff --git a/service/src/storage/config.ts b/service/src/storage/config.ts
index d8c594ff..2910d923 100644
--- a/service/src/storage/config.ts
+++ b/service/src/storage/config.ts
@@ -95,7 +95,7 @@ export async function getOriginConfig() {
if (!config.searchConfig) {
config.searchConfig = new SearchConfig()
config.searchConfig.enabled = false
- config.searchConfig.options = { apiKey: '', maxResults: 10 }
+ config.searchConfig.options = { apiKey: '', maxResults: 10, includeRawContent: false }
}
if (!isNotEmptyString(config.siteConfig.chatModels))
diff --git a/service/src/storage/model.ts b/service/src/storage/model.ts
index d41be992..5890b923 100644
--- a/service/src/storage/model.ts
+++ b/service/src/storage/model.ts
@@ -200,6 +200,7 @@ export enum SearchServiceProvider {
export class SearchServiceOptions {
public apiKey: string
public maxResults?: number
+ public includeRawContent?: boolean
}
export class Config {
diff --git a/src/components/common/Setting/Search.vue b/src/components/common/Setting/Search.vue
index 05082948..dfad55f5 100644
--- a/src/components/common/Setting/Search.vue
+++ b/src/components/common/Setting/Search.vue
@@ -28,6 +28,8 @@ async function fetchConfig() {
data.searchConfig.options = { apiKey: '' }
if (!data.searchConfig.options.maxResults)
data.searchConfig.options.maxResults = 10
+ if (data.searchConfig.options.includeRawContent === undefined)
+ data.searchConfig.options.includeRawContent = false
config.value = data.searchConfig
}
finally {
@@ -111,6 +113,15 @@ onMounted(() => {
/>
+
+
{{ t('setting.searchIncludeRawContent') }}
+
+ { if (config && config.options) config.options.includeRawContent = val }"
+ />
+
+
{{ t('setting.searchTest') }}
diff --git a/src/components/common/Setting/model.ts b/src/components/common/Setting/model.ts
index a0a38776..e75a9c09 100644
--- a/src/components/common/Setting/model.ts
+++ b/src/components/common/Setting/model.ts
@@ -186,6 +186,7 @@ export type SearchServiceProvider = 'tavily' | ''
export interface SearchServiceOptions {
apiKey: string
maxResults?: number
+ includeRawContent?: boolean
}
export class SearchConfig {
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index e0c57aed..9e01a12b 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -184,6 +184,7 @@
"searchProvider": "Search Provider",
"searchApiKey": "Search API Key",
"searchMaxResults": "Max Search Results",
+ "searchIncludeRawContent": "Include Raw Content",
"systemMessageWithSearchResult": "System message for conversations with search results",
"systemMessageGetSearchQuery": "System message for getting search query",
"systemMessageWithSearchResultPlaceholder": "System message template when with search results. Use {'{current_time}'} as placeholder for current time.",
diff --git a/src/locales/ko-KR.json b/src/locales/ko-KR.json
index cc6bb9aa..39229bf1 100644
--- a/src/locales/ko-KR.json
+++ b/src/locales/ko-KR.json
@@ -184,6 +184,7 @@
"searchProvider": "검색 공급자",
"searchApiKey": "검색 API 키",
"searchMaxResults": "최대 검색 결과 수",
+ "searchIncludeRawContent": "원시 콘텐츠 포함",
"systemMessageWithSearchResult": "검색 결과가 포함된 대화 시스템 프롬프트",
"systemMessageGetSearchQuery": "검색 쿼리어를 가져오는 시스템 프롬프트",
"systemMessageWithSearchResultPlaceholder": "검색 결과가 포함된 시스템 메시지 템플릿, {'{current_time}'}를 현재 시간의 플레이스홀더로 사용",
diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json
index 01b1eac3..971030cd 100644
--- a/src/locales/zh-CN.json
+++ b/src/locales/zh-CN.json
@@ -184,6 +184,7 @@
"searchProvider": "搜索提供商",
"searchApiKey": "搜索 API 密钥",
"searchMaxResults": "最大搜索结果数",
+ "searchIncludeRawContent": "包含原始内容",
"systemMessageWithSearchResult": "包含搜索结果时的对话系统提示词",
"systemMessageGetSearchQuery": "用于获取搜索查询词的系统提示词",
"systemMessageWithSearchResultPlaceholder": "携带搜索结果时的系统消息模板, 使用 {'{current_time}'} 作为当前时间的占位符",
diff --git a/src/locales/zh-TW.json b/src/locales/zh-TW.json
index e0e4d694..6bb9c67b 100644
--- a/src/locales/zh-TW.json
+++ b/src/locales/zh-TW.json
@@ -184,6 +184,7 @@
"searchProvider": "搜尋提供商",
"searchApiKey": "搜尋 API 密鑰",
"searchMaxResults": "最大搜尋結果數",
+ "searchIncludeRawContent": "包含原始內容",
"systemMessageWithSearchResult": "包含搜尋結果時的對話系統提示詞",
"systemMessageGetSearchQuery": "用於獲取搜尋查詢詞的系統提示詞",
"systemMessageWithSearchResultPlaceholder": "攜帶搜尋結果時的系統訊息模板, 使用 {'{current_time}'} 作為當前時間的佔位符",