YKajima commited on
Commit
78d5f9d
1 Parent(s): f7a2953

add if-esle statement

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -7,10 +7,19 @@ def greet(name):
7
 
8
 
9
  async def summarize(input_text: str, input_url: str):
10
- _prompt = f"""
11
- 以下の文章を要約してください。
12
- {input_text}
13
- """
 
 
 
 
 
 
 
 
 
14
 
15
  config = FilmConfig(
16
  "gpt-3.5-turbo",
 
7
 
8
 
9
  async def summarize(input_text: str, input_url: str):
10
+ if input_text:
11
+ _prompt = f"""
12
+ 以下の文章を要約してください。
13
+ {input_text}
14
+ """
15
+ elif input_url:
16
+ url_content = "URLのコンテンツを取得したものを代入します"
17
+ _prompt = f"""
18
+ 以下の文章を要約してください。
19
+ {url_content}
20
+ """
21
+ else:
22
+ _prompt = "文章が入力されていないことを主張してください。"
23
 
24
  config = FilmConfig(
25
  "gpt-3.5-turbo",