- Create a
Config.toml
file in the root directory and add the below content.
openAIKey = "<OPEN_AI_KEY>"
- Create an OpenAI account and obtain
an API key and replace with
<OPEN_AI_KEY>
.
Run the following command from the root directory of the sample.
$ bal run
$ curl -X POST http://localhost:8080/api/reviews/summary -H "Content-Type: application/json" -d '{"reviews":["I recently ordered a laptop and it was in very good condition and it was delivered on time. But there were some software glitches and I couldn'\''t find enough instructions to troubleshoot them. Would be great if they provided more detailed manuals.","The smartphone I ordered arrived with a damaged screen. They need to be careful when packaging.","Extremely satisfied with my orders. Would suggest this place to anyone.","Everything is great about them expect some deliveries take too long. Would suggest improving shipping speed to reduce delays."]}'