Spaces:
Sleeping
Sleeping
Update third.py
Browse files
third.py
CHANGED
|
@@ -49,22 +49,23 @@ async def main(editable_output2, keyword_id):
|
|
| 49 |
h3_texts = [h3.get_text() for h3 in soup.find_all('h3')]
|
| 50 |
|
| 51 |
# Generate the purpose.
|
| 52 |
-
purpose = f"about {h1_text}, focusing particularly on {' and '.join(h2_texts)}, to investigate the latest information and details"
|
| 53 |
|
| 54 |
# Specify the type of information you want to research.
|
| 55 |
-
if "人物" in h1_text or any("人物" in h2_text for h2_text in h2_texts):
|
| 56 |
# If the topic is about a person, specify that you want to research their name and career.
|
| 57 |
purpose += " including the person's name and career"
|
| 58 |
-
elif "商品" in h1_text or any("商品" in h2_text for h2_text in h2_texts):
|
| 59 |
# If the topic is about a product, specify that you want to research the brand name, product name, and price.
|
| 60 |
purpose += " including the brand name, product name, and price"
|
| 61 |
-
elif "イベント" in h1_text or any("イベント" in h2_text for h2_text in h2_texts):
|
| 62 |
# If the topic is about an event, specify that you want to research the event's content, schedule, and venue.
|
| 63 |
purpose += " including the event's content, schedule, and venue"
|
| 64 |
|
| 65 |
# Convert the purpose into an instruction in the form of a question.
|
| 66 |
instruction = f"Can you research {purpose} and include specific details such as names, ages, careers, product names, service names, store names, locations, and times in your response?"
|
| 67 |
|
|
|
|
| 68 |
# Run the instruction
|
| 69 |
output_text = agent.run(instruction)
|
| 70 |
|
|
|
|
| 49 |
h3_texts = [h3.get_text() for h3 in soup.find_all('h3')]
|
| 50 |
|
| 51 |
# Generate the purpose.
|
| 52 |
+
purpose = f"about {h1_text}, focusing particularly on {' and '.join(h2_texts)} and {' and '.join(h3_texts)}, to investigate the latest information and details"
|
| 53 |
|
| 54 |
# Specify the type of information you want to research.
|
| 55 |
+
if "人物" in h1_text or any("人物" in h2_text for h2_text in h2_texts) or any("人物" in h3_text for h3_text in h3_texts):
|
| 56 |
# If the topic is about a person, specify that you want to research their name and career.
|
| 57 |
purpose += " including the person's name and career"
|
| 58 |
+
elif "商品" in h1_text or any("商品" in h2_text for h2_text in h2_texts) or any("商品" in h3_text for h3_text in h3_texts):
|
| 59 |
# If the topic is about a product, specify that you want to research the brand name, product name, and price.
|
| 60 |
purpose += " including the brand name, product name, and price"
|
| 61 |
+
elif "イベント" in h1_text or any("イベント" in h2_text for h2_text in h2_texts) or any("イベント" in h3_text for h3_text in h3_texts):
|
| 62 |
# If the topic is about an event, specify that you want to research the event's content, schedule, and venue.
|
| 63 |
purpose += " including the event's content, schedule, and venue"
|
| 64 |
|
| 65 |
# Convert the purpose into an instruction in the form of a question.
|
| 66 |
instruction = f"Can you research {purpose} and include specific details such as names, ages, careers, product names, service names, store names, locations, and times in your response?"
|
| 67 |
|
| 68 |
+
|
| 69 |
# Run the instruction
|
| 70 |
output_text = agent.run(instruction)
|
| 71 |
|