diff --git a/dsRag/Config/__pycache__/Config.cpython-310.pyc b/dsRag/Config/__pycache__/Config.cpython-310.pyc index 303550ea..dd640b9d 100644 Binary files a/dsRag/Config/__pycache__/Config.cpython-310.pyc and b/dsRag/Config/__pycache__/Config.cpython-310.pyc differ diff --git a/dsRag/Test/TestQWen3.py b/dsRag/Test/TestQWen3.py new file mode 100644 index 00000000..d12fada8 --- /dev/null +++ b/dsRag/Test/TestQWen3.py @@ -0,0 +1,39 @@ +import requests +from Config.Config import MODEL_API_KEY, MODEL_NAME + +class QWenClient: + def __init__(self): + self.api_key = MODEL_API_KEY + self.model_name = MODEL_NAME + self.base_url = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation" + + def generate(self, prompt): + headers = { + "Authorization": f"Bearer {self.api_key}", + "Content-Type": "application/json" + } + + payload = { + "model": self.model_name, + "input": { + "messages": [ + {"role": "user", "content": prompt} + ] + } + } + + response = requests.post(self.base_url, json=payload, headers=headers) + response.raise_for_status() + return response.json() + +if __name__ == '__main__': + client = QWenClient() + while True: + prompt = input("请输入问题(输入q退出): ") + if prompt.lower() == 'q': + break + try: + result = client.generate(prompt) + print("回答:", result['output']['text']) + except Exception as e: + print(f"发生错误: {str(e)}") \ No newline at end of file diff --git a/dsRag/static/output.docx b/dsRag/static/output.docx deleted file mode 100644 index bfa0714f..00000000 Binary files a/dsRag/static/output.docx and /dev/null differ