Commit
•
2ac940f
1
Parent(s):
97faea5
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,13 @@ import os
|
|
5 |
import fileinput
|
6 |
from dotenv import load_dotenv
|
7 |
|
8 |
-
title="
|
9 |
inputs_label="支援対象の情報を教えてください"
|
10 |
outputs_label="AIの支援プラン"
|
11 |
description="""
|
12 |
あなたが入力した情報を参照して、AIが支援プランを提案します。
|
13 |
-
2023-05-01 v1.1
|
|
|
14 |
"""
|
15 |
|
16 |
|
@@ -79,10 +80,10 @@ class OpenAI:
|
|
79 |
content = result["choices"][0]["message"]["content"].strip()
|
80 |
return content
|
81 |
|
82 |
-
class
|
83 |
|
84 |
@classmethod
|
85 |
-
def
|
86 |
template = get_filetext(filename="template.md")
|
87 |
prompt = f"""
|
88 |
{user_message}
|
@@ -94,14 +95,14 @@ class NajiminoAI:
|
|
94 |
return prompt
|
95 |
|
96 |
@classmethod
|
97 |
-
def
|
98 |
-
prompt =
|
99 |
start_with = ""
|
100 |
result = OpenAI.chat_completion(prompt=prompt, start_with=start_with)
|
101 |
return result
|
102 |
|
103 |
def main():
|
104 |
-
iface = gr.Interface(fn=
|
105 |
inputs=gr.Textbox(label=inputs_label),
|
106 |
outputs=gr.Textbox(label=outputs_label),
|
107 |
title=title,
|
|
|
5 |
import fileinput
|
6 |
from dotenv import load_dotenv
|
7 |
|
8 |
+
title="支援プラン作成アシスタントβ-GPT-4 v2.0"
|
9 |
inputs_label="支援対象の情報を教えてください"
|
10 |
outputs_label="AIの支援プラン"
|
11 |
description="""
|
12 |
あなたが入力した情報を参照して、AIが支援プランを提案します。
|
13 |
+
2023-05-01-GPT-4 v1.1
|
14 |
+
2023-05-07-GPT-4 v2.0
|
15 |
"""
|
16 |
|
17 |
|
|
|
80 |
content = result["choices"][0]["message"]["content"].strip()
|
81 |
return content
|
82 |
|
83 |
+
class MasasanAI:
|
84 |
|
85 |
@classmethod
|
86 |
+
def generate_plan_prompt(cls, user_message):
|
87 |
template = get_filetext(filename="template.md")
|
88 |
prompt = f"""
|
89 |
{user_message}
|
|
|
95 |
return prompt
|
96 |
|
97 |
@classmethod
|
98 |
+
def generate_plan(cls, user_message):
|
99 |
+
prompt = MasasanAI.generate_plan_prompt(user_message);
|
100 |
start_with = ""
|
101 |
result = OpenAI.chat_completion(prompt=prompt, start_with=start_with)
|
102 |
return result
|
103 |
|
104 |
def main():
|
105 |
+
iface = gr.Interface(fn=MasasanAI.generate_emo,
|
106 |
inputs=gr.Textbox(label=inputs_label),
|
107 |
outputs=gr.Textbox(label=outputs_label),
|
108 |
title=title,
|