From 858ac2f9d7f8f52c23ff26df30a9009ea790b0c4 Mon Sep 17 00:00:00 2001 From: Quentin Leblanc Date: Thu, 22 May 2025 17:26:29 +0200 Subject: [PATCH] - Added comments about author in files - added License and Notice file --- .gitignore | 3 ++- LICENSE | 41 +++++++++++++++++++++++++++++++++++++++++ src/NOTICE | 9 +++++++++ src/model.py | 7 +++++++ src/utils.py | 14 +++++++++++++- 5 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100644 src/NOTICE diff --git a/.gitignore b/.gitignore index e61a98b..597624c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .env **/__pycache__/** test.** -test_*.py \ No newline at end of file +test_*.py +.venv \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..773aa7b --- /dev/null +++ b/LICENSE @@ -0,0 +1,41 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions: + - "License" refers to this Apache 2.0 license with the modifications below. + - "Work" refers to the original software or content you created. + - "Attribution Notice" refers to the citation requirement in Section 5(b). + +2. Redistribution and use in source and binary forms, with or without modification, + are permitted provided the following conditions are met: + + a. Redistributions of source code must retain the original copyright notice, + this list of conditions, and the following disclaimer. + + b. Redistributions in binary form or as part of a derivative work must reproduce + the original copyright notice, this list of conditions, and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + c. All redistributions must include a clear and visible attribution to the + original author (as specified in the NOTICE file) in one or more of the + following forms: + - A mention in the documentation or "About" section of the software. + - A citation in academic or public-facing materials. + - A notice in the source code (if redistributed). + +3. The NOTICE file: + - Any redistribution must include a copy of the NOTICE file from your original work. + - Derivative works may add their own notices, but they may not alter or remove + the original attribution requirements. + +4. Disclaimer of Warranty: + Unless required by applicable law, the Work is provided "AS IS," without + warranties or conditions of any kind, either express or implied. + +5. Limitation of Liability: + In no event shall the authors or copyright holders be liable for any claim or + damages arising from the use of the Work. \ No newline at end of file diff --git a/src/NOTICE b/src/NOTICE new file mode 100644 index 0000000..7b52b2f --- /dev/null +++ b/src/NOTICE @@ -0,0 +1,9 @@ +GoodRecipe +Copyright 2025 Quentin Leblanc + +This product includes software developed by Quentin Leblanc (https://git.quentin-leblanc.ch/quentin/GoodRecipe). + +**Attribution Requirement:** +When using, redistributing, or modifying this software, you must include a clear +citation to the original author in the form of: +"GoodRecipe by Quentin Leblanc, 2025. Available at https://git.quentin-leblanc.ch/quentin/GoodRecipe. \ No newline at end of file diff --git a/src/model.py b/src/model.py index 0f217cd..b510c7c 100644 --- a/src/model.py +++ b/src/model.py @@ -1,3 +1,10 @@ +""" +:author: Quentin Leblanc +:mail: pro@quentin-leblanc.ch +:brief: Model calling for recipe analysis and enhancement +""" + + import json from typing import Any diff --git a/src/utils.py b/src/utils.py index 14d9ea3..aad5910 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1,2 +1,14 @@ -def create_message(role: str, content: str): +""" +:author: Quentin Leblanc +:mail: pro@quentin-leblanc.ch +:brief: Utility functions +""" + +def create_message(role: str, content: str) -> dict[str, str]: + """ + Create a message to be sent to Mistral API with role and content defined + :param role: + :param content: + :return: + """ return {"role": role, "content": content} \ No newline at end of file