-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 更新上agent提示词代码 * 更新部分文档,修复了issue中提到的bge匹配超过1 的bug * 按需修改 * 解决了部分最新用户用依赖的bug,加了两个工具,移除google工具
- Loading branch information
1 parent
332f8be
commit fc6a3b0
Showing
11 changed files
with
108 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
from .prompt_config import * | ||
|
||
|
||
VERSION = "v0.2.5-preview" | ||
VERSION = "v0.2.6-preview" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## 单独运行的时候需要添加 | ||
import sys | ||
import os | ||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) | ||
import json | ||
from server.chat import search_engine_chat | ||
from configs import LLM_MODEL, TEMPERATURE, VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD | ||
|
||
import asyncio | ||
|
||
|
||
async def search_engine_iter(query: str): | ||
response = await search_engine_chat(query=query, | ||
search_engine_name="bing", | ||
model_name=LLM_MODEL, | ||
temperature=TEMPERATURE, | ||
history=[], | ||
top_k = VECTOR_SEARCH_TOP_K, | ||
prompt_name = "knowledge_base_chat", | ||
stream=False) | ||
|
||
contents = "" | ||
async for data in response.body_iterator: # 这里的data是一个json字符串 | ||
data = json.loads(data) | ||
contents = data["answer"] | ||
docs = data["docs"] | ||
return contents | ||
|
||
def search_internet(query: str): | ||
return asyncio.run(search_engine_iter(query)) | ||
|
||
|
||
if __name__ == "__main__": | ||
result = search_internet("大数据男女比例") | ||
print("答案:",result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## 单独运行的时候需要添加 | ||
import sys | ||
import os | ||
import json | ||
|
||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) | ||
from server.chat.knowledge_base_chat import knowledge_base_chat | ||
from configs import LLM_MODEL, TEMPERATURE, VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD | ||
|
||
import asyncio | ||
|
||
|
||
async def search_knowledge_base_iter(query: str): | ||
response = await knowledge_base_chat(query=query, | ||
knowledge_base_name="tcqa", | ||
model_name=LLM_MODEL, | ||
temperature=TEMPERATURE, | ||
history=[], | ||
top_k = VECTOR_SEARCH_TOP_K, | ||
prompt_name = "knowledge_base_chat", | ||
score_threshold = SCORE_THRESHOLD, | ||
stream=False) | ||
|
||
contents = "" | ||
async for data in response.body_iterator: # 这里的data是一个json字符串 | ||
data = json.loads(data) | ||
contents = data["answer"] | ||
docs = data["docs"] | ||
return contents | ||
|
||
def search_knowledge(query: str): | ||
return asyncio.run(search_knowledge_base_iter(query)) | ||
|
||
|
||
if __name__ == "__main__": | ||
result = search_knowledge("大数据男女比例") | ||
print("答案:",result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters