Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,11 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
86 |
)
|
87 |
|
88 |
del os.environ["OPENAI_API_KEY"]
|
89 |
-
|
|
|
|
|
|
|
|
|
90 |
return result
|
91 |
|
92 |
gr.close_all()
|
@@ -94,9 +98,9 @@ gr.close_all()
|
|
94 |
demo = gr.Interface(
|
95 |
fn = invoke,
|
96 |
inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
|
97 |
-
gr.Textbox(label = "Prompt", value = "
|
98 |
gr.Radio([RAG_OFF, RAG_LANGCHAIN, RAG_LLAMAINDEX], label = "Retrieval-Augmented Generation", value = RAG_LANGCHAIN)],
|
99 |
-
outputs = [gr.Textbox(label = "Completion")],
|
100 |
title = "Context-Aware Reasoning Application",
|
101 |
description = os.environ["DESCRIPTION"],
|
102 |
examples = [["sk-<BringYourOwn>", "What are GPT-4's media capabilities in 5 emojis and 1 sentence?", RAG_LANGCHAIN],
|
|
|
86 |
)
|
87 |
|
88 |
del os.environ["OPENAI_API_KEY"]
|
89 |
+
|
90 |
+
print("###")
|
91 |
+
print(result)
|
92 |
+
print("###")
|
93 |
+
|
94 |
return result
|
95 |
|
96 |
gr.close_all()
|
|
|
98 |
demo = gr.Interface(
|
99 |
fn = invoke,
|
100 |
inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
|
101 |
+
gr.Textbox(label = "Prompt", value = "What is the GPT-4 API's cost and rate limit? Answer in English, Arabic, Chinese, Hindi, and Russian in JSON format.", lines = 1),
|
102 |
gr.Radio([RAG_OFF, RAG_LANGCHAIN, RAG_LLAMAINDEX], label = "Retrieval-Augmented Generation", value = RAG_LANGCHAIN)],
|
103 |
+
outputs = [gr.Textbox(label = "Completion", value = os.environ["COMPLETION"])],
|
104 |
title = "Context-Aware Reasoning Application",
|
105 |
description = os.environ["DESCRIPTION"],
|
106 |
examples = [["sk-<BringYourOwn>", "What are GPT-4's media capabilities in 5 emojis and 1 sentence?", RAG_LANGCHAIN],
|