From bd2bbeb19cc82663e857c51f300b5681b89fba60 Mon Sep 17 00:00:00 2001 From: yym68686 Date: Tue, 7 Nov 2023 17:00:13 +0800 Subject: [PATCH] Lock the openai python package version to 0.28.1. Modify the search prompt and fix the error caused by closing tag mistakes. Optimize the search prompt to generate output that aligns better with Markdown syntax. modify README --- README.md | 2 +- chatgpt2api/chatgpt2api.py | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a3c97992..3ecd22f2 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ https://api.telegram.org/bot/getWebhookInfo Start the container ```bash -docker run -p 80:8080 -dit \ +docker run -p 80:8080 --name chatbot -dit \ -e BOT_TOKEN="telegram bot token" \ -e WEB_HOOK="https://your_host.com/" \ -e API="" \ diff --git a/chatgpt2api/chatgpt2api.py b/chatgpt2api/chatgpt2api.py index b1b48902..38132f33 100644 --- a/chatgpt2api/chatgpt2api.py +++ b/chatgpt2api/chatgpt2api.py @@ -543,7 +543,7 @@ def search_summary( input_variables=["web_summary", "question"], template=( # "You are a text analysis expert who can use a search engine. You need to response the following question: {question}. Search results: {web_summary}. Your task is to thoroughly digest all search results provided above and provide a detailed and in-depth response in Simplified Chinese to the question based on the search results. The response should meet the following requirements: 1. Be rigorous, clear, professional, scholarly, logical, and well-written. 2. If the search results do not mention relevant content, simply inform me that there is none. Do not fabricate, speculate, assume, or provide inaccurate response. 3. Use markdown syntax to format the response. Enclose any single or multi-line code examples or code usage examples in a pair of ``` symbols to achieve code formatting. 4. Detailed, precise and comprehensive response in Simplified Chinese and extensive use of the search results is required." - "You need to response the following question: {question}. Search results: {web_summary}. Your task is to think about the question step by step and then answer the above question in simplified Chinese based on the Search results provided. Please response in simplified Chinese and adopt a style that is logical, in-depth, and detailed. Note: In order to make the answer appear highly professional, you should be an expert in textual analysis, aiming to make the answer precise and comprehensive. Use markdown syntax to format the response. Enclose any single or multi-line code examples or code usage examples in a pair of ``` symbols to achieve code formatting." + "You need to response the following question: {question}. Search results: {web_summary}. Your task is to think about the question step by step and then answer the above question in simplified Chinese based on the Search results provided. Please response in simplified Chinese and adopt a style that is logical, in-depth, and detailed. Note: In order to make the answer appear highly professional, you should be an expert in textual analysis, aiming to make the answer precise and comprehensive. Response in accordance with markdown format." # "You need to response the following question: {question}. Search results: {web_summary}. Your task is to thoroughly digest the search results provided above, dig deep into search results for thorough exploration and analysis and provide a response to the question based on the search results. The response should meet the following requirements: 1. You are a text analysis expert, extensive use of the search results is required and carefully consider all the Search results to make the response be in-depth, rigorous, clear, organized, professional, detailed, scholarly, logical, precise, accurate, comprehensive, well-written and speak in Simplified Chinese. 2. If the search results do not mention relevant content, simply inform me that there is none. Do not fabricate, speculate, assume, or provide inaccurate response. 3. Use markdown syntax to format the response. Enclose any single or multi-line code examples or code usage examples in a pair of ``` symbols to achieve code formatting." ), ) diff --git a/requirements.txt b/requirements.txt index 1fd06f8d..85d748da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ flask[async] python-telegram-bot==20.4 # langchain -openai +openai==0.28.1 chromadb wikipedia fake_useragent