Thanh Vinh Vo
commited on
Commit
·
dd59d44
1
Parent(s):
66e7772
update
Browse files
app.py
CHANGED
|
@@ -2,12 +2,13 @@ import inspect
|
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
from io import BytesIO
|
|
|
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
import pandas as pd
|
| 8 |
import requests
|
| 9 |
import whisper
|
| 10 |
-
from bs4 import BeautifulSoup
|
| 11 |
from PIL import Image
|
| 12 |
from smolagents import (
|
| 13 |
CodeAgent,
|
|
@@ -190,7 +191,9 @@ def get_wikipedia_page_url_by_year(wikipedia_page_name: str, year: int) -> str:
|
|
| 190 |
|
| 191 |
|
| 192 |
@tool
|
| 193 |
-
def get_wikipedia_section(
|
|
|
|
|
|
|
| 194 |
"""
|
| 195 |
A tool that extracts a specific section from a Wikipedia page using BeautifulSoup.
|
| 196 |
|
|
|
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
from io import BytesIO
|
| 5 |
+
from typing import Optional
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
import pandas as pd
|
| 9 |
import requests
|
| 10 |
import whisper
|
| 11 |
+
from bs4 import BeautifulSoup, NavigableString, Tag
|
| 12 |
from PIL import Image
|
| 13 |
from smolagents import (
|
| 14 |
CodeAgent,
|
|
|
|
| 191 |
|
| 192 |
|
| 193 |
@tool
|
| 194 |
+
def get_wikipedia_section(
|
| 195 |
+
section_name: str, soup_object: BeautifulSoup
|
| 196 |
+
) -> Tag | NavigableString | None:
|
| 197 |
"""
|
| 198 |
A tool that extracts a specific section from a Wikipedia page using BeautifulSoup.
|
| 199 |
|