(self, question: Optional[str], topK: Optional[int] = 4, fileID: Optional[str] = None)
| 97 | return fileID |
| 98 | |
| 99 | def askQuestion(self, question: Optional[str], topK: Optional[int] = 4, fileID: Optional[str] = None): |
| 100 | # TODO 查询embedding |
| 101 | # db = Chroma.from_texts(documents, OpenAIEmbeddings()) |
| 102 | # docs = db.similarity_search(query=question, k=topK) |
| 103 | docs = self.embeddingHelper.similarity_search(query=question, collectionId=fileID, topK=topK) |
| 104 | |
| 105 | question = self.prompt.format(context=docs, question=question) |
| 106 | return self.llm.generate_response(input_text=question) |
| 107 | |
| 108 | |
| 109 | class SqlGPT: |
no test coverage detected