tax-free commited on
Commit
f0623c6
·
verified ·
1 Parent(s): ee81035

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -12,8 +12,6 @@ import json
12
 
13
  # ユーザーの諸々の情報やプロンプトを受け取り返答する
14
  def search_teacher(job_type, job_start_dates, tool_function_arguments):
15
- time.sleep(1)
16
-
17
  user_request = ', '.join(list(tool_function_arguments.values())[:-2])
18
  user_message_embedded_vector = \
19
  client.embeddings.create(input=[user_request.replace("\n", " ")], model='text-embedding-3-small').data[
@@ -118,9 +116,6 @@ def openai_api(job_type, job_start_dates, history):
118
 
119
 
120
  def user(user_job_type, user_job_start_date, user_message, history):
121
- gr.Info(str(user_job_type))
122
- gr.Info(str(user_job_start_date))
123
-
124
  return None, history + [[user_message, None]]
125
 
126
 
@@ -174,9 +169,6 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
174
 
175
  thread = client.beta.threads.create()
176
 
177
- # これがhistoryを保持
178
- chatbot = gr.Chatbot(show_copy_button=True)
179
-
180
  # これがuser_job_typeを保持 (str型)
181
  job_type = gr.Radio(["常勤", "非常勤"],
182
  label="Job Type",
@@ -190,6 +182,10 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
190
  # これがuser_messageを保持
191
  msg = gr.Textbox(label="input message",
192
  info="課題について教えてください(例:国語の先生を探しています)")
 
 
 
 
193
  clear = gr.Button("clear history")
194
 
195
  msg.submit(user,
 
12
 
13
  # ユーザーの諸々の情報やプロンプトを受け取り返答する
14
  def search_teacher(job_type, job_start_dates, tool_function_arguments):
 
 
15
  user_request = ', '.join(list(tool_function_arguments.values())[:-2])
16
  user_message_embedded_vector = \
17
  client.embeddings.create(input=[user_request.replace("\n", " ")], model='text-embedding-3-small').data[
 
116
 
117
 
118
  def user(user_job_type, user_job_start_date, user_message, history):
 
 
 
119
  return None, history + [[user_message, None]]
120
 
121
 
 
169
 
170
  thread = client.beta.threads.create()
171
 
 
 
 
172
  # これがuser_job_typeを保持 (str型)
173
  job_type = gr.Radio(["常勤", "非常勤"],
174
  label="Job Type",
 
182
  # これがuser_messageを保持
183
  msg = gr.Textbox(label="input message",
184
  info="課題について教えてください(例:国語の先生を探しています)")
185
+
186
+ # これがhistoryを保持
187
+ chatbot = gr.Chatbot(show_copy_button=True)
188
+
189
  clear = gr.Button("clear history")
190
 
191
  msg.submit(user,