Skip to content

Commit 2c23d38

Browse files
authored
Update README.md
1 parent 5198b81 commit 2c23d38

File tree

1 file changed

+32
-71
lines changed

1 file changed

+32
-71
lines changed

README.md

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

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

5-
## Quickstart
65

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-
```
6+
## Development
667

678
### Run the Script
689

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

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

7314
Use the following command to run the evaluation function directly:
7415

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

7920
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:
8022

81-
**Shimmy**
82-
83-
To have a more user-friendly experience, you can use [Shimmy](https://github.com/lambda-feedback/shimmy) to run the evaluation function.
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+
```
8438

85-
To run the evaluation function using Shimmy, use the following command:
39+
Which gives the response:
8640

87-
```bash
88-
shimmy -c "wolframscript" -a "-f" -a "evaluation_function.wl" -i file
8941
```
90-
91-
## Development
42+
{
43+
"command": "eval",
44+
"result": {
45+
"is_correct": true,
46+
"feedback": "Your answer is correct!",
47+
"error": null
48+
}
49+
}
50+
```
9251

9352
### Prerequisites
9453

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

12887
```bash
129-
docker build -t my-wolfram-evaluation-function .
88+
docker build -t wolfram-evaluation-function .
13089
```
13190

13291
### Running the Docker Image
@@ -162,6 +121,8 @@ curl --location 'http://localhost:8080/wolframEvaluationFunction' \
162121
}
163122
}'
164123
```
124+
125+
165126
## Deployment
166127

167128
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)