diff --git a/myice/myice.py b/myice/myice.py index 9b04e20..30fda3b 100755 --- a/myice/myice.py +++ b/myice/myice.py @@ -146,7 +146,7 @@ def get_schedule() -> str: global userid assert session and userid now = datetime.datetime.now() - date_start = now + datetime.timedelta(days=1) + date_start = now date_end = date_start + datetime.timedelta(days=7) r = session.post( "https://app.myice.hockey/inc/processclubplanning.php", @@ -312,9 +312,22 @@ def check_with_ai( sys.exit(1) with schedule_file.open("r") as f: schedule_data = json.load(f) - system = ( - "Tu es une IA connaissant bien les données suivantes, qui décrivent les match et entraînements d'équipes de hockey sur glace:\n" - + json.dumps(schedule_data) + schedule_data = [x for x in schedule_data if x["agegroup"] in AgeGroup] + for event in schedule_data: + event["team"] = event["agegroup"].replace("(", "").replace(")", "") + del event["agegroup"] + when = datetime.datetime.now().strftime("%d-%m-%Y et il est %H:%M") + system = "\n".join( + [ + "Tu es une IA connaissant bien les données suivantes, qui décrivent les match et entraînements d'équipes de hockey sur glace.", + f"aujourd'hui, nous sommes le {when}" + "attention: ce qu'il y a entre parenthèse après la catégorie est une catégorie à part entière, example, u13 a = U13 (A) et ça correspond aux agegroup", + "assure-toi de ne pas confondre les catégories d'age dans tes réponses. ne donne pas une réponse pour la mauvaise équipe", + "ne confond pas top, elite, a, prép", + "```json", + json.dumps(schedule_data), + "```", + ], ) history: List[Tuple[str, str]] = [] while True: @@ -322,8 +335,10 @@ def check_with_ai( question = input("> ") except EOFError: break - answer = utils.llm_inference(question, history, system=system) - print(">", answer) + answer = utils.llm_inference( + question, history, system=system, model="mixtral8x22b" + ) + print("<", answer) history.append((question, answer)) diff --git a/poetry.lock b/poetry.lock index 5dc8dbf..e368a40 100644 --- a/poetry.lock +++ b/poetry.lock @@ -874,13 +874,13 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "rich" -version = "13.9.3" +version = "13.9.4" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.8.0" files = [ - {file = "rich-13.9.3-py3-none-any.whl", hash = "sha256:9836f5096eb2172c9e77df411c1b009bace4193d6a481d534fea75ebba758283"}, - {file = "rich-13.9.3.tar.gz", hash = "sha256:bc1e01b899537598cf02579d2b9f4a415104d3fc439313a7a2c165d76557a08e"}, + {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"}, + {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"}, ] [package.dependencies] @@ -892,13 +892,13 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "rl-ai-tools" -version = "1.9.0" +version = "1.10.0" description = "Tools using AI" optional = false python-versions = ">=3.11,<4.0" files = [ - {file = "rl_ai_tools-1.9.0-py3-none-any.whl", hash = "sha256:c986a17e39afe6bd5bc21eb8d259e465dcc52e60a73b81db3931b45599e94fc1"}, - {file = "rl_ai_tools-1.9.0.tar.gz", hash = "sha256:80c43d434a330544e5d201f3a99460996cc31276fb360cb45a0962f743a342bb"}, + {file = "rl_ai_tools-1.10.0-py3-none-any.whl", hash = "sha256:74c800f89fe2ac6de05e02ee5d5ea2d6b939836169253ba3e7f216546c4de9ab"}, + {file = "rl_ai_tools-1.10.0.tar.gz", hash = "sha256:da6b38a98ca5fe8a680d5229888a69c7bde98a326e23097f346488e28a8f9922"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 4d1ae69..5070862 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "myice" -version = "v0.2.0" +version = "v0.2.4" description = "myice parsing" authors = ["Rene Luria "] license = "MIT"