Skip to content

Commit e89f02a

Browse files
authored
Merge branch 'main' into structural-edits
2 parents 12eb205 + 9cf7bf8 commit e89f02a

File tree

20 files changed

+570
-483
lines changed

20 files changed

+570
-483
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v2
15+
with:
16+
submodules: recursive # Fetches and initializes submodules
1517

1618
- name: Set up AWS credentials
1719
uses: aws-actions/configure-aws-credentials@v1

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "src/schemas"]
2+
path = src/schemas
3+
url = https://github.com/NGO-Algorithm-Audit/AI-Act-Questions.git

NOTICE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This product includes software developed at
2+
Stichting Algorithm Audit (https://algorithmaudit.eu/).

README.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# AI documentation templates
1+
# AI Act Implementation Tool
22

3-
Open-source templates for model documentation. Based on AI Act requirements and soft law frameworks, such as the Research framework Algorithms of the Netherlands Executive Audit Agency, the Algorithm framework of the Dutch Ministry of the Interior and the Dutch Fundamental Rights Impact Assessment (IAMA).
4-
5-
The templates are available in JSON format and can be easily customized to fit the specific needs of an organization.
3+
Opinionated implementation of [AI act questions](https://github.com/NGO-Algorithm-Audit/AI-Act-Questions) created by the Algorithm Audit team.
64

75
# How to run
86

9-
Follow these steps to set up and run the application on your local machine.
7+
This project includes a Git submodule that references the JSON Schemas repository (LINK), allowing us to keep schema definitions separate while using them within this project. Follow these steps to setup everything correctly.
108

119
## Prerequisites
10+
1211
Ensure the following are installed on your system:
1312

1413
Node.js (version 14 or later)
@@ -20,14 +19,24 @@ node -v
2019
npm -v
2120
```
2221

23-
First, clone the repository to your local machine. Open your terminal and run:
22+
##### 1. Clone the repository to your local machine. Open your terminal and run:
2423

2524
```bash
2625
git clone https://github.com/your-username/your-repo-name.git
2726
cd your-repo-name
2827
```
2928

30-
Once inside the project directory, install the necessary packages by running:
29+
##### 2. JSON Schemas Submodule
30+
31+
```bash
32+
# If you’re cloning this repository for the first time, or if you haven't initialized the submodule yet
33+
git submodule update --init --recursive
34+
35+
# To update the submodule from the remote.
36+
git submodule update --remote --merge
37+
```
38+
39+
##### 3. Once inside the project directory, install the necessary packages by running:
3140

3241
```bash
3342
# If you use npm
@@ -37,31 +46,29 @@ npm install
3746
yarn install
3847
```
3948

40-
After the dependencies are installed, start the development server with:
49+
##### 4. After the dependencies are installed, start the development server with:
4150

4251
```bash
4352
# If using npm
44-
npm start
53+
npm run dev
4554

4655
# Or, if using yarn
47-
yarn start
56+
yarn dev
4857
```
4958

5059
This command will compile and serve the application. By default, it should be accessible at http://localhost:5173 in your web browser.
5160

5261
# How it works.
5362

54-
This implementation extends the [React JSON Schema Form (RJSF) library](https://github.com/rjsf-team/react-jsonschema-form) to create a step-by-step wizard interface. Instead of displaying all form fields at once, it presents them one at a time, with validation and navigation controls.
63+
The actual form schema's are specified in [AI act questions repository.](https://github.com/NGO-Algorithm-Audit/AI-Act-Questions) And this repository is used as a git sub module in this repository.
64+
65+
This rendering implementation extends the [React JSON Schema Form (RJSF) library](https://github.com/rjsf-team/react-jsonschema-form) to create a step-by-step wizard interface. Instead of displaying all form fields at once, it presents them one at a time, with validation and navigation controls.
5566

5667
The original specification is still applicable so please read the [RSJF documentation](https://rjsf-team.github.io/react-jsonschema-form/docs/) for information about how the forms work.
5768

5869
Changes we made to the original specification:
5970

60-
### 1. Multi form support
61-
62-
To show multiple forms on the starting page, we always place our form specifications inside an array. [See our forms](./src/assets/forms.json)
63-
64-
### 2. Output
71+
### 1. Output
6572

6673
The templates should return an outcome after the questions, to show this result we trigger the results component when the question key is `output`. For example:
6774

@@ -77,27 +84,19 @@ This allows us to have multiple different outcomes in one template that each are
7784

7885
In case a form ends without an `output` question we automatically trigger an error component.
7986

80-
### 3. uiSchema integration
81-
82-
To simplify importing the json templates into our front-end we specificy our [uiSchema](https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema) inside the original [object properties](https://rjsf-team.github.io/react-jsonschema-form/docs/json-schema/objects)
87+
### 2. Intermediate output
8388

84-
Example:
89+
To show intermediate outputs or simple text messages to the user we trigger a classname on such elements, to prevent the content from rendering as an input. This is done by adding the following uiSchema definition:
8590

8691
```json
87-
{
88-
"title": "Hello World",
89-
"type": "object",
90-
"required": ["question1"],
91-
"properties": {...},
92-
"dependencies": {...},
93-
"uiSchema": {
94-
"question1": {
95-
"ui:autofocus": true
96-
}
97-
}
92+
"outputIntermediate": {
93+
"ui:widget": "textarea",
94+
"ui:classNames": "intermediate-output"
9895
}
9996
```
10097

98+
In this example we trigger this for the input element `outputIntermediate` but this mechanism can be used for any question.
99+
101100
# Styling overrides
102101

103102
With these css variables defined in the root where the frontend is injected the default theming can be overriden.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>AI Documentatie</title>
77
</head>
88
<body>
9-
<div id="root"></div>
9+
<div id="AIActImplementationTool"></div>
1010
<script type="module" src="/src/main.tsx"></script>
1111
</body>
1212
</html>

0 commit comments

Comments
 (0)