Update app.py
Browse files
app.py
CHANGED
@@ -63,12 +63,12 @@ def try_api(message, openai_api_key):
|
|
63 |
def call_api(message, openai_api_key):
|
64 |
|
65 |
print("starting open ai")
|
66 |
-
|
67 |
openai.api_key = openai_api_key
|
68 |
|
69 |
response = openai.Completion.create(
|
70 |
model="text-davinci-003",
|
71 |
-
prompt=
|
72 |
temperature=0.5,
|
73 |
max_tokens=2048,
|
74 |
top_p=1,
|
@@ -111,6 +111,10 @@ article = """
|
|
111 |
</div>
|
112 |
"""
|
113 |
|
|
|
|
|
|
|
|
|
114 |
with gr.Blocks(css="style.css") as demo:
|
115 |
|
116 |
with gr.Column(elem_id="col-container"):
|
|
|
63 |
def call_api(message, openai_api_key):
|
64 |
|
65 |
print("starting open ai")
|
66 |
+
augmented_prompt = message + prevent_code_gen
|
67 |
openai.api_key = openai_api_key
|
68 |
|
69 |
response = openai.Completion.create(
|
70 |
model="text-davinci-003",
|
71 |
+
prompt=augmented_prompt,
|
72 |
temperature=0.5,
|
73 |
max_tokens=2048,
|
74 |
top_p=1,
|
|
|
111 |
</div>
|
112 |
"""
|
113 |
|
114 |
+
prevent_code_gen = """
|
115 |
+
If i am asking for code generation, do not provide me with code. Instead, give me a summury of good hints about how i could do what i asked, but shortly.
|
116 |
+
If i am not asking for code generation, do as usual.
|
117 |
+
"""
|
118 |
with gr.Blocks(css="style.css") as demo:
|
119 |
|
120 |
with gr.Column(elem_id="col-container"):
|