Hm, I can see how my suggestion is confusing. The response of the Universal Summarizer API call is JSON but my intention is that the content of the response itself is JSON.
Some clarifications followed by an example:
- Enhancing the Universal Summarizer is probably incorrect. Looking into the APIs offered, it might make sense for this to be a separate API more akin to an extension on "FastGPT"
- This would be akin to ChatGPTs customization of the model wherein the model's prompt is updated to return a specific response
Example
Query: "Give me the nutritional information for a McDonald's cheeseburger"
Response:
{ "calories": 300, "fat": 14, "carbs": 33, "protein": 15 }
I admit I suggested this without digging into the APIs offered and FastGPT seems like it can mostly produce this already:
curl -v \
-H "Authorization: Bot $TOKEN" \
-H "Content-Type: application/json" \
--data '{"query": "give nutritional data for a mcdonals cheeseburger in json with 'calories', 'fat', 'carbs', 'protein' as keys"}' \
"output": "Here is the nutritional data for a McDonald's cheeseburger in JSON format with calories, fat, carbs, and protein as keys:\n\n{\n \"calories\": 300,\n \"fat\": 14,\n \"carbs\": 33,\n \"protein\": 15\n}\n\nThe information for this JSON response is based on the following sources:\n\n- A McDonald's cheeseburger contains 300 calories. 【1】【2】\n- A McDonald's cheeseburger contains 14 grams of fat. 【2】【3】\n- A McDonald's cheeseburger contains 33 grams of carbohydrates. 【1】【4】\n- A McDonald's cheeseburger contains 15 grams of protein. 【1】【4】",
I say mostly though because it requires me to fine-tune the prompt every time I issue the request. Thus it might be more appropriate to suggest the following:
Additional Context
Enhance the FastGPT API with an option to persist a fine-tuned model with a specific prompt letting me do the following:
- Create FastGPT model "instance"
- Fine-tune model with "Always return results in a JSON scheme with keys: 'calories', 'fat', 'carbs', 'protein'; and only with those keys."
- Issue query against the customized FastGPT model
curl -v \
-H "Authorization: Bot $TOKEN" \
-H "Content-Type: application/json" \
--data '{"query": "give nutritional data for a mcdonals cheeseburger in json with 'calories', 'fat', 'carbs', 'protein' as keys", "model": 10}' \
"output": "{ \"calories\": 300, \"fat\": 14, \"carbs\": 33, \"protein\": 15 }",
But...I'm not sure how far down the rabbit hole of these types of APIs you guys want to provide. This is, in a sense, just offering the same kind of "customized" model as ChatGPT allows for. ¯_(ツ)_/¯