mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
fix: ruff
This commit is contained in:
@@ -53,4 +53,4 @@ if __name__ == "__main__":
|
||||
question='What is the largest planet in our solar system?' answer='Jupiter'
|
||||
question="Who wrote 'To Kill a Mockingbird'?" answer='Harper Lee'
|
||||
question="What element does 'O' represent on the periodic table?" answer='Oxygen'
|
||||
"""
|
||||
"""
|
||||
|
||||
@@ -9,12 +9,12 @@ client = instructor.patch(openai.OpenAI())
|
||||
|
||||
def extract_video_id(url: str) -> str | None:
|
||||
import re
|
||||
|
||||
match = re.search(r"v=([a-zA-Z0-9_-]+)", url)
|
||||
if match:
|
||||
return match.group(1)
|
||||
|
||||
|
||||
|
||||
class TranscriptSegment(BaseModel):
|
||||
source_id: int
|
||||
start: float
|
||||
@@ -95,7 +95,6 @@ if __name__ == "__main__":
|
||||
console = Console()
|
||||
url = Prompt.ask("Enter a YouTube URL")
|
||||
|
||||
|
||||
with console.status("[bold green]Processing YouTube URL...") as status:
|
||||
video_id = extract_video_id(url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user