Spaces:
Running
on
Zero
Running
on
Zero
tee
Browse files
mysite/interpreter/interpreter.py
CHANGED
@@ -20,7 +20,7 @@ def set_environment_variables():
|
|
20 |
|
21 |
# Set the environment variable.
|
22 |
def chat_with_interpreter(
|
23 |
-
message, history, a=None, b=None, c=None, d=None
|
24 |
): # , openai_api_key):
|
25 |
# Set the API key for the interpreter
|
26 |
# interpreter.llm.api_key = openai_api_key
|
|
|
20 |
|
21 |
# Set the environment variable.
|
22 |
def chat_with_interpreter(
|
23 |
+
message, history=None, a=None, b=None, c=None, d=None
|
24 |
): # , openai_api_key):
|
25 |
# Set the API key for the interpreter
|
26 |
# interpreter.llm.api_key = openai_api_key
|
mysite/routers/fastapi.py
CHANGED
@@ -12,7 +12,7 @@ from mysite.libs.utilities import validate_signature, no_process_file
|
|
12 |
#from mysite.database.database import ride,create_ride
|
13 |
from controllers.gra_04_database.rides import test_set_lide
|
14 |
from mysite.interpreter.prompt import prompt_genalate,test_prompt
|
15 |
-
from mysite.interpreter.google_chat import send_google_chat_card
|
16 |
|
17 |
logger = logging.getLogger(__name__)
|
18 |
|
@@ -47,6 +47,7 @@ def include_routers(app):
|
|
47 |
logger.error(f"Module not found: {e}")
|
48 |
except Exception as e:
|
49 |
logger.error(f"An error occurred: {e}")
|
|
|
50 |
|
51 |
#from routers.webhooks import router
|
52 |
def setup_webhook_routes(app: FastAPI):
|
@@ -178,8 +179,12 @@ def setup_webhook_routes(app: FastAPI):
|
|
178 |
#test_prompt
|
179 |
res = test_prompt("返信は必ず日本語でして下さい "+prompt_res,text)
|
180 |
send_google_chat_card(webhook_url, "プロンプトテスト "+first_line, str(res), link_text, link_url)
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
|
|
183 |
|
184 |
#
|
185 |
return
|
|
|
12 |
#from mysite.database.database import ride,create_ride
|
13 |
from controllers.gra_04_database.rides import test_set_lide
|
14 |
from mysite.interpreter.prompt import prompt_genalate,test_prompt
|
15 |
+
from mysite.interpreter.google_chat import send_google_chat_card,chat_with_interpreter
|
16 |
|
17 |
logger = logging.getLogger(__name__)
|
18 |
|
|
|
47 |
logger.error(f"Module not found: {e}")
|
48 |
except Exception as e:
|
49 |
logger.error(f"An error occurred: {e}")
|
50 |
+
from datetime import datetime
|
51 |
|
52 |
#from routers.webhooks import router
|
53 |
def setup_webhook_routes(app: FastAPI):
|
|
|
179 |
#test_prompt
|
180 |
res = test_prompt("返信は必ず日本語でして下さい "+prompt_res,text)
|
181 |
send_google_chat_card(webhook_url, "プロンプトテスト "+first_line, str(res), link_text, link_url)
|
182 |
+
now = datetime.now()
|
183 |
+
yyyymmddhis = now.strftime('%Y%m%d%H%M%S')
|
184 |
+
|
185 |
+
print(yyyymmddhis)
|
186 |
+
no_process_file("下記のコードをdjangoで作成"+res, "gpt_enginner"+ yyyymmddhis)
|
187 |
+
chat_with_interpreter(res)
|
188 |
|
189 |
#
|
190 |
return
|