diff --git a/amt/api/ai_act_profile.py b/amt/api/ai_act_profile.py index 967b4ed3..1e5f8132 100644 --- a/amt/api/ai_act_profile.py +++ b/amt/api/ai_act_profile.py @@ -4,14 +4,14 @@ from fastapi import Request -from amt.api.publication_category import PublicationCategories from amt.core.internationalization import get_current_translation class AiActProfileItem(Enum): TYPE = "type" OPEN_SOURCE = "open_source" - PUBLICATION_CATEGORY = "publication_category" + RISK_GROUP = "risk_group" + CONFORMITY_ASSESSMENT_BODY = "conformity_assessment_body" SYSTEMIC_RISK = "systemic_risk" TRANSPARENCY_OBLIGATIONS = "transparency_obligations" ROLE = "role" @@ -24,8 +24,10 @@ def get_translation(item: AiActProfileItem, translations: NullTranslations) -> s return _("Type") case AiActProfileItem.OPEN_SOURCE: return _("Is the application open source?") - case AiActProfileItem.PUBLICATION_CATEGORY: - return _("Publication Category") + case AiActProfileItem.RISK_GROUP: + return _("In what risk group falls the application?") + case AiActProfileItem.CONFORMITY_ASSESSMENT_BODY: + return _("Does a conformity assessment need to be performed by an accredited body") case AiActProfileItem.SYSTEMIC_RISK: return _("Is there a systemic risk?") case AiActProfileItem.TRANSPARENCY_OBLIGATIONS: @@ -54,14 +56,17 @@ class AiActProfileSelector: radio_select: list[SelectAiProfileItem] | None multiple_select: list[SelectAiProfileItem] | None binary_select: list[SelectAiProfileItem] | None + dropdown_select: list[SelectAiProfileItem] | None def __init__( self, radio_select: list[SelectAiProfileItem] | None = None, multiple_select: list[SelectAiProfileItem] | None = None, + dropdown_select: list[SelectAiProfileItem] | None = None, binary_select: list[SelectAiProfileItem] | None = None, ) -> None: self.radio_select = radio_select + self.dropdown_select = dropdown_select self.multiple_select = multiple_select self.binary_select = binary_select @@ -71,32 +76,55 @@ def get_ai_act_profile_selector(request: Request) -> AiActProfileSelector: "AI-systeem", "AI-systeem voor algemene doeleinden", "AI-model voor algemene doeleinden", + "impactvol algoritme", + "niet-impactvol algoritme", + "geen algoritme", ) - role_options = ("aanbieder", "gebruiksverantwoordelijke") - publication_category_options = (*(p.value for p in PublicationCategories), "niet van toepassing") + + role_options = ( + "aanbieder", + "gebruiksverantwoordelijke", + "aanbieder & gebruiksverantwoordelijke", + "importeur", + "distributeur", + ) + + risk_group_options = ( + "hoog-risico AI", + "geen hoog-risico AI", + "verboden AI", + "uitzondering van toepassing", + "niet van toepassing", + ) + + conformity_assessment_body_options = ("beoordeling door derde partij", "niet van toepassing") + systemic_risk_options = ("systeemrisico", "geen systeemrisico", "niet van toepassing") transparency_obligations_options = ( "transparantieverplichtingen", "geen transparantieverplichtingen", "niet van toepassing", ) - open_source_options = ("open-source", "geen open-source") + open_source_options = ("open-source", "geen open-source", "niet van toepassing") translations = get_current_translation(request) return AiActProfileSelector( - radio_select=[ + multiple_select=[ + SelectAiProfileItem(AiActProfileItem.ROLE, role_options, translations), + ], + dropdown_select=[ SelectAiProfileItem(AiActProfileItem.TYPE, type_options, translations), - SelectAiProfileItem(AiActProfileItem.PUBLICATION_CATEGORY, publication_category_options, translations), + SelectAiProfileItem(AiActProfileItem.RISK_GROUP, risk_group_options, translations), SelectAiProfileItem( AiActProfileItem.TRANSPARENCY_OBLIGATIONS, transparency_obligations_options, translations ), SelectAiProfileItem(AiActProfileItem.SYSTEMIC_RISK, systemic_risk_options, translations), - ], - multiple_select=[ - SelectAiProfileItem(AiActProfileItem.ROLE, role_options, translations), - ], - binary_select=[ SelectAiProfileItem(AiActProfileItem.OPEN_SOURCE, open_source_options, translations), + SelectAiProfileItem( + AiActProfileItem.CONFORMITY_ASSESSMENT_BODY, conformity_assessment_body_options, translations + ), ], + radio_select=[], + binary_select=[], ) diff --git a/amt/api/publication_category.py b/amt/api/publication_category.py deleted file mode 100644 index 4847358c..00000000 --- a/amt/api/publication_category.py +++ /dev/null @@ -1,38 +0,0 @@ -from collections.abc import Callable - -from fastapi import Request - -from ..schema.localized_value_item import LocalizedValueItem -from .localizable import LocalizableEnum, get_localized_enum, get_localized_enums - - -class PublicationCategories(LocalizableEnum): - IMPACTVOL_ALGORITME = "impactvol algoritme" - NIET_IMPACTVOL_ALGORITME = "niet-impactvol algoritme" - HOOG_RISICO_AI = "hoog-risico AI" - GEEN_HOOG_RISICO_AI = "geen hoog-risico AI" - VERBODEN_AI = "verboden AI" - UITZONDERING_VAN_TOEPASSING = "uitzondering van toepassing" - - @classmethod - def get_display_values( - cls: type["PublicationCategories"], _: Callable[[str], str] - ) -> dict["PublicationCategories", str]: - return { - cls.IMPACTVOL_ALGORITME: _("Impactful algorithm"), - cls.NIET_IMPACTVOL_ALGORITME: _("Non-impactful algorithm"), - cls.HOOG_RISICO_AI: _("High-risk AI"), - cls.GEEN_HOOG_RISICO_AI: _("No high-risk AI"), - cls.VERBODEN_AI: _("Forbidden AI"), - cls.UITZONDERING_VAN_TOEPASSING: _("Exception of application"), - } - - -def get_localized_publication_category( - key: PublicationCategories | None, request: Request -) -> LocalizedValueItem | None: - return get_localized_enum(key, request) - - -def get_localized_publication_categories(request: Request) -> list[LocalizedValueItem | None]: - return get_localized_enums(PublicationCategories, request) diff --git a/amt/api/risk_group.py b/amt/api/risk_group.py new file mode 100644 index 00000000..b248f26a --- /dev/null +++ b/amt/api/risk_group.py @@ -0,0 +1,32 @@ +from collections.abc import Callable + +from fastapi import Request + +from ..schema.localized_value_item import LocalizedValueItem +from .localizable import LocalizableEnum, get_localized_enum, get_localized_enums + + +class RiskGroup(LocalizableEnum): + HOOG_RISICO_AI = "hoog-risico AI" + GEEN_HOOG_RISICO_AI = "geen hoog-risico AI" + VERBODEN_AI = "verboden AI" + UITZONDERING_VAN_TOEPASSING = "uitzondering van toepassing" + NIET_VAN_TOEPASSING = "niet van toepassing" + + @classmethod + def get_display_values(cls: type["RiskGroup"], _: Callable[[str], str]) -> dict["RiskGroup", str]: + return { + cls.HOOG_RISICO_AI: _("hoog-risico AI"), + cls.GEEN_HOOG_RISICO_AI: _("geen hoog-risico AI"), + cls.VERBODEN_AI: _("verboden AI"), + cls.UITZONDERING_VAN_TOEPASSING: _("uitzondering van toepassing"), + cls.NIET_VAN_TOEPASSING: _("niet van toepassing"), + } + + +def get_localized_risk_group(key: RiskGroup | None, request: Request) -> LocalizedValueItem | None: + return get_localized_enum(key, request) + + +def get_localized_risk_groups(request: Request) -> list[LocalizedValueItem | None]: + return get_localized_enums(RiskGroup, request) diff --git a/amt/api/routes/algorithms.py b/amt/api/routes/algorithms.py index 1bd20f3b..3af0ee99 100644 --- a/amt/api/routes/algorithms.py +++ b/amt/api/routes/algorithms.py @@ -10,8 +10,8 @@ from amt.api.group_by_category import get_localized_group_by_categories from amt.api.lifecycles import Lifecycles, get_localized_lifecycle, get_localized_lifecycles from amt.api.navigation import Navigation, resolve_base_navigation_items, resolve_navigation_items -from amt.api.publication_category import ( - get_localized_publication_categories, +from amt.api.risk_group import ( + get_localized_risk_groups, ) from amt.api.routes.shared import get_filters_and_sort_by from amt.core.authorization import get_user @@ -81,7 +81,7 @@ async def get_root( "start": skip, "search": search, "lifecycles": get_localized_lifecycles(request), - "publication_categories": get_localized_publication_categories(request), + "risk_groups": get_localized_risk_groups(request), "group_by_categories": get_localized_group_by_categories(request), "filters": localized_filters, "sort_by": sort_by, @@ -105,6 +105,8 @@ async def get_new( sub_menu_items = resolve_navigation_items([Navigation.ALGORITHMS_OVERVIEW], request) # pyright: ignore [reportUnusedVariable] # noqa breadcrumbs = resolve_base_navigation_items([Navigation.ALGORITHMS_ROOT, Navigation.ALGORITHM_NEW], request) + # clean up session storage + ai_act_profile = get_ai_act_profile_selector(request) user = get_user(request) diff --git a/amt/api/routes/shared.py b/amt/api/routes/shared.py index bc8c378a..c53b2420 100644 --- a/amt/api/routes/shared.py +++ b/amt/api/routes/shared.py @@ -2,7 +2,7 @@ from amt.api.lifecycles import Lifecycles, get_localized_lifecycle from amt.api.organization_filter_options import OrganizationFilterOptions, get_localized_organization_filter -from amt.api.publication_category import PublicationCategories, get_localized_publication_category +from amt.api.risk_group import RiskGroup, get_localized_risk_group from amt.schema.localized_value_item import LocalizedValueItem @@ -37,8 +37,8 @@ def get_localized_value(key: str, value: str, request: Request) -> LocalizedValu match key: case "lifecycle": localized = get_localized_lifecycle(Lifecycles(value), request) - case "publication-category": - localized = get_localized_publication_category(PublicationCategories[value], request) + case "risk-group": + localized = get_localized_risk_group(RiskGroup[value], request) case "organization-type": localized = get_localized_organization_filter(OrganizationFilterOptions(value), request) case _: diff --git a/amt/locale/base.pot b/amt/locale/base.pot index bf83cd3f..b29d7e67 100644 --- a/amt/locale/base.pot +++ b/amt/locale/base.pot @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 0001-01-01 00:00+0000\n" -"PO-Revision-Date: 0001-01-01 00:00+0000\n" +"POT-Creation-Date: 2024-12-06 12:25+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.15.0\n" +"Generated-By: Babel 2.16.0\n" #: amt/api/ai_act_profile.py:24 msgid "Type" @@ -26,18 +26,22 @@ msgid "Is the application open source?" msgstr "" #: amt/api/ai_act_profile.py:28 -msgid "Publication Category" +msgid "In what risk group falls the application?" msgstr "" #: amt/api/ai_act_profile.py:30 -msgid "Is there a systemic risk?" +msgid "Does a conformity assessment need to be performed by an accredited body" msgstr "" #: amt/api/ai_act_profile.py:32 -msgid "Is there a transparency obligation?" +msgid "Is there a systemic risk?" msgstr "" #: amt/api/ai_act_profile.py:34 +msgid "Is there a transparency obligation?" +msgstr "" + +#: amt/api/ai_act_profile.py:36 msgid "Role" msgstr "" @@ -142,7 +146,7 @@ msgstr "" msgid "Model" msgstr "" -#: amt/api/navigation.py:61 amt/site/templates/algorithms/new.html.j2:151 +#: amt/api/navigation.py:61 amt/site/templates/algorithms/new.html.j2:170 msgid "Instruments" msgstr "" @@ -164,28 +168,24 @@ msgstr "" msgid "My organizations" msgstr "" -#: amt/api/publication_category.py:22 -msgid "Impactful algorithm" +#: amt/api/risk_group.py:19 +msgid "hoog-risico AI" msgstr "" -#: amt/api/publication_category.py:23 -msgid "Non-impactful algorithm" +#: amt/api/risk_group.py:20 +msgid "geen hoog-risico AI" msgstr "" -#: amt/api/publication_category.py:24 -msgid "High-risk AI" +#: amt/api/risk_group.py:21 +msgid "verboden AI" msgstr "" -#: amt/api/publication_category.py:25 -msgid "No high-risk AI" +#: amt/api/risk_group.py:22 +msgid "uitzondering van toepassing" msgstr "" -#: amt/api/publication_category.py:26 -msgid "Forbidden AI" -msgstr "" - -#: amt/api/publication_category.py:27 -msgid "Exception of application" +#: amt/api/risk_group.py:23 +msgid "niet van toepassing" msgstr "" #: amt/api/forms/algorithm.py:19 @@ -308,12 +308,12 @@ msgid "" msgstr "" #: amt/site/templates/algorithms/details_base.html.j2:39 -#: amt/site/templates/algorithms/new.html.j2:134 +#: amt/site/templates/algorithms/new.html.j2:153 msgid "Yes" msgstr "" #: amt/site/templates/algorithms/details_base.html.j2:44 -#: amt/site/templates/algorithms/new.html.j2:144 +#: amt/site/templates/algorithms/new.html.j2:163 msgid "No" msgstr "" @@ -541,21 +541,25 @@ msgstr "" msgid "Find your AI Act profile" msgstr "" -#: amt/site/templates/algorithms/new.html.j2:153 +#: amt/site/templates/algorithms/new.html.j2:112 +msgid "Select Option" +msgstr "" + +#: amt/site/templates/algorithms/new.html.j2:172 msgid "" "Overview of instruments for the responsible development, deployment, " "assessment and monitoring of algorithms and AI-systems." msgstr "" -#: amt/site/templates/algorithms/new.html.j2:161 +#: amt/site/templates/algorithms/new.html.j2:180 msgid "Choose one or more instruments" msgstr "" -#: amt/site/templates/algorithms/new.html.j2:185 +#: amt/site/templates/algorithms/new.html.j2:204 msgid "Create Algorithm" msgstr "" -#: amt/site/templates/algorithms/new.html.j2:202 +#: amt/site/templates/algorithms/new.html.j2:221 msgid "Copy results and close" msgstr "" @@ -617,7 +621,7 @@ msgstr "" msgid "There is one error:" msgstr "" -#: amt/site/templates/layouts/base.html.j2:1 +#: amt/site/templates/layouts/base.html.j2:11 msgid "Algorithmic Management Toolkit (AMT)" msgstr "" @@ -799,14 +803,14 @@ msgid "Category" msgstr "" #: amt/site/templates/parts/algorithm_search.html.j2:67 -msgid "Select publication category" +msgid "Select risk group" msgstr "" -#: amt/site/templates/parts/algorithm_search.html.j2:85 +#: amt/site/templates/parts/algorithm_search.html.j2:83 msgid "Group by" msgstr "" -#: amt/site/templates/parts/algorithm_search.html.j2:95 +#: amt/site/templates/parts/algorithm_search.html.j2:93 msgid "Select group by" msgstr "" diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index 83f4ad01..b9a6e624 100644 Binary files a/amt/locale/en_US/LC_MESSAGES/messages.mo and b/amt/locale/en_US/LC_MESSAGES/messages.mo differ diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index 509e10d3..e5446606 100644 --- a/amt/locale/en_US/LC_MESSAGES/messages.po +++ b/amt/locale/en_US/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 0001-01-01 00:00+0000\n" +"POT-Creation-Date: 2024-12-06 12:25+0000\n" "PO-Revision-Date: 0001-01-01 00:00+0000\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.15.0\n" +"Generated-By: Babel 2.16.0\n" #: amt/api/ai_act_profile.py:24 msgid "Type" @@ -27,18 +27,22 @@ msgid "Is the application open source?" msgstr "" #: amt/api/ai_act_profile.py:28 -msgid "Publication Category" +msgid "In what risk group falls the application?" msgstr "" #: amt/api/ai_act_profile.py:30 -msgid "Is there a systemic risk?" +msgid "Does a conformity assessment need to be performed by an accredited body" msgstr "" #: amt/api/ai_act_profile.py:32 -msgid "Is there a transparency obligation?" +msgid "Is there a systemic risk?" msgstr "" #: amt/api/ai_act_profile.py:34 +msgid "Is there a transparency obligation?" +msgstr "" + +#: amt/api/ai_act_profile.py:36 msgid "Role" msgstr "" @@ -143,7 +147,7 @@ msgstr "" msgid "Model" msgstr "" -#: amt/api/navigation.py:61 amt/site/templates/algorithms/new.html.j2:151 +#: amt/api/navigation.py:61 amt/site/templates/algorithms/new.html.j2:170 msgid "Instruments" msgstr "" @@ -165,29 +169,25 @@ msgstr "" msgid "My organizations" msgstr "" -#: amt/api/publication_category.py:22 -msgid "Impactful algorithm" -msgstr "" +#: amt/api/risk_group.py:19 +msgid "hoog-risico AI" +msgstr "high-risk AI" -#: amt/api/publication_category.py:23 -msgid "Non-impactful algorithm" -msgstr "" +#: amt/api/risk_group.py:20 +msgid "geen hoog-risico AI" +msgstr "No high-risk AI" -#: amt/api/publication_category.py:24 -msgid "High-risk AI" -msgstr "" +#: amt/api/risk_group.py:21 +msgid "verboden AI" +msgstr "Forbidden AI -#: amt/api/publication_category.py:25 -msgid "No high-risk AI" -msgstr "" - -#: amt/api/publication_category.py:26 -msgid "Forbidden AI" -msgstr "" +#: amt/api/risk_group.py:22 +msgid "uitzondering van toepassing" +msgstr "Exception of application" -#: amt/api/publication_category.py:27 -msgid "Exception of application" -msgstr "" +#: amt/api/risk_group.py:23 +msgid "niet van toepassing" +msgstr "Not applicable" #: amt/api/forms/algorithm.py:19 msgid "Select organization" @@ -309,12 +309,12 @@ msgid "" msgstr "" #: amt/site/templates/algorithms/details_base.html.j2:39 -#: amt/site/templates/algorithms/new.html.j2:134 +#: amt/site/templates/algorithms/new.html.j2:153 msgid "Yes" msgstr "" #: amt/site/templates/algorithms/details_base.html.j2:44 -#: amt/site/templates/algorithms/new.html.j2:144 +#: amt/site/templates/algorithms/new.html.j2:163 msgid "No" msgstr "" @@ -542,21 +542,25 @@ msgstr "" msgid "Find your AI Act profile" msgstr "" -#: amt/site/templates/algorithms/new.html.j2:153 +#: amt/site/templates/algorithms/new.html.j2:112 +msgid "Select Option" +msgstr "" + +#: amt/site/templates/algorithms/new.html.j2:172 msgid "" "Overview of instruments for the responsible development, deployment, " "assessment and monitoring of algorithms and AI-systems." msgstr "" -#: amt/site/templates/algorithms/new.html.j2:161 +#: amt/site/templates/algorithms/new.html.j2:180 msgid "Choose one or more instruments" msgstr "" -#: amt/site/templates/algorithms/new.html.j2:185 +#: amt/site/templates/algorithms/new.html.j2:204 msgid "Create Algorithm" msgstr "" -#: amt/site/templates/algorithms/new.html.j2:202 +#: amt/site/templates/algorithms/new.html.j2:221 msgid "Copy results and close" msgstr "" @@ -618,7 +622,7 @@ msgstr "" msgid "There is one error:" msgstr "" -#: amt/site/templates/layouts/base.html.j2:1 +#: amt/site/templates/layouts/base.html.j2:11 msgid "Algorithmic Management Toolkit (AMT)" msgstr "" @@ -800,14 +804,14 @@ msgid "Category" msgstr "" #: amt/site/templates/parts/algorithm_search.html.j2:67 -msgid "Select publication category" +msgid "Select risk group" msgstr "" -#: amt/site/templates/parts/algorithm_search.html.j2:85 +#: amt/site/templates/parts/algorithm_search.html.j2:83 msgid "Group by" msgstr "" -#: amt/site/templates/parts/algorithm_search.html.j2:95 +#: amt/site/templates/parts/algorithm_search.html.j2:93 msgid "Select group by" msgstr "" diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.mo b/amt/locale/nl_NL/LC_MESSAGES/messages.mo index f6be2508..7f7dbe27 100644 Binary files a/amt/locale/nl_NL/LC_MESSAGES/messages.mo and b/amt/locale/nl_NL/LC_MESSAGES/messages.mo differ diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index c327fabc..2a6253cf 100644 --- a/amt/locale/nl_NL/LC_MESSAGES/messages.po +++ b/amt/locale/nl_NL/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 0001-01-01 00:00+0000\n" +"POT-Creation-Date: 2024-12-06 12:25+0000\n" "PO-Revision-Date: 0001-01-01 00:00+0000\n" "Last-Translator: FULL NAME \n" "Language: nl_NL\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.15.0\n" +"Generated-By: Babel 2.16.0\n" #: amt/api/ai_act_profile.py:24 msgid "Type" @@ -27,18 +27,22 @@ msgid "Is the application open source?" msgstr "Is de applicatie open source?" #: amt/api/ai_act_profile.py:28 -msgid "Publication Category" -msgstr "Publicatiecategorie" +msgid "In what risk group falls the application?" +msgstr "" #: amt/api/ai_act_profile.py:30 +msgid "Does a conformity assessment need to be performed by an accredited body" +msgstr "" + +#: amt/api/ai_act_profile.py:32 msgid "Is there a systemic risk?" msgstr "Is er sprake van systematisch risico?" -#: amt/api/ai_act_profile.py:32 +#: amt/api/ai_act_profile.py:34 msgid "Is there a transparency obligation?" msgstr "Zijn er transparantieverplichtingen?" -#: amt/api/ai_act_profile.py:34 +#: amt/api/ai_act_profile.py:36 msgid "Role" msgstr "Rol" @@ -143,7 +147,7 @@ msgstr "Data" msgid "Model" msgstr "Model" -#: amt/api/navigation.py:61 amt/site/templates/algorithms/new.html.j2:151 +#: amt/api/navigation.py:61 amt/site/templates/algorithms/new.html.j2:170 msgid "Instruments" msgstr "Instrumenten" @@ -165,30 +169,26 @@ msgstr "Alle organisaties" msgid "My organizations" msgstr "Mijn organisaties" -#: amt/api/publication_category.py:22 -msgid "Impactful algorithm" -msgstr "Impactvol algoritme" - -#: amt/api/publication_category.py:23 -msgid "Non-impactful algorithm" -msgstr "Niet-impactvol algoritme" - -#: amt/api/publication_category.py:24 -msgid "High-risk AI" +#: amt/api/risk_group.py:19 +msgid "hoog-risico AI" msgstr "Hoog-risico AI" -#: amt/api/publication_category.py:25 -msgid "No high-risk AI" +#: amt/api/risk_group.py:20 +msgid "geen hoog-risico AI" msgstr "Geen hoog-risico AI" -#: amt/api/publication_category.py:26 -msgid "Forbidden AI" +#: amt/api/risk_group.py:21 +msgid "verboden AI" msgstr "Verboden AI" -#: amt/api/publication_category.py:27 -msgid "Exception of application" +#: amt/api/risk_group.py:22 +msgid "uitzondering van toepassing" msgstr "Uitzondering van toepassing" +#: amt/api/risk_group.py:23 +msgid "niet van toepassing" +msgstr "Niet van toepassing" + #: amt/api/forms/algorithm.py:19 msgid "Select organization" msgstr "Selecteer organisatie" @@ -321,12 +321,12 @@ msgstr "" " verwijderd." #: amt/site/templates/algorithms/details_base.html.j2:39 -#: amt/site/templates/algorithms/new.html.j2:134 +#: amt/site/templates/algorithms/new.html.j2:153 msgid "Yes" msgstr "Ja" #: amt/site/templates/algorithms/details_base.html.j2:44 -#: amt/site/templates/algorithms/new.html.j2:144 +#: amt/site/templates/algorithms/new.html.j2:163 msgid "No" msgstr "Nee" @@ -559,7 +559,12 @@ msgstr "" msgid "Find your AI Act profile" msgstr "Vind uw AI Act profiel" -#: amt/site/templates/algorithms/new.html.j2:153 +#: amt/site/templates/algorithms/new.html.j2:112 +#, fuzzy +msgid "Select Option" +msgstr "Selecteer organisatie" + +#: amt/site/templates/algorithms/new.html.j2:172 msgid "" "Overview of instruments for the responsible development, deployment, " "assessment and monitoring of algorithms and AI-systems." @@ -567,15 +572,15 @@ msgstr "" "Overzicht van aanbevolen instrument voor het verantwoord ontwikkelen, " "gebruiken, beoordelen en monitoren van algoritmes en AI-systemen." -#: amt/site/templates/algorithms/new.html.j2:161 +#: amt/site/templates/algorithms/new.html.j2:180 msgid "Choose one or more instruments" msgstr "Kies één of meerdere instrumenten" -#: amt/site/templates/algorithms/new.html.j2:185 +#: amt/site/templates/algorithms/new.html.j2:204 msgid "Create Algorithm" msgstr "Creëer algoritme" -#: amt/site/templates/algorithms/new.html.j2:202 +#: amt/site/templates/algorithms/new.html.j2:221 msgid "Copy results and close" msgstr "Resultaten overnemen en sluiten" @@ -637,7 +642,7 @@ msgstr "Er zijn enkele fouten" msgid "There is one error:" msgstr "Er is één fout:" -#: amt/site/templates/layouts/base.html.j2:1 +#: amt/site/templates/layouts/base.html.j2:11 msgid "Algorithmic Management Toolkit (AMT)" msgstr "Algoritme Management Toolkit" @@ -826,14 +831,15 @@ msgid "Category" msgstr "Categorie" #: amt/site/templates/parts/algorithm_search.html.j2:67 -msgid "Select publication category" -msgstr "Selecteer publicatiecategorie" +#, fuzzy +msgid "Select risk group" +msgstr "Selecteer groepering" -#: amt/site/templates/parts/algorithm_search.html.j2:85 +#: amt/site/templates/parts/algorithm_search.html.j2:83 msgid "Group by" msgstr "Groeperen op" -#: amt/site/templates/parts/algorithm_search.html.j2:95 +#: amt/site/templates/parts/algorithm_search.html.j2:93 msgid "Select group by" msgstr "Selecteer groepering" @@ -876,3 +882,21 @@ msgid "" " open manner." msgstr "Deze website is in ontwikkeling. Alle versies ontstaan op een open manier." +#~ msgid "Publication Category" +#~ msgstr "Publicatiecategorie" + +#~ msgid "Impactful algorithm" +#~ msgstr "Impactvol algoritme" + +#~ msgid "Non-impactful algorithm" +#~ msgstr "Niet-impactvol algoritme" + +#~ msgid "Select publication category" +#~ msgstr "Selecteer publicatiecategorie" + +#~ msgid "Exception of application" +#~ msgstr "Uitzondering van toepassing" + +#~ msgid "Not applicable" +#~ msgstr "" + diff --git a/amt/repositories/algorithms.py b/amt/repositories/algorithms.py index 8f647348..c7e3a48c 100644 --- a/amt/repositories/algorithms.py +++ b/amt/repositories/algorithms.py @@ -8,7 +8,7 @@ from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy_utils import escape_like # pyright: ignore[reportMissingTypeStubs, reportUnknownVariableType] -from amt.api.publication_category import PublicationCategories +from amt.api.risk_group import RiskGroup from amt.core.exceptions import AMTRepositoryError from amt.models import Algorithm from amt.repositories.deps import get_session @@ -85,10 +85,10 @@ async def paginate( # noqa match key: case "lifecycle": statement = statement.filter(Algorithm.lifecycle == value) - case "publication-category": + case "risk-group": statement = statement.filter( - Algorithm.system_card_json["ai_act_profile"]["publication_category"].as_string() - == PublicationCategories[value].value + Algorithm.system_card_json["ai_act_profile"]["risk_group"].as_string() + == RiskGroup[value].value ) case _: raise TypeError(f"Unknown filter type with key: {key}") # noqa diff --git a/amt/schema/ai_act_profile.py b/amt/schema/ai_act_profile.py index d42a332f..7a4a3563 100644 --- a/amt/schema/ai_act_profile.py +++ b/amt/schema/ai_act_profile.py @@ -6,7 +6,8 @@ class AiActProfile(BaseModel): type: str | None = Field(default=None) open_source: str | None = Field(default=None) - publication_category: str | None = Field(default=None) + risk_group: str | None = Field(default=None) + conformity_assessment_body: str | None = Field(default=None) systemic_risk: str | None = Field(default=None) transparency_obligations: str | None = Field(default=None) role: list[str] | str | None = Field(default=None) diff --git a/amt/schema/algorithm.py b/amt/schema/algorithm.py index de4ac26b..f7301fa0 100644 --- a/amt/schema/algorithm.py +++ b/amt/schema/algorithm.py @@ -11,7 +11,8 @@ class AlgorithmNew(AlgorithmBase): instruments: list[str] | str = [] type: str = Field(default=None) open_source: str = Field(default=None) - publication_category: str = Field(default=None) + risk_group: str = Field(default=None) + conformity_assessment_body: str = Field(default=None) systemic_risk: str = Field(default=None) transparency_obligations: str = Field(default=None) role: list[str] | str = [] diff --git a/amt/schema/publication_category.py b/amt/schema/publication_category.py deleted file mode 100644 index 3ce7c08e..00000000 --- a/amt/schema/publication_category.py +++ /dev/null @@ -1,6 +0,0 @@ -from pydantic import BaseModel - - -class PublicationCategory(BaseModel): - id: str - name: str diff --git a/amt/services/algorithms.py b/amt/services/algorithms.py index 6dbb107f..e3408eab 100644 --- a/amt/services/algorithms.py +++ b/amt/services/algorithms.py @@ -65,7 +65,8 @@ async def create(self, algorithm_new: AlgorithmNew, user_id: UUID | str) -> Algo ai_act_profile = AiActProfile( type=algorithm_new.type, open_source=algorithm_new.open_source, - publication_category=algorithm_new.publication_category, + risk_group=algorithm_new.risk_group, + conformity_assessment_body=algorithm_new.conformity_assessment_body, systemic_risk=algorithm_new.systemic_risk, transparency_obligations=algorithm_new.transparency_obligations, role=algorithm_new.role, diff --git a/amt/services/task_registry.py b/amt/services/task_registry.py index da1b8b16..83489d39 100644 --- a/amt/services/task_registry.py +++ b/amt/services/task_registry.py @@ -81,6 +81,6 @@ def _parse_attribute_values(attr: str, ai_act_profile: AiActProfile) -> set[str] if attr == "role": return {s.strip() for s in getattr(ai_act_profile, attr, "").split("+")} if attr == "risk_category": - return {getattr(ai_act_profile, "publication_category", "")} + return {getattr(ai_act_profile, "risk_group", "")} return {getattr(ai_act_profile, attr, "")} diff --git a/amt/site/static/ts/amt.ts b/amt/site/static/ts/amt.ts index 2885ec71..7e67753a 100644 --- a/amt/site/static/ts/amt.ts +++ b/amt/site/static/ts/amt.ts @@ -8,10 +8,29 @@ import "../scss/layout.scss"; _hyperscript.browserInit(); +const keysToRemove = [ + "labelsbysubcategory", + "answers", + "categoryState", + "categoryTrace", + "currentCategory", + "currentconclusion", + "currentquestion", + "currentSubCategory", + "labels", + "previousCategory", + "previousSubCategory", + "subCategoryTrace", +]; +if (window.location.pathname === "/algorithms/new") { + keysToRemove.forEach((key) => { + sessionStorage.removeItem(key); + }); +} + document.addEventListener("DOMContentLoaded", function () { // TODO (robbert): we need (better) event handling and displaying of server errors document.body.addEventListener("htmx:sendError", function () { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion document.getElementById("errorContainer")!.innerHTML = "

Placeholder: Error while connecting to server { el_ids.forEach((el_id: string) => { - const element = document.getElementById(`${category}-${el_id}`); - element?.click(); + // radio buttons and checkboxes + try { + const element: HTMLElement | null = document.getElementById( + `${category}-${el_id}`, + ); + if (element) { + element.click(); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (e) { + // Do Nothing + } + + // dropdowns + try { + const element = document.getElementById(`${category}`); + if (element) { + (element as HTMLInputElement).value = el_ids[0]; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (e) { + // Do Nothing + } }); }); } diff --git a/amt/site/templates/algorithms/new.html.j2 b/amt/site/templates/algorithms/new.html.j2 index 75785e67..233c74d0 100644 --- a/amt/site/templates/algorithms/new.html.j2 +++ b/amt/site/templates/algorithms/new.html.j2 @@ -75,7 +75,7 @@ type="button" style="float: right">{% trans %}Find your AI Act profile{% endtrans %}
- {% for item in ai_act_profile.radio_select %} + {% for item in ai_act_profile.multiple_select %}
@@ -83,20 +83,39 @@
{% for option in item.options %} -
-
{% endfor %} - {% for item in ai_act_profile.multiple_select %} + {% for item in ai_act_profile.dropdown_select %} +
+
+ +
+
+ +
+
+ {% endfor %} + {% for item in ai_act_profile.radio_select %}
@@ -104,13 +123,13 @@
{% for option in item.options %} -
-
diff --git a/amt/site/templates/parts/algorithm_search.html.j2 b/amt/site/templates/parts/algorithm_search.html.j2 index 21718525..39ff3a1b 100644 --- a/amt/site/templates/parts/algorithm_search.html.j2 +++ b/amt/site/templates/parts/algorithm_search.html.j2 @@ -61,15 +61,13 @@
{% trans %}Category{% endtrans %}
-
diff --git a/resources/system_card_templates/AMT_Template_1.json b/resources/system_card_templates/AMT_Template_1.json index 62688daa..14cc36c6 100644 --- a/resources/system_card_templates/AMT_Template_1.json +++ b/resources/system_card_templates/AMT_Template_1.json @@ -10,7 +10,8 @@ "ai_act_profile": { "type": "AI-systeem", "open_source": "open-source", - "publication_category": "hoog-risico AI", + "risk_group": "hoog-risico AI", + "conformity_assessment_body": "niet van toepassing", "systemic_risk": "geen systeemrisico", "transparency_obligations": "geen transparantieverplichtingen", "role": "gebruiksverantwoordelijke" diff --git a/tests/api/routes/test_algorithms.py b/tests/api/routes/test_algorithms.py index 32eace79..ddbe0fbb 100644 --- a/tests/api/routes/test_algorithms.py +++ b/tests/api/routes/test_algorithms.py @@ -128,7 +128,8 @@ async def test_post_new_algorithms(client: AsyncClient, mocker: MockFixture, db: lifecycle="DESIGN", type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", + conformity_assessment_body="beoordeling door derde partij", systemic_risk="geen systeemrisico", transparency_obligations="geen transparantieverplichtingen", role="gebruiksverantwoordelijke", @@ -175,7 +176,8 @@ async def test_post_new_algorithms_write_system_card( lifecycle="DESIGN", type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", + conformity_assessment_body="beoordeling door derde partij", systemic_risk="geen systeemrisico", transparency_obligations="geen transparantieverplichtingen", role="gebruiksverantwoordelijke", @@ -186,7 +188,8 @@ async def test_post_new_algorithms_write_system_card( ai_act_profile = AiActProfile( type=algorithm_new.type, open_source=algorithm_new.open_source, - publication_category=algorithm_new.publication_category, + risk_group=algorithm_new.risk_group, + conformity_assessment_body=algorithm_new.conformity_assessment_body, systemic_risk=algorithm_new.systemic_risk, transparency_obligations=algorithm_new.transparency_obligations, role=algorithm_new.role, @@ -235,12 +238,12 @@ def test_get_localized_value(): assert localized.display_value == "Problem Analysis" request = MockRequest("nl") - localized = get_localized_value("publication-category", "HOOG_RISICO_AI", request) + localized = get_localized_value("risk-group", "HOOG_RISICO_AI", request) assert localized.display_value == "Hoog-risico AI" request = MockRequest("en") - localized = get_localized_value("publication-category", "HOOG_RISICO_AI", request) - assert localized.display_value == "High-risk AI" + localized = get_localized_value("risk-group", "HOOG_RISICO_AI", request) + assert localized.display_value == "high-risk AI" request = MockRequest("en") localized = get_localized_value("other key", "", request) diff --git a/tests/e2e/test_create_algorithm.py b/tests/e2e/test_create_algorithm.py index bd93690f..b8e95aa0 100644 --- a/tests/e2e/test_create_algorithm.py +++ b/tests/e2e/test_create_algorithm.py @@ -23,14 +23,14 @@ def test_e2e_create_algorithm(page: Page) -> None: impact_assessment.check() - button = page.locator("#transparency_obligations-transparantieverplichtingen") - button.click() - - button = page.locator("#open_source-open-source") - button.click() - - button = page.locator("#systemic_risk-systeemrisico") - button.click() + page.locator("#role-aanbieder").check() + page.locator("#type").select_option("AI-systeem voor algemene doeleinden") + page.locator("#risk_group").select_option("verboden AI") + page.locator("#transparency_obligations").select_option("geen transparantieverplichtingen") + page.locator("#systemic_risk").select_option("geen systeemrisico") + page.locator("#open_source").select_option("geen open-source") + page.locator("#conformity_assessment_body").select_option("niet van toepassing") + page.locator("#conformity_assessment_body").select_option("beoordeling door derde partij") button = page.locator("#button-new-algorithm-create") button.click() @@ -45,14 +45,11 @@ def test_e2e_create_algorithm_invalid(page: Page): page.goto("/algorithms/new") - button = page.locator("#transparency_obligations-transparantieverplichtingen") - button.click() + page.locator("#transparency_obligations").select_option("geen transparantieverplichtingen") - button = page.locator("#open_source-open-source") - button.click() + page.locator("#open_source").select_option("geen open-source") - button = page.locator("#systemic_risk-systeemrisico") - button.click() + page.locator("#systemic_risk").select_option("geen systeemrisico") button = page.locator("#button-new-algorithm-create") button.click() diff --git a/tests/e2e/test_search_algorithm.py b/tests/e2e/test_search_algorithm.py index ad5d9e75..8f77bde5 100644 --- a/tests/e2e/test_search_algorithm.py +++ b/tests/e2e/test_search_algorithm.py @@ -13,7 +13,7 @@ def test_e2e_search_algorithms(page: Page) -> None: page.locator("#algorithm-search-input").fill("10") with page.expect_response( - "/algorithms/?skip=0&search=10&add-filter-lifecycle=&add-filter-publication-category=&display_type=", + "/algorithms/?skip=0&search=10&add-filter-lifecycle=&add-filter-risk-group=&display_type=", timeout=3000, ) as response_info: expect(page.get_by_text("Algorithm 10", exact=True)).to_be_visible() @@ -34,7 +34,7 @@ def test_e2e_search_scroll_algorithms(page: Page) -> None: page.locator("#algorithm-search-input").fill("Algorithm") with page.expect_request( - "/algorithms/?skip=0&search=Algorithm&add-filter-lifecycle=&add-filter-publication-category=&display_type=", + "/algorithms/?skip=0&search=Algorithm&add-filter-lifecycle=&add-filter-risk-group=&display_type=", timeout=3000, ) as _: algorithm_links = page.locator("#search-results-table tr").count() - 1 @@ -54,7 +54,7 @@ def test_e2e_search_algorithms_with_group_by_lifecycle_view(page: Page) -> None: page.locator("#display_type").select_option("LIFECYCLE") with page.expect_request( - "/algorithms/?skip=0&search=Algorithm&add-filter-lifecycle=&add-filter-publication-category=&display_type=LIFECYCLE", + "/algorithms/?skip=0&search=Algorithm&add-filter-lifecycle=&add-filter-risk-group=&display_type=LIFECYCLE", timeout=3000, ) as _: expect(page.get_by_title("Organizational Responsibilities", exact=True)).to_be_visible() @@ -73,7 +73,7 @@ def test_e2e_search_algorithms_with_group_by_lifecycle_view_and_search(page: Pag page.locator("#display_type").select_option("LIFECYCLE") with page.expect_request( - "/algorithms/?skip=0&search=10&add-filter-lifecycle=&add-filter-publication-category=&display_type=LIFECYCLE", + "/algorithms/?skip=0&search=10&add-filter-lifecycle=&add-filter-risk-group=&display_type=LIFECYCLE", timeout=3000, ) as _: expect(page.get_by_title("Organizational Responsibilities", exact=True)).to_be_visible() diff --git a/tests/repositories/test_algorithms.py b/tests/repositories/test_algorithms.py index 58bbce95..9de1998e 100644 --- a/tests/repositories/test_algorithms.py +++ b/tests/repositories/test_algorithms.py @@ -2,7 +2,7 @@ import pytest from amt.api.lifecycles import Lifecycles -from amt.api.publication_category import PublicationCategories +from amt.api.risk_group import RiskGroup from amt.core.exceptions import AMTRepositoryError from amt.models import Algorithm from amt.repositories.algorithms import AlgorithmsRepository, sort_by_lifecycle, sort_by_lifecycle_reversed @@ -262,7 +262,7 @@ async def test_with_lifecycle_filter(db: DatabaseTestUtils): @pytest.mark.asyncio -async def test_with_publication_category_filter(db: DatabaseTestUtils): +async def test_with_risk_group_filter(db: DatabaseTestUtils): await db.given( [ default_user(), @@ -275,7 +275,7 @@ async def test_with_publication_category_filter(db: DatabaseTestUtils): algorithm_repository = AlgorithmsRepository(db.get_session()) result: list[Algorithm] = await algorithm_repository.paginate( - skip=0, limit=4, search="", filters={"publication-category": PublicationCategories.HOOG_RISICO_AI.name}, sort={} + skip=0, limit=4, search="", filters={"risk-group": RiskGroup.HOOG_RISICO_AI.name}, sort={} ) assert len(result) == 1 diff --git a/tests/schema/test_schema_ai_act_profile.py b/tests/schema/test_schema_ai_act_profile.py index ffa29270..a853415e 100644 --- a/tests/schema/test_schema_ai_act_profile.py +++ b/tests/schema/test_schema_ai_act_profile.py @@ -6,14 +6,14 @@ def test_ai_act_profile_schema_create_new(): algorithm_new = AiActProfile( type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role="aanbieder", ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" - assert algorithm_new.publication_category == "hoog-risico AI" + assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" assert algorithm_new.transparency_obligations == "transparantieverplichtingen" assert algorithm_new.role == "aanbieder" @@ -23,14 +23,14 @@ def test_ai_act_profile_schema_create_new_no_role(): algorithm_new = AiActProfile( type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role=None, ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" - assert algorithm_new.publication_category == "hoog-risico AI" + assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" assert algorithm_new.transparency_obligations == "transparantieverplichtingen" assert algorithm_new.role is None @@ -40,14 +40,14 @@ def test_ai_act_profile_schema_create_new_empty_role_list(): algorithm_new = AiActProfile( type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role=[], ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" - assert algorithm_new.publication_category == "hoog-risico AI" + assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" assert algorithm_new.transparency_obligations == "transparantieverplichtingen" assert algorithm_new.role is None @@ -57,14 +57,14 @@ def test_ai_act_profile_schema_create_new_double_role(): algorithm_new = AiActProfile( type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role=["aanbieder", "gebruiksverantwoordelijke"], ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" - assert algorithm_new.publication_category == "hoog-risico AI" + assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" assert algorithm_new.transparency_obligations == "transparantieverplichtingen" assert algorithm_new.role == "aanbieder + gebruiksverantwoordelijke" @@ -75,7 +75,7 @@ def test_ai_act_profile_schema_create_new_too_many_roles(): AiActProfile( type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role=["aanbieder", "gebruiksverantwoordelijke", "I am too much of a role"], diff --git a/tests/schema/test_schema_algorithm.py b/tests/schema/test_schema_algorithm.py index 98d15c59..b9b241bc 100644 --- a/tests/schema/test_schema_algorithm.py +++ b/tests/schema/test_schema_algorithm.py @@ -8,7 +8,7 @@ def test_algorithm_schema_create_new(): instruments=["urn:instrument:1", "urn:instrument:2"], type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role=["aanbieder", "gebruiksverantwoordelijke"], @@ -18,7 +18,7 @@ def test_algorithm_schema_create_new(): assert algorithm_new.instruments == ["urn:instrument:1", "urn:instrument:2"] assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" - assert algorithm_new.publication_category == "hoog-risico AI" + assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" assert algorithm_new.transparency_obligations == "transparantieverplichtingen" assert algorithm_new.role == ["aanbieder", "gebruiksverantwoordelijke"] @@ -32,7 +32,7 @@ def test_algorithm_schema_create_new_one_instrument(): instruments="urn:instrument:1", type="AI-systeem", open_source="open-source", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", systemic_risk="systeemrisico", transparency_obligations="transparantieverplichtingen", role="aanbieder", @@ -42,7 +42,7 @@ def test_algorithm_schema_create_new_one_instrument(): assert algorithm_new.instruments == ["urn:instrument:1"] assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" - assert algorithm_new.publication_category == "hoog-risico AI" + assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" assert algorithm_new.transparency_obligations == "transparantieverplichtingen" assert algorithm_new.role == ["aanbieder"] diff --git a/tests/services/test_task_registry_service.py b/tests/services/test_task_registry_service.py index d56830a3..d6e8daeb 100644 --- a/tests/services/test_task_registry_service.py +++ b/tests/services/test_task_registry_service.py @@ -70,7 +70,8 @@ async def test_is_requirement_applicable_with_profile(): # given ai_act_profile = AiActProfile( type="AI-systeem", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", + conformity_assessment_body="beoordeling door derde partij", role="gebruiksverantwoordelijke", open_source="open-source", systemic_risk="systeemrisico", @@ -112,7 +113,7 @@ async def test_is_requirement_applicable_with_profile_with_2_roles(): # given ai_act_profile = AiActProfile( type="AI-model voor algemene doeleinden", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", role="aanbieder + gebruiksverantwoordelijke", open_source="geen open-source", systemic_risk="systeemrisico", @@ -154,7 +155,7 @@ async def test_is_requirement_applicable_with_non_matching_profile(): # given ai_act_profile = AiActProfile( type="AI-model voor algemene doeleinden", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", role="aanbieder + gebruiksverantwoordelijke", open_source="geen open-source", systemic_risk="systeemrisico", @@ -196,7 +197,7 @@ async def test_is_requirement_applicable_with_matching_profile(): # given ai_act_profile = AiActProfile( type="AI-model voor algemene doeleinden", - publication_category="hoog-risico AI", + risk_group="hoog-risico AI", role="aanbieder", open_source="geen open-source", systemic_risk="systeemrisico",