seawolf2357 commited on
Commit
0a8529b
ยท
verified ยท
1 Parent(s): ca5fdac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -13
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
- btn = antd.Button("send", type="primary", size="large")
157
- clear_btn = antd.Button("clear history", type="default", size="large")
 
 
 
158
 
159
- # Examples ๋ฒ„ํŠผ ์ถ”๊ฐ€
160
- antd.Divider("Try this example")
161
 
162
- example_btn = antd.Button(
 
163
  "๋‹ค์ด๋‚˜๋ฏน ์ฐจํŠธ ๋Œ€์‰ฌ๋ณด๋“œ",
164
  type="default",
165
- block=True, # ์ „์ฒด ๋„ˆ๋น„ ์‚ฌ์šฉ
166
  size="large"
167
  )
168
- example_btn.click(
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(