[BUG] LangChain 和 Deeplake: 查询代码时 SelfQueryRetriever 出错
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