mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
fix conflict
This commit is contained in:
parent
c68f882e14
commit
53d333ffa9
6 changed files with 33 additions and 39 deletions
|
|
@ -6,11 +6,13 @@
|
|||
"""
|
||||
import asyncio
|
||||
|
||||
from langchain.embeddings import OpenAIEmbeddings
|
||||
|
||||
from metagpt.config import CONFIG
|
||||
from metagpt.const import DATA_PATH
|
||||
from metagpt.document_store import FaissStore
|
||||
from metagpt.logs import logger
|
||||
from metagpt.roles import Sales
|
||||
from metagpt.schema import Message
|
||||
|
||||
""" example.json, e.g.
|
||||
[
|
||||
|
|
@ -26,13 +28,15 @@ from metagpt.schema import Message
|
|||
"""
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
async def search():
|
||||
store = FaissStore(DATA_PATH / "example.json")
|
||||
role = Sales(profile="Sales", store=store)
|
||||
queries = [
|
||||
Message(content="Which facial cleanser is good for oily skin?"),
|
||||
Message(content="Is L'Oreal good to use?"),
|
||||
]
|
||||
role = Sales(profile="Sales", store=get_store())
|
||||
queries = ["Which facial cleanser is good for oily skin?", "Is L'Oreal good to use?"]
|
||||
|
||||
for query in queries:
|
||||
logger.info(f"User: {query}")
|
||||
result = await role.run(query)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue