Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -120,7 +120,7 @@ def extract_content_values(data):
|
|
120 |
|
121 |
return content_values
|
122 |
|
123 |
-
def chat(message,
|
124 |
if not message:
|
125 |
raise gr.Error("Message is required.")
|
126 |
|
@@ -158,12 +158,12 @@ gr.ChatInterface(
|
|
158 |
title="Python Code Generator",
|
159 |
description="The assistant can generate code, explain, fix, optimize, document, test, and generally help with code. It can also execute code.",
|
160 |
examples=[
|
161 |
-
["Generate: NumPy/Pandas/Matplotlib & yfinance trading app"],
|
162 |
-
["Explain: r\"^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W]).{8,}$\""],
|
163 |
-
["Fix: x = [5, 2, 1, 3, 4]; print(x.sort())"],
|
164 |
-
["Optimize: x = []; for i in range(0, 10000): x.append(i)"],
|
165 |
-
["Execute: First 25 Fibbonaci numbers"],
|
166 |
-
[f"Execute: Today is {datetime.date.today()}. Create a plot showing stock gain YTD for NVDA, MSFT, AAPL, and GOOG, x-axis is 'Day' and y-axis is 'YTD Gain %'. Return the result, don't persist to storage."],
|
167 |
],
|
168 |
cache_examples=True,
|
169 |
multimodal=True,
|
|
|
120 |
|
121 |
return content_values
|
122 |
|
123 |
+
def chat(message, history):
|
124 |
if not message:
|
125 |
raise gr.Error("Message is required.")
|
126 |
|
|
|
158 |
title="Python Code Generator",
|
159 |
description="The assistant can generate code, explain, fix, optimize, document, test, and generally help with code. It can also execute code.",
|
160 |
examples=[
|
161 |
+
["text": "Generate: NumPy/Pandas/Matplotlib & yfinance trading app", "files": []}],
|
162 |
+
["text": "Explain: r\"^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W]).{8,}$\"", "files": []}],
|
163 |
+
["text": "Fix: x = [5, 2, 1, 3, 4]; print(x.sort())", "files": []}],
|
164 |
+
["text": "Optimize: x = []; for i in range(0, 10000): x.append(i)", "files": []}],
|
165 |
+
["text": "Execute: First 25 Fibbonaci numbers", "files": []}],
|
166 |
+
["text": f"Execute: Today is {datetime.date.today()}. Create a plot showing stock gain YTD for NVDA, MSFT, AAPL, and GOOG, x-axis is 'Day' and y-axis is 'YTD Gain %'. Return the result, don't persist to storage."], "files": []},
|
167 |
],
|
168 |
cache_examples=True,
|
169 |
multimodal=True,
|