import datetime from datetime import timedelta import pytz from bs4 import BeautifulSoup import requests from datetime import datetime, timedelta import os import re import google.generativeai as genai from dotenv import load_dotenv, find_dotenv load_dotenv(find_dotenv()) # should load the GOOGLE_API_KEY genai.configure() MODEL_VERSION = "gemini-1.5-flash" #MODEL_VERSION = "gemini-1.0-pro" sao_paulo_timezone = pytz.timezone('America/Sao_Paulo') SYSTEM_PROMPT = '''You will extract soccer match information from the text extracted from a html page, and you have to output the matches in this format: [TEAM HOME] [SCORE HOME] x [SCORE AWAY] [TEAM AWAY] - [CHAMPIONSHIP NAME] - [START TIME / MATCH TIME] Regarding [START TIME / MATCH TIME]: - if the match has already started, report the elapsed time in the match - if it hasn't started, write 'not started' - if the match has finished, report 'finished' Additional instructions that you must follow: - ignore matches for youth (under-20) and women leagues - but report friendly matches, specially between national teams Example output: ``` PSG 0 x 1 Borussia Dortmund - Champions League - finished Palmeiras 0 x 2 Atletico Paranaense - Campeonato Brasileiro - Série A - finished ``` ''' if MODEL_VERSION != "gemini-1.0-pro": EXTRACTOR_MODEL = genai.GenerativeModel(MODEL_VERSION, system_instruction=SYSTEM_PROMPT) # TODO: setar uma temperatura bem baixa! else: EXTRACTOR_MODEL = genai.GenerativeModel(MODEL_VERSION) START_MAIS_POP_SECTION = "

MAIS POPULARES AGORA

" END_MAIS_POP_SECTION = "