#2598·deeplake

[BUG] LangChain 和 Deeplake: 查询代码时 SelfQueryRetriever 出错

作者: kaan9700创建于 2023年9月19日更新于 2023年9月27日
标签bug

def CustomRetriever(files, dataset_path, issue):

metadata_field_info = [ AttributeInfo( name="source", description="The soruce file the chunk was extracted from", type="string", ), AttributeInfo( name="file_name", description="The name of the file the chunk was extracted from", type="string", ), AttributeInfo( name="chunk_id", description="the id of the chunk", type="string", ), ] document_content_description = "The sourcecode of a project" model = ChatOpenAI(model="GPT-4")

embeddings = OpenAIEmbeddings(disallowed_special=()) db = DeepLake(dataset_path=dataset_path, read_only=True, embedding=embeddings, exec_option='Python') docs = (db.similarity_search(query=" ", k=10000000)) retriever = SelfQueryRetriever.from_llm( model, db, document_content_description, metadata_field_info, verbose=True ) try:

Ihr Code, der den Fehler verursacht

print('TEST', retriever.get_relevant_documents( f"Which documents contain code to resolve the following issue? -> {issue}")) except ValueError as e: print(traceback.format_exc())

Here is the error:

内容来源: activeloopai/deeplake