You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add web search switch button
Signed-off-by: Bob Du <i@bobdu.cc>
* refactor: extracting create content helper function
Signed-off-by: Bob Du <i@bobdu.cc>
* feat: add search api provider and api key config page
Signed-off-by: Bob Du <i@bobdu.cc>
* feat: add web search logic in backend
Signed-off-by: Bob Du <i@bobdu.cc>
* chore: improve chat system message
Signed-off-by: Bob Du <i@bobdu.cc>
---------
Signed-off-by: Bob Du <i@bobdu.cc>
Before formally answering user questions, you need to analyze the user's questions and conversation context to determine whether you need to obtain more information through internet search to provide accurate answers.
62
+
63
+
**Task Flow:**
64
+
1. Carefully analyze the user's question content and previous conversation history
65
+
2. Combined with the current time, determine whether the question involves time-sensitive information
66
+
3. Evaluate whether existing knowledge is sufficient to answer the question
67
+
4. If search is needed, generate a precise search query
68
+
5. If search is not needed, return empty result
69
+
70
+
**Output Format Requirements:**
71
+
- If search is needed: return <search_query>example search query keywords</search_query>
72
+
- If search is not needed: return <search_query></search_query>
73
+
- Do not include any other explanations or answer content
74
+
- Search query should be concise and clear, able to obtain the most relevant information
75
+
76
+
**Judgment Criteria:**
77
+
- Time-sensitive information (such as latest news, stock prices, weather, real-time data, etc.): search needed
78
+
- Latest policies, regulations, technological developments: may need search
79
+
- Common sense questions, historical facts, basic knowledge: usually no search needed
80
+
- Latest research or developments in professional fields: search recommended
81
+
82
+
**Notes:**
83
+
- Search query should target the core needs of user questions
84
+
- Consider the timeliness and accuracy requirements of information
85
+
- Prioritize obtaining the latest and most authoritative information sources
86
+
87
+
Please strictly return results according to the above format.`
88
+
}
89
+
18
90
constErrorCodeMessage: Record<string,string>={
19
91
401: '[OpenAI] 提供错误的API密钥 | Incorrect API key provided',
20
92
403: '[OpenAI] 服务器拒绝访问,请稍后再试 | Server refused to access, please try again later',
@@ -49,17 +121,16 @@ export async function initApi(key: KeyConfig) {
0 commit comments