Update app.py
Browse files
app.py
CHANGED
@@ -133,12 +133,11 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
133 |
raise ValueError(f'Error calling Claude API: {str(e)}')
|
134 |
|
135 |
|
136 |
-
|
137 |
with ms.Application() as app:
|
138 |
with antd.ConfigProvider():
|
|
|
139 |
with antd.Row(gutter=[32, 12]) as layout:
|
140 |
-
|
141 |
-
# ์ข์ธก ํจ๋ ๋ถ๋ถ ์์
|
142 |
with antd.Col(span=24, md=8):
|
143 |
with antd.Flex(vertical=True, gap="middle", wrap=True):
|
144 |
header = gr.HTML(f"""
|
@@ -153,26 +152,29 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
153 |
placeholder=random.choice(DEMO_LIST)['description']
|
154 |
)
|
155 |
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
158 |
|
159 |
-
|
160 |
-
antd.Divider("Try
|
161 |
|
162 |
-
|
|
|
163 |
"๋ค์ด๋๋ฏน ์ฐจํธ ๋์ฌ๋ณด๋",
|
164 |
type="default",
|
165 |
-
block=True,
|
166 |
size="large"
|
167 |
)
|
168 |
-
|
169 |
fn=lambda: "Create an interactive dashboard with Chart.js showing different types of charts (line, bar, pie) with smooth animations. Include buttons to switch between different data views.",
|
170 |
inputs=[],
|
171 |
outputs=[input]
|
172 |
)
|
173 |
|
174 |
-
|
175 |
-
# ๋ ๋ฒ์งธ ์์ ๋ฒํผ
|
176 |
example_btn2 = antd.Button(
|
177 |
"์นด๋ ๊ธฐ์ต ๊ฒ์",
|
178 |
type="default",
|
@@ -185,7 +187,7 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
185 |
outputs=[input]
|
186 |
)
|
187 |
|
188 |
-
|
189 |
with antd.Modal(open=False, title="set system Prompt", width="800px") as system_prompt_modal:
|
190 |
systemPromptInput = antd.InputTextarea(
|
191 |
SystemPrompt, auto_size=True)
|
@@ -196,6 +198,7 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
196 |
with antd.Drawer(open=False, title="history", placement="left", width="900px") as history_drawer:
|
197 |
history_output = legacy.Chatbot(show_label=False, flushing=False, height=960, elem_classes="history_chatbot")
|
198 |
|
|
|
199 |
with antd.Col(span=24, md=16):
|
200 |
with ms.Div(elem_classes="right_panel"):
|
201 |
with antd.Flex(gap="small", elem_classes="setting-buttons"):
|
@@ -213,6 +216,9 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
213 |
with antd.Tabs.Item(key="render"):
|
214 |
sandbox = gr.HTML(elem_classes="html_content")
|
215 |
|
|
|
|
|
|
|
216 |
settingPromptBtn.click(lambda: gr.update(
|
217 |
open=True), inputs=[], outputs=[system_prompt_modal])
|
218 |
system_prompt_modal.ok(lambda input: ({"system": input}, gr.update(
|
|
|
133 |
raise ValueError(f'Error calling Claude API: {str(e)}')
|
134 |
|
135 |
|
|
|
136 |
with ms.Application() as app:
|
137 |
with antd.ConfigProvider():
|
138 |
+
# ๋ฉ์ธ ์ปจํ
์ธ ๋ฅผ ์ํ Row
|
139 |
with antd.Row(gutter=[32, 12]) as layout:
|
140 |
+
# ์ข์ธก ํจ๋
|
|
|
141 |
with antd.Col(span=24, md=8):
|
142 |
with antd.Flex(vertical=True, gap="middle", wrap=True):
|
143 |
header = gr.HTML(f"""
|
|
|
152 |
placeholder=random.choice(DEMO_LIST)['description']
|
153 |
)
|
154 |
|
155 |
+
# ๋ฒํผ๋ค์ ๊ฐ๋ก๋ก ๋ฐฐ์นํ๊ธฐ ์ํ Flex ์ปจํ
์ด๋
|
156 |
+
with antd.Flex(gap="small", justify="space-between"):
|
157 |
+
btn = antd.Button("Send", type="primary", size="large")
|
158 |
+
execute_btn = antd.Button("Code ์คํ", type="default", size="large")
|
159 |
+
clear_btn = antd.Button("Clear", type="default", size="large")
|
160 |
|
161 |
+
# Examples ๋ฒํผ๋ค ์ถ๊ฐ
|
162 |
+
antd.Divider("Try these examples")
|
163 |
|
164 |
+
# ์ฒซ ๋ฒ์งธ ์์ ๋ฒํผ
|
165 |
+
example_btn1 = antd.Button(
|
166 |
"๋ค์ด๋๋ฏน ์ฐจํธ ๋์ฌ๋ณด๋",
|
167 |
type="default",
|
168 |
+
block=True,
|
169 |
size="large"
|
170 |
)
|
171 |
+
example_btn1.click(
|
172 |
fn=lambda: "Create an interactive dashboard with Chart.js showing different types of charts (line, bar, pie) with smooth animations. Include buttons to switch between different data views.",
|
173 |
inputs=[],
|
174 |
outputs=[input]
|
175 |
)
|
176 |
|
177 |
+
# ๋ ๋ฒ์งธ ์์ ๋ฒํผ
|
|
|
178 |
example_btn2 = antd.Button(
|
179 |
"์นด๋ ๊ธฐ์ต ๊ฒ์",
|
180 |
type="default",
|
|
|
187 |
outputs=[input]
|
188 |
)
|
189 |
|
190 |
+
# Modal๊ณผ Drawer ์ปดํฌ๋ํธ๋ค
|
191 |
with antd.Modal(open=False, title="set system Prompt", width="800px") as system_prompt_modal:
|
192 |
systemPromptInput = antd.InputTextarea(
|
193 |
SystemPrompt, auto_size=True)
|
|
|
198 |
with antd.Drawer(open=False, title="history", placement="left", width="900px") as history_drawer:
|
199 |
history_output = legacy.Chatbot(show_label=False, flushing=False, height=960, elem_classes="history_chatbot")
|
200 |
|
201 |
+
# ์ฐ์ธก ํจ๋
|
202 |
with antd.Col(span=24, md=16):
|
203 |
with ms.Div(elem_classes="right_panel"):
|
204 |
with antd.Flex(gap="small", elem_classes="setting-buttons"):
|
|
|
216 |
with antd.Tabs.Item(key="render"):
|
217 |
sandbox = gr.HTML(elem_classes="html_content")
|
218 |
|
219 |
+
|
220 |
+
|
221 |
+
|
222 |
settingPromptBtn.click(lambda: gr.update(
|
223 |
open=True), inputs=[], outputs=[system_prompt_modal])
|
224 |
system_prompt_modal.ok(lambda input: ({"system": input}, gr.update(
|