diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 04ac642..f8fce49 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,8 +6,7 @@ - - + - { + "keyToString": { + "Python.HistoryRAG.executor": "Run", + "Python.RAG.executor": "Run", + "Python.embedding.executor": "Run", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "com.google.cloudcode.ide_session_index": "20240519_0002", + "git-widget-placeholder": "detached", + "last_opened_file_path": "G:/code/py/LLM", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable", + "vue.rearranger.settings.migration": "true" } -}]]> +} @@ -110,6 +109,11 @@ + + + + + - @@ -181,6 +193,6 @@ - + \ No newline at end of file diff --git a/src/serve/HistoryRAG.py b/src/serve/HistoryRAG.py index 2fe1a98..bcbe6e8 100644 --- a/src/serve/HistoryRAG.py +++ b/src/serve/HistoryRAG.py @@ -60,7 +60,18 @@ class HistoryRAG(RAG): if __name__ == '__main__': - hr = HistoryRAG("C:\\Users\\16922\\Desktop\\文档1.pdf") - print(hr.get_chat("what can Multimodal Agent AI systems do?")) - print(hr.get_chat(input())) + print("welcome to use RAG question, input exit() to end") + try: + file_path = input("please input file path:").strip('"') + if not len(file_path): + raise ValueError("path not be empty") + except ValueError: + print("arise error:" + repr(ValueError)) + finally: + hr = HistoryRAG(file_path) + while True: + chat = input("user:") + if chat == "exit()": + break + print("system:" + hr.get_chat(chat))