Skip to content

Commit 0a438f8

Browse files
authored
Merge branch 'main' into docs/readme-update
2 parents c5cfe77 + 6f97723 commit 0a438f8

File tree

1 file changed

+71
-32
lines changed

1 file changed

+71
-32
lines changed

README.md

Lines changed: 71 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,74 @@
11
# Wolfram Language Evaluation Function
22

3-
This repository contains an implementation of a Wolfram evaluation function that checks if the structure, numeric value or any other value are equal.
3+
This repository contains the boilerplate code needed to create a containerized evaluation function written in Wolfram Language.
44

5+
## Quickstart
56

6-
## Development
7+
This chapter helps you to quickly set up a new Wolfram evaluation function using this template repository.
8+
9+
> [!NOTE]
10+
> After setting up the evaluation function, delete this chapter from the `README.md` file, and add your own documentation.
11+
12+
#### 1. Create a new repository
13+
14+
- In GitHub, choose `Use this template` > `Create a new repository` in the repository toolbar.
15+
16+
- Choose the owner, and pick a name for the new repository.
17+
18+
> [!IMPORTANT]
19+
> If you want to deploy the evaluation function to Lambda Feedback, make sure to choose the Lambda Feedback organization as the owner.
20+
21+
- Set the visibility to `Public` or `Private`.
22+
23+
> [!IMPORTANT]
24+
> If you want to use GitHub [deployment protection rules](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules), make sure to set the visibility to `Public`.
25+
26+
- Click on `Create repository`.
27+
28+
#### 2. Clone the new repository
29+
30+
Clone the new repository to your local machine using the following command:
31+
32+
```bash
33+
git clone <repository-url>
34+
```
35+
36+
#### 3. Configure the evaluation function
37+
38+
When deploying to Lambda Feedback, set the evaluation function name in the `config.json` file. Read the [Deploy to Lambda Feedback](#deploy-to-lambda-feedback) section for more information.
39+
40+
#### 4. Develop the evaluation function
41+
42+
You're ready to start developing your evaluation function. Head over to the [Development](#development) section to learn more.
43+
44+
#### 5. Update the README
45+
46+
In the `README.md` file, change the title and description so it fits the purpose of your evaluation function.
47+
48+
Also, don't forget to delete the Quickstart chapter from the `README.md` file after you've completed these steps.
49+
50+
## Usage
51+
52+
You can run the evaluation function either using [the pre-built Docker image](#run-the-docker-image) or build and run [the binary executable](#build-and-run-the-binary).
53+
54+
### Run the Docker Image
55+
56+
The pre-built Docker image comes with [Shimmy](https://github.com/lambda-feedback/shimmy) installed.
57+
58+
> [!TIP]
59+
> Shimmy is a small application that listens for incoming HTTP requests, validates the incoming data and forwards it to the underlying evaluation function. Learn more about Shimmy in the [Documentation](https://github.com/lambda-feedback/shimmy).
60+
61+
The pre-built Docker image is available on the GitHub Container Registry. You can run the image using the following command:
62+
63+
```bash
64+
docker run -p 8080:8080 ghcr.io/lambda-feedback/evaluation-function-boilerplate-wolfram:latest
65+
```
766

867
### Run the Script
968

1069
You can choose between running the Wolfram evaluation function itself, ore using Shimmy to run the function.
1170

12-
**Local**
71+
**Raw Mode**
1372

1473
Use the following command to run the evaluation function directly:
1574

@@ -18,36 +77,18 @@ wolframscript -f evaluation_function.wl request.json response.json
1877
```
1978

2079
This will run the evaluation function using the input data from `request.json` and write the output to `response.json`.
21-
An example `request.json` is:
2280

23-
```
24-
{
25-
"method": "eval",
26-
"params": {
27-
"answer":"Sin[p x + q]",
28-
"response":"Sin[a x + b]",
29-
"params":{
30-
"comparisonType":"structure",
31-
"named_variables":"{x}",
32-
"correct_response_feedback":"Your answer is correct!",
33-
"incorrect_response_feedback":"Your answer is incorrect!"
34-
}
35-
}
36-
}
37-
```
81+
**Shimmy**
3882

39-
Which gives the response:
83+
To have a more user-friendly experience, you can use [Shimmy](https://github.com/lambda-feedback/shimmy) to run the evaluation function.
4084

85+
To run the evaluation function using Shimmy, use the following command:
86+
87+
```bash
88+
shimmy -c "wolframscript" -a "-f" -a "evaluation_function.wl" -i file
4189
```
42-
{
43-
"command": "eval",
44-
"result": {
45-
"is_correct": true,
46-
"feedback": "Your answer is correct!",
47-
"error": null
48-
}
49-
}
50-
```
90+
91+
## Development
5192

5293
### Prerequisites
5394

@@ -85,7 +126,7 @@ wolframscript -f evaluation_function.wl request.json response.json
85126
To build the Docker image, run the following command:
86127

87128
```bash
88-
docker build -t wolfram-evaluation-function .
129+
docker build -t my-wolfram-evaluation-function .
89130
```
90131

91132
### Running the Docker Image
@@ -121,8 +162,6 @@ curl --location 'http://localhost:8080/wolframEvaluationFunction' \
121162
}
122163
}'
123164
```
124-
125-
126165
## Deployment
127166

128167
This section guides you through the deployment process of the evaluation function. If you want to deploy the evaluation function to Lambda Feedback, follow the steps in the [Lambda Feedback](#deploy-to-lambda-feedback) section. Otherwise, you can deploy the evaluation function to other platforms using the [Other Platforms](#deploy-to-other-platforms) section.

0 commit comments

Comments
 (0)