Here is a brief summary of the changes:

🛠️ myice.py -> Modified get_schedule function and updated AI system prompt
🛠️ poetry.lock -> Updated rich package version from 13.9.3 to 13.9.4 and rl-ai-tools package version from 1.9.0 to 1.10.0
🛠️ pyproject.toml -> Updated project version from v0.2.0 to v0.2.4
This commit is contained in:
2024-11-04 08:37:56 +01:00
parent 275f1d09ca
commit 2bf6b62ba4
3 changed files with 28 additions and 13 deletions

View File

@@ -146,7 +146,7 @@ def get_schedule() -> str:
global userid global userid
assert session and userid assert session and userid
now = datetime.datetime.now() now = datetime.datetime.now()
date_start = now + datetime.timedelta(days=1) date_start = now
date_end = date_start + datetime.timedelta(days=7) date_end = date_start + datetime.timedelta(days=7)
r = session.post( r = session.post(
"https://app.myice.hockey/inc/processclubplanning.php", "https://app.myice.hockey/inc/processclubplanning.php",
@@ -312,9 +312,22 @@ def check_with_ai(
sys.exit(1) sys.exit(1)
with schedule_file.open("r") as f: with schedule_file.open("r") as f:
schedule_data = json.load(f) schedule_data = json.load(f)
system = ( schedule_data = [x for x in schedule_data if x["agegroup"] in AgeGroup]
"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" for event in schedule_data:
+ json.dumps(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]] = [] history: List[Tuple[str, str]] = []
while True: while True:
@@ -322,8 +335,10 @@ def check_with_ai(
question = input("> ") question = input("> ")
except EOFError: except EOFError:
break break
answer = utils.llm_inference(question, history, system=system) answer = utils.llm_inference(
print(">", answer) question, history, system=system, model="mixtral8x22b"
)
print("<", answer)
history.append((question, answer)) history.append((question, answer))

12
poetry.lock generated
View File

@@ -874,13 +874,13 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
[[package]] [[package]]
name = "rich" 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" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
optional = false optional = false
python-versions = ">=3.8.0" python-versions = ">=3.8.0"
files = [ files = [
{file = "rich-13.9.3-py3-none-any.whl", hash = "sha256:9836f5096eb2172c9e77df411c1b009bace4193d6a481d534fea75ebba758283"}, {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"},
{file = "rich-13.9.3.tar.gz", hash = "sha256:bc1e01b899537598cf02579d2b9f4a415104d3fc439313a7a2c165d76557a08e"}, {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"},
] ]
[package.dependencies] [package.dependencies]
@@ -892,13 +892,13 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"]
[[package]] [[package]]
name = "rl-ai-tools" name = "rl-ai-tools"
version = "1.9.0" version = "1.10.0"
description = "Tools using AI" description = "Tools using AI"
optional = false optional = false
python-versions = ">=3.11,<4.0" python-versions = ">=3.11,<4.0"
files = [ files = [
{file = "rl_ai_tools-1.9.0-py3-none-any.whl", hash = "sha256:c986a17e39afe6bd5bc21eb8d259e465dcc52e60a73b81db3931b45599e94fc1"}, {file = "rl_ai_tools-1.10.0-py3-none-any.whl", hash = "sha256:74c800f89fe2ac6de05e02ee5d5ea2d6b939836169253ba3e7f216546c4de9ab"},
{file = "rl_ai_tools-1.9.0.tar.gz", hash = "sha256:80c43d434a330544e5d201f3a99460996cc31276fb360cb45a0962f743a342bb"}, {file = "rl_ai_tools-1.10.0.tar.gz", hash = "sha256:da6b38a98ca5fe8a680d5229888a69c7bde98a326e23097f346488e28a8f9922"},
] ]
[package.dependencies] [package.dependencies]

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "myice" name = "myice"
version = "v0.2.0" version = "v0.2.4"
description = "myice parsing" description = "myice parsing"
authors = ["Rene Luria <rene@luria.ch>"] authors = ["Rene Luria <rene@luria.ch>"]
license = "MIT" license = "MIT"