You can then check the status of the job by running:
```bash copy
curl -X GET http://127.0.0.1:4000/api/jobs\?id\=cab6eea8-8b1e-4144-9a70-f905c5ef375b
# response [{"id":"07026571-edc8-42ab-b38c-6b3cf19971b6","result":{"container":"gpt4","output":{"message":"No, shrimps cannot fry rice by themselves. However, in culinary terms, shrimp fried rice is a popular dish in which cooked shrimp are added to fried rice along with other ingredients. Cooks or chefs prepare it by frying the rice and shrimps together usually in a wok or frying pan."}},"status":"success"}]
```
And if you have `jq` installed and piped the last output to a file, you can instead run:
"output": "Yes, shrimp can be used to make fried rice. In many Asian cuisines, shrimp is a popular ingredient in fried rice dishes. The shrimp adds flavor and protein to the dish, and can be cooked along with the rice and other ingredients such as vegetables, eggs, and seasonings."
}
},
"status": "success"
}
]
```
## Making a Web3 Request
Now let's bring this service onchain! First we'll have to deploy the contracts.
The [contracts](contracts)
directory contains a simple foundry project with a simple contract called `PromptsGpt`.
This contract exposes a single
function `function promptGPT(string calldata prompt)`. Using this function you'll be
able to make an infernet request.
**Anvil Logs**: First, it's useful to look at the logs of the anvil node to see what's
going on. In a new terminal, run
`docker logs -f anvil-node`.
**Deploying the contracts**: In another terminal, run the following command:
```bash
make deploy-contracts project=gpt4
```
### Calling the contract
Now, let's call the contract. So far everything's been identical to
the [hello world](projects/hello-world/README.mdllo-world/README.md) project. The only
difference here is that calling the contract requires an input. We'll pass that input in
using an env var named
`prompt`:
```bash copy
make call-contract project=gpt4 prompt="Can shrimps actually fry rice"
```
On your anvil logs, you should see something like this:
```bash
eth_sendRawTransaction
_____ _____________ _ _
| __ \|_ _|__ __| | | | /\ | |
| |__) | | | | | | | | | / \ | |
| _ / | | | | | | | |/ /\ \ | |
| | \ \ _| |_ | | | |__| / ____ \| |____
|_| \_\_____| |_| \____/_/ \_\______|
subscription Id 1
interval 1
redundancy 1
node 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
output: {'output': 'Yes, shrimps can be used to make fried rice. Fried rice is a versatile dish that can be made with various ingredients, including shrimp. Shrimp fried rice is a popular dish in many cuisines, especially in Asian cuisine.'}