Jack há 11 meses atrás
pai
commit
b273bbe525
3 ficheiros alterados com 27 adições e 20 exclusões
  1. 10 13
      api_ollama.py
  2. 7 7
      main.py
  3. 10 0
      requirements.txt

+ 10 - 13
api_ollama.py

@@ -1,8 +1,5 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 import time
 import time
-import subprocess
-import sys
-import timeit
 from ollama import Client as oClient
 from ollama import Client as oClient
 
 
 class ChatBot:
 class ChatBot:
@@ -27,13 +24,13 @@ class ChatBot:
             print(f"\n发生错误: {e}")
             print(f"\n发生错误: {e}")
 
 
 
 
-if __name__ == "__main__":
-    C = ChatBot('http://192.168.31.28:11434', 'hello,你好呀', 'llava:13b')
-    start_time = time.time()
-
-    response_context = C.start_chat()
-    print(response_context)
-
-    end_time = time.time()
-    run_time = end_time - start_time
-    print(f"程序运行时间:{run_time} 秒\n")
+# if __name__ == "__main__":
+#     C = ChatBot('http://127.0.0.1:11434', 'hello,你好呀', 'llava:13b')
+#     start_time = time.time()
+#
+#     response_context = C.start_chat()
+#     print(response_context)
+#
+#     end_time = time.time()
+#     run_time = end_time - start_time
+#     print(f"程序运行时间:{run_time} 秒\n")

+ 7 - 7
main.py

@@ -10,7 +10,7 @@ from api_kimi import *
 from api_deepseek import *
 from api_deepseek import *
 from send_to_email import *
 from send_to_email import *
 
 
-key = 'A'
+key = 'web3'
 
 
 
 
 class AINEWS:
 class AINEWS:
@@ -106,13 +106,13 @@ class AINEWS:
             return text
             return text
 
 
     def main(self, target_url_list, prompt_words):
     def main(self, target_url_list, prompt_words):
-        # text = asyncio.run(self.get_htmls(target_url_list))
-        #
-        # self.save_to_txt(text)
-        #
-        # prompt_words += text
+        text = asyncio.run(self.get_htmls(target_url_list))
 
 
-        C = ChatBot('http://192.168.31.28:11434', '你好', 'llava:13b')
+        self.save_to_txt(text)
+
+        prompt_words += text
+
+        C = ChatBot('http://127.0.0.1:11434', prompt_words, 'llava:13b')
         response_context = C.start_chat()
         response_context = C.start_chat()
         print(response_context)
         print(response_context)
 
 

+ 10 - 0
requirements.txt

@@ -1,6 +1,9 @@
 annotated-types==0.7.0
 annotated-types==0.7.0
 anyio==4.8.0
 anyio==4.8.0
+beautifulsoup4==4.12.3
 certifi==2024.12.14
 certifi==2024.12.14
+charset-normalizer==3.4.1
+distro==1.9.0
 exceptiongroup==1.2.2
 exceptiongroup==1.2.2
 gotify==0.6.0
 gotify==0.6.0
 greenlet==3.1.1
 greenlet==3.1.1
@@ -8,10 +11,17 @@ h11==0.14.0
 httpcore==1.0.7
 httpcore==1.0.7
 httpx==0.27.2
 httpx==0.27.2
 idna==3.10
 idna==3.10
+jiter==0.8.2
+matrix-client==0.4.0
 ollama==0.4.5
 ollama==0.4.5
+openai==1.59.6
 playwright==1.49.1
 playwright==1.49.1
 pydantic==2.10.5
 pydantic==2.10.5
 pydantic_core==2.27.2
 pydantic_core==2.27.2
 pyee==12.0.0
 pyee==12.0.0
+requests==2.32.3
 sniffio==1.3.1
 sniffio==1.3.1
+soupsieve==2.6
+tqdm==4.67.1
 typing_extensions==4.12.2
 typing_extensions==4.12.2
+urllib3==1.26.20