seawolf2357 commited on
Commit
dcb4fbe
·
verified ·
1 Parent(s): ecf84a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -143,7 +143,6 @@ with gr.Blocks(css_paths="app.css") as demo:
143
  except Exception as e:
144
  raise ValueError(f'Error calling Claude API: {str(e)}')
145
 
146
-
147
  with ms.Application() as app:
148
  with antd.ConfigProvider():
149
  # 메인 컨텐츠를 위한 Row
@@ -166,6 +165,18 @@ with gr.Blocks(css_paths="app.css") as demo:
166
  btn = antd.Button("send", type="primary", size="large")
167
  clear_btn = antd.Button("clear history", type="default", size="large")
168
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  # Modal과 Drawer 컴포넌트들
170
  with antd.Modal(open=False, title="set system Prompt", width="800px") as system_prompt_modal:
171
  systemPromptInput = antd.InputTextarea(
@@ -190,22 +201,11 @@ with gr.Blocks(css_paths="app.css") as demo:
190
  with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
191
  with antd.Tabs.Item(key="empty"):
192
  empty = antd.Empty(description="empty input", elem_classes="right_content")
193
- with antd.Tabs.Item(key="loading"):
194
- loading = antd.Spin(True, tip="coding...", size="large", elem_classes="right_content")
195
- with antd.Tabs.Item(key="render"):
196
- sandbox = gr.HTML(elem_classes="html_content")
197
-
198
- # Examples 섹션을 별도의 Row로 추가 (전체 화면 하단)
199
- with antd.Row(gutter=[0, 24], elem_classes="examples-section"):
200
- with antd.Col(span=24):
201
- antd.Divider("examples")
202
- with antd.Row(gutter=[16, 16]):
203
- with ms.Each(DEMO_LIST):
204
- with antd.Col(span=8): # 한 줄에 3개씩 (24/3 = 8)
205
- with antd.Card(hoverable=True, as_item="card") as demoCard:
206
- antd.CardMeta()
207
- demoCard.click(demo_card_click, outputs=[input])
208
-
209
  # 버튼 이벤트 핸들러
210
  settingPromptBtn.click(lambda: gr.update(
211
  open=True), inputs=[], outputs=[system_prompt_modal])
 
143
  except Exception as e:
144
  raise ValueError(f'Error calling Claude API: {str(e)}')
145
 
 
146
  with ms.Application() as app:
147
  with antd.ConfigProvider():
148
  # 메인 컨텐츠를 위한 Row
 
165
  btn = antd.Button("send", type="primary", size="large")
166
  clear_btn = antd.Button("clear history", type="default", size="large")
167
 
168
+ # Examples 섹션을 여기로 이동
169
+ antd.Divider("examples")
170
+ with antd.Flex(vertical=True, gap="small"):
171
+ for demo in DEMO_LIST:
172
+ with antd.Card(hoverable=True) as demoCard:
173
+ antd.CardMeta(title=demo.get('title', 'Example'))
174
+ demoCard.click(
175
+ fn=lambda x, d=demo: d['description'],
176
+ inputs=[gr.State(None)],
177
+ outputs=[input]
178
+ )
179
+
180
  # Modal과 Drawer 컴포넌트들
181
  with antd.Modal(open=False, title="set system Prompt", width="800px") as system_prompt_modal:
182
  systemPromptInput = antd.InputTextarea(
 
201
  with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
202
  with antd.Tabs.Item(key="empty"):
203
  empty = antd.Empty(description="empty input", elem_classes="right_content")
204
+ with antd.Tabs.Item(key="loading"):
205
+ loading = antd.Spin(True, tip="coding...", size="large", elem_classes="right_content")
206
+ with antd.Tabs.Item(key="render"):
207
+ sandbox = gr.HTML(elem_classes="html_content")
208
+
 
 
 
 
 
 
 
 
 
 
 
209
  # 버튼 이벤트 핸들러
210
  settingPromptBtn.click(lambda: gr.update(
211
  open=True), inputs=[], outputs=[system_prompt_modal])