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 if 'GOOGLE_API_KEY' in os.environ: GOOGLE_API_KEY = os.environ['GOOGLE_API_KEY'] else: with open('KEY_GOOGLE_AI', 'r') as file: GOOGLE_API_KEY = file.read().replace('\n', '') genai.configure(api_key=GOOGLE_API_KEY) USE_BEST_EXTRACTOR = True sao_paulo_timezone = pytz.timezone('America/Sao_Paulo') #CURRENT_DATE = datetime.now(sao_paulo_timezone) 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' More information: - ignore matches for youth (under-20) and women leagues - example output: ``` PSG 0 x 1 Borussia Dortmund - Champions League - finished Palmeiras 0 x 2 Atletico Paranaense - Campeonato Brasileiro - Série A - finished ``` ''' if USE_BEST_EXTRACTOR: EXTRACTOR_MODEL = genai.GenerativeModel('gemini-1.5-pro-latest', system_instruction=SYSTEM_PROMPT) # TODO: setar uma temperatura bem baixa! else: EXTRACTOR_MODEL = genai.GenerativeModel('gemini-1.0-pro') START_MAIS_POP_SECTION = "