tuning example and config

This commit is contained in:
geekan 2023-12-25 21:47:27 +08:00
parent f93ccaf0d1
commit 9f653ea60b
6 changed files with 14 additions and 16 deletions

BIN
examples/example.faiss Normal file

Binary file not shown.

10
examples/example.json Normal file
View file

@ -0,0 +1,10 @@
[
{
"source": "Which facial cleanser is good for oily skin?",
"output": "ABC cleanser is preferred by many with oily skin."
},
{
"source": "Is L'Oreal good to use?",
"output": "L'Oreal is a popular brand with many positive reviews."
}
]

BIN
examples/example.pkl Normal file

Binary file not shown.

View file

@ -9,28 +9,15 @@ import asyncio
from langchain.embeddings import OpenAIEmbeddings
from metagpt.config import CONFIG
from metagpt.const import DATA_PATH
from metagpt.const import EXAMPLE_PATH
from metagpt.document_store import FaissStore
from metagpt.logs import logger
from metagpt.roles import Sales
""" example.json, e.g.
[
{
"source": "Which facial cleanser is good for oily skin?",
"output": "ABC cleanser is preferred by many with oily skin."
},
{
"source": "Is L'Oreal good to use?",
"output": "L'Oreal is a popular brand with many positive reviews."
}
]
"""
def get_store():
embedding = OpenAIEmbeddings(openai_api_key=CONFIG.openai_api_key, openai_api_base=CONFIG.openai_base_url)
return FaissStore(DATA_PATH / "example.json", embedding=embedding)
return FaissStore(EXAMPLE_PATH / "example.json", embedding=embedding)
async def search():