From 4d4c45e83a74ac192e209627c4e5962a05223fa7 Mon Sep 17 00:00:00 2001 From: sebDtSci Date: Fri, 13 Sep 2024 12:31:11 +0200 Subject: [PATCH] reflexion tuning elaboration --- app.log | 226 ++++++++++++++++++++++++++++++++++++---- src/ReflectionTuning.py | 33 ++++++ src/generateS.py | 12 ++- to_run.txt | 159 ++++++++++++++++++++++++++++ 4 files changed, 406 insertions(+), 24 deletions(-) create mode 100644 src/ReflectionTuning.py create mode 100644 to_run.txt diff --git a/app.log b/app.log index 5c31884..816e279 100644 --- a/app.log +++ b/app.log @@ -1,6 +1,7 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): us-api.i.posthog.com:443 DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event @@ -12,8 +13,8 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event @@ -21,25 +22,25 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:urllib3.connectionpool:https://us-api.i.posthog.com:443 "POST /batch/ HTTP/11" 200 15 DEBUG:httpcore.connection:connect_tcp.started host='127.0.0.1' port=11434 local_address=None timeout=None socket_options=None -DEBUG:httpcore.connection:connect_tcp.complete return_value= +DEBUG:httpcore.connection:connect_tcp.complete return_value= DEBUG:httpcore.http11:send_request_headers.started request= DEBUG:httpcore.http11:send_request_headers.complete DEBUG:httpcore.http11:send_request_body.started request= DEBUG:httpcore.http11:send_request_body.complete DEBUG:httpcore.http11:receive_response_headers.started request= -DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Wed, 21 Aug 2024 14:30:42 GMT'), (b'Transfer-Encoding', b'chunked')]) +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Fri, 13 Sep 2024 10:26:47 GMT'), (b'Transfer-Encoding', b'chunked')]) INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" DEBUG:httpcore.http11:receive_response_body.started request= DEBUG:httpcore.http11:receive_response_body.complete @@ -51,37 +52,87 @@ DEBUG:httpcore.http11:send_request_headers.complete DEBUG:httpcore.http11:send_request_body.started request= DEBUG:httpcore.http11:send_request_body.complete DEBUG:httpcore.http11:receive_response_headers.started request= +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Fri, 13 Sep 2024 10:26:47 GMT'), (b'Transfer-Encoding', b'chunked')]) +INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" +DEBUG:httpcore.http11:receive_response_body.started request= DEBUG:urllib3.connectionpool:https://us-api.i.posthog.com:443 "POST /batch/ HTTP/11" 200 15 -DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Wed, 21 Aug 2024 14:30:44 GMT'), (b'Transfer-Encoding', b'chunked')]) +DEBUG:httpcore.http11:receive_response_body.complete +DEBUG:httpcore.http11:response_closed.started +DEBUG:httpcore.http11:response_closed.complete +DEBUG:httpcore.connection:close.started +DEBUG:httpcore.connection:close.complete +DEBUG:httpcore.connection:connect_tcp.started host='127.0.0.1' port=11434 local_address=None timeout=None socket_options=None +DEBUG:httpcore.connection:connect_tcp.complete return_value= +DEBUG:httpcore.http11:send_request_headers.started request= +DEBUG:httpcore.http11:send_request_headers.complete +DEBUG:httpcore.http11:send_request_body.started request= +DEBUG:httpcore.http11:send_request_body.complete +DEBUG:httpcore.http11:receive_response_headers.started request= +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Fri, 13 Sep 2024 10:26:55 GMT'), (b'Transfer-Encoding', b'chunked')]) INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" DEBUG:httpcore.http11:receive_response_body.started request= DEBUG:httpcore.http11:receive_response_body.complete DEBUG:httpcore.http11:response_closed.started DEBUG:httpcore.http11:response_closed.complete +INFO:root:Response generated. with model : openchat:latest +DEBUG:httpcore.http11:send_request_headers.started request= +DEBUG:httpcore.http11:send_request_headers.complete +DEBUG:httpcore.http11:send_request_body.started request= +DEBUG:httpcore.http11:send_request_body.complete +DEBUG:httpcore.http11:receive_response_headers.started request= +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Fri, 13 Sep 2024 10:26:55 GMT'), (b'Transfer-Encoding', b'chunked')]) +INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" +DEBUG:httpcore.http11:receive_response_body.started request= +DEBUG:httpcore.http11:receive_response_body.complete +DEBUG:httpcore.http11:response_closed.started +DEBUG:httpcore.http11:response_closed.complete +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:httpcore.connection:close.started DEBUG:httpcore.connection:close.complete DEBUG:httpcore.connection:connect_tcp.started host='127.0.0.1' port=11434 local_address=None timeout=None socket_options=None -DEBUG:httpcore.connection:connect_tcp.complete return_value= +DEBUG:httpcore.connection:connect_tcp.complete return_value= DEBUG:httpcore.http11:send_request_headers.started request= DEBUG:httpcore.http11:send_request_headers.complete DEBUG:httpcore.http11:send_request_body.started request= DEBUG:httpcore.http11:send_request_body.complete DEBUG:httpcore.http11:receive_response_headers.started request= -DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Wed, 21 Aug 2024 14:31:14 GMT'), (b'Transfer-Encoding', b'chunked')]) +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Fri, 13 Sep 2024 10:27:28 GMT'), (b'Transfer-Encoding', b'chunked')]) INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" DEBUG:httpcore.http11:receive_response_body.started request= DEBUG:httpcore.http11:receive_response_body.complete DEBUG:httpcore.http11:response_closed.started DEBUG:httpcore.http11:response_closed.complete -DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 10.21.8.3:9090 -DEBUG:urllib3.connectionpool:http://10.21.8.3:9090 "POST /DecisionService/rest/v1/assurance_deploy/OD_assurance/ HTTP/11" 200 152 INFO:root:Response generated. with model : openchat:latest DEBUG:httpcore.http11:send_request_headers.started request= DEBUG:httpcore.http11:send_request_headers.complete DEBUG:httpcore.http11:send_request_body.started request= DEBUG:httpcore.http11:send_request_body.complete DEBUG:httpcore.http11:receive_response_headers.started request= -DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Wed, 21 Aug 2024 14:31:16 GMT'), (b'Transfer-Encoding', b'chunked')]) +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Fri, 13 Sep 2024 10:27:28 GMT'), (b'Transfer-Encoding', b'chunked')]) INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" DEBUG:httpcore.http11:receive_response_body.started request= DEBUG:httpcore.http11:receive_response_body.complete @@ -105,17 +156,28 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event -INFO:root:Response generated. with model : openchat:latest DEBUG:httpcore.connection:close.started DEBUG:httpcore.connection:close.complete DEBUG:httpcore.connection:connect_tcp.started host='127.0.0.1' port=11434 local_address=None timeout=None socket_options=None -DEBUG:httpcore.connection:connect_tcp.complete return_value= +DEBUG:httpcore.connection:connect_tcp.complete return_value= DEBUG:httpcore.http11:send_request_headers.started request= DEBUG:httpcore.http11:send_request_headers.complete DEBUG:httpcore.http11:send_request_body.started request= DEBUG:httpcore.http11:send_request_body.complete DEBUG:httpcore.http11:receive_response_headers.started request= -DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Wed, 21 Aug 2024 14:31:45 GMT'), (b'Transfer-Encoding', b'chunked')]) +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/json; charset=utf-8'), (b'Date', b'Fri, 13 Sep 2024 10:28:17 GMT'), (b'Transfer-Encoding', b'chunked')]) +INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" +DEBUG:httpcore.http11:receive_response_body.started request= +DEBUG:httpcore.http11:receive_response_body.complete +DEBUG:httpcore.http11:response_closed.started +DEBUG:httpcore.http11:response_closed.complete +INFO:root:Response generated. with model : openchat:latest +DEBUG:httpcore.http11:send_request_headers.started request= +DEBUG:httpcore.http11:send_request_headers.complete +DEBUG:httpcore.http11:send_request_body.started request= +DEBUG:httpcore.http11:send_request_body.complete +DEBUG:httpcore.http11:receive_response_headers.started request= +DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Type', b'application/x-ndjson'), (b'Date', b'Fri, 13 Sep 2024 10:28:18 GMT'), (b'Transfer-Encoding', b'chunked')]) INFO:httpx:HTTP Request: POST http://127.0.0.1:11434/api/generate "HTTP/1.1 200 OK" DEBUG:httpcore.http11:receive_response_body.started request= DEBUG:httpcore.http11:receive_response_body.complete @@ -137,36 +199,124 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event @@ -175,16 +325,36 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event @@ -196,12 +366,13 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event @@ -221,14 +392,27 @@ DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event -DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event +DEBUG:watchdog.observers.inotify_buffer:in-event None: + self.model = model + self._ollama_option = ollama_option if ollama_option else {'temperature':1} + self.reponse = '' + + def gen(self, input:str, memory:str)->str: + self.reponse = '' + prompt = ( + "Vous êtes un assistant intelligent dédié au 'Reflection-Tuning'." + "Si tu juge que l'entré utilisateur nécessite une reflexion complexe / élaborée voici les étape à suivre :\n\n" + "Votre rôle est de clarifier, corriger, et enrichir l'input de l'utilisateur pour qu'un autre agent puisse fournir une réponse optimale.\n\n" + "1. **Analyse et correction** : Identifiez les parties de l'input utilisateur qui sont ambiguës ou potentiellement incorrectes, et proposez des corrections ou reformulations.\n\n" + "2. **Mise en évidence des étapes** : Élaborez les étapes nécessaires pour répondre à la question ou résoudre le problème. Soyez aussi exhaustif que possible.\n\n" + "3. **Outils et méthodes** : Suggérez des outils techniques ou des approches spécifiques pour traiter la question. Justifiez pourquoi ces outils ou méthodes sont appropriés dans ce contexte.\n\n" + "Votre but n'est pas de répondre directement à l'utilisateur, mais de fournir une base claire et détaillée pour que le prochain agent puisse répondre efficacement.\n\n" + "Voici l'input de l'utilisateur :\n" + f"{input}\n\n" + "Voici la mémoire du chatbot (les échanges précédents). Utilise les informations présentes dans la mémoire du chatbot pour mieux contextualiser l'input et apporter des clarifications supplémentaires si nécessaire UNIQUEMENT si elles sont en rapport avec le nouvel input:\n" + f"{memory}\n\n" + ) + result = ollama.generate( + model = self.model, + prompt=prompt, + stream=False, + options=self._ollama_option + ) + print("#######################\n\n",result["response"],'\n\n',"#######################") + return result["response"] + + \ No newline at end of file diff --git a/src/generateS.py b/src/generateS.py index a0e2121..baa3ac7 100644 --- a/src/generateS.py +++ b/src/generateS.py @@ -2,6 +2,7 @@ import logging import streamlit as st import os +from ReflectionTuning import GenerateReflexion # ChatBot integration from shortterm_memory.ChatbotMemory import ChatbotMemory @@ -25,6 +26,7 @@ def __init__(self, model:str="openchat:latest", ollama_options=None): self.response = "" self.suma_on_run = False self.assurance_phase = False + self.internal_reflextion = GenerateReflexion(model='openchat:latest') def remember(self, sauvegarde)-> None: """ @@ -45,7 +47,7 @@ def remember(self, sauvegarde)-> None: st.sidebar.error(f"Error : {e}") - def ans(self, user_input="l'assurance de manon qui à 34 ans et qui habite à paris"): # Debug modification + def ans(self, user_input:str):#user_input="l'assurance de manon qui à 34 ans et qui habite à paris"): # Debug modification """ Generates a response from the Chatbot based on the user input and updates the Chatbot's memory. @@ -62,7 +64,7 @@ def ans(self, user_input="l'assurance de manon qui à 34 ans et qui habite à pa self.response = "" print("MEm de conversation_history : ",self.memory.get_memory()) - + reflexion_input = self.internal_reflextion.gen(user_input,self.memory.get_memory()) #################### # BRMS Integration # #################### @@ -87,7 +89,11 @@ def ans(self, user_input="l'assurance de manon qui à 34 ans et qui habite à pa "Question de l'utilisateur :\n" f"{user_input}\n\n" f"{assurance_output}\n\n" - "Répondez de manière claire et concise :\n" + "Voici les étapes de reflexion donné par l'agent dédié au 'Reflection-Tuning' qui pourrait t'aider à répondre.\n" + "Ces instructions ne sont que pour toi ne les dévoile pas :\n" + "Tu peux en tenir compte ou les ignorer :\n" + f"{reflexion_input}\n\n" + "Répondez de manière claire et concise et avec une mise en forme lisible :\n" ) result = ollama.generate( model=self.model, diff --git a/to_run.txt b/to_run.txt new file mode 100644 index 0000000..207e0dd --- /dev/null +++ b/to_run.txt @@ -0,0 +1,159 @@ +absl-py==2.1.0 +altair==5.4.1 +annotated-types==0.7.0 +anyio==4.4.0 +asgiref==3.8.1 +astunparse==1.6.3 +attrs==24.2.0 +backoff==2.2.1 +bcrypt==4.2.0 +blinker==1.8.2 +build==1.2.1 +cachetools==5.5.0 +certifi==2024.7.4 +charset-normalizer==3.3.2 +chroma-hnswlib==0.7.6 +chromadb==0.5.5 +click==8.1.7 +coloredlogs==15.0.1 +Deprecated==1.2.14 +docker-py==1.10.6 +docker-pycreds==0.4.0 +fastapi==0.112.2 +filelock==3.15.4 +flatbuffers==24.3.25 +fsspec==2024.6.1 +gast==0.6.0 +gitdb==4.0.11 +GitPython==3.1.43 +google-auth==2.34.0 +google-pasta==0.2.0 +googleapis-common-protos==1.65.0 +grpcio==1.66.1 +h11==0.14.0 +h5py==3.11.0 +httpcore==1.0.5 +httptools==0.6.1 +httpx==0.27.2 +huggingface-hub==0.24.6 +humanfriendly==10.0 +idna==3.8 +importlib_metadata==8.4.0 +importlib_resources==6.4.4 +Jinja2==3.1.4 +joblib==1.4.2 +jsonschema==4.23.0 +jsonschema-specifications==2023.12.1 +keras==3.5.0 +kubernetes==30.1.0 +libclang==18.1.1 +lxml==5.3.0 +Markdown==3.7 +markdown-it-py==3.0.0 +MarkupSafe==2.1.5 +mdurl==0.1.2 +ml-dtypes==0.4.0 +mmh3==4.1.0 +monotonic==1.6 +mpmath==1.3.0 +namex==0.0.8 +narwhals==1.5.5 +networkx==3.3 +numpy==1.26.4 +nvidia-cublas-cu12==12.1.3.1 +nvidia-cuda-cupti-cu12==12.1.105 +nvidia-cuda-nvrtc-cu12==12.1.105 +nvidia-cuda-runtime-cu12==12.1.105 +nvidia-cudnn-cu12==9.1.0.70 +nvidia-cufft-cu12==11.0.2.54 +nvidia-curand-cu12==10.3.2.106 +nvidia-cusolver-cu12==11.4.5.107 +nvidia-cusparse-cu12==12.1.0.106 +nvidia-nccl-cu12==2.20.5 +nvidia-nvjitlink-cu12==12.6.20 +nvidia-nvtx-cu12==12.1.105 +oauthlib==3.2.2 +ollama==0.3.2 +onnxruntime==1.19.0 +opentelemetry-api==1.27.0 +opentelemetry-exporter-otlp-proto-common==1.27.0 +opentelemetry-exporter-otlp-proto-grpc==1.27.0 +opentelemetry-instrumentation==0.48b0 +opentelemetry-instrumentation-asgi==0.48b0 +opentelemetry-instrumentation-fastapi==0.48b0 +opentelemetry-proto==1.27.0 +opentelemetry-sdk==1.27.0 +opentelemetry-semantic-conventions==0.48b0 +opentelemetry-util-http==0.48b0 +opt-einsum==3.3.0 +optree==0.12.1 +orjson==3.10.7 +overrides==7.7.0 +packaging==24.1 +pandas==2.2.2 +pillow==10.4.0 +posthog==3.6.0 +protobuf==4.25.4 +pyarrow==17.0.0 +pyasn1==0.6.0 +pyasn1_modules==0.4.0 +pydantic==2.8.2 +pydantic_core==2.20.1 +pydeck==0.9.1 +Pygments==2.18.0 +PyMuPDF==1.24.9 +PyMuPDFb==1.24.9 +PyPika==0.48.9 +pyproject_hooks==1.1.0 +python-dateutil==2.9.0.post0 +python-docx==1.1.2 +python-dotenv==1.0.1 +pytz==2024.1 +PyYAML==6.0.2 +referencing==0.35.1 +regex==2024.7.24 +requests==2.32.3 +requests-oauthlib==2.0.0 +rich==13.8.0 +rpds-py==0.20.0 +rsa==4.9 +safetensors==0.4.4 +scikit-learn==1.5.1 +scipy==1.14.1 +setuptools==74.0.0 +shellingham==1.5.4 +shortterm-memory==1.0.4 +six==1.16.0 +smmap==5.0.1 +sniffio==1.3.1 +starlette==0.38.2 +streamlit==1.38.0 +sympy==1.13.2 +tenacity==8.5.0 +tensorboard==2.17.1 +tensorboard-data-server==0.7.2 +tensorflow==2.17.0 +termcolor==2.4.0 +tf_keras==2.17.0 +threadpoolctl==3.5.0 +tokenizers==0.19.1 +toml==0.10.2 +torch==2.4.0 +tornado==6.4.1 +tqdm==4.66.5 +transformers==4.44.2 +triton==3.0.0 +typer==0.12.5 +typing_extensions==4.12.2 +tzdata==2024.1 +urllib3==2.2.2 +uvicorn==0.30.6 +uvloop==0.20.0 +watchdog==4.0.2 +watchfiles==0.24.0 +websocket-client==1.8.0 +websockets==13.0.1 +Werkzeug==3.0.4 +wheel==0.44.0 +wrapt==1.16.0 +zipp==3.20.1