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(