jack hace 11 meses
padre
commit
8a699f2e61
Se han modificado 2 ficheros con 5 adiciones y 3 borrados
  1. 1 1
      api_ollama.py
  2. 4 2
      main.py

+ 1 - 1
api_ollama.py

@@ -14,7 +14,7 @@ class OllamaChat(object):
         try:
             response_iter = self.client.chat(model=self.model,
                                              messages=[
-                                                 {'role': 'system', 'content': '你是一个新闻整理专员'},
+                                                 {'role': 'system', 'content': '你是一个新闻报播员'},
                                                  {'role': 'user', 'content': self.messages}
                                              ],
                                              options={"temperature": self.temperature},

+ 4 - 2
main.py

@@ -105,11 +105,13 @@ class AINEWS:
 
         self.save_to_txt(url_to_text)
 
-        prompt_words += '帮我总结一下内容, 并且分析一下今天数字币为什么会跌'
+        role = '你是一个新闻报播员'
+
+        prompt_words += ''
 
         O = OllamaChat()
         for k, v in url_to_text.items():
-            response_context = O.call_ollama('http://127.0.0.1:11434', v, prompt_words)
+            response_context = O.call_ollama('http://127.0.0.1:11434', role, v, prompt_words)
             message = f'{k}\n{response_context}\n'
 
             # 发送消息