curl -X POST \
https://api.berri.ai/create_template \
-H 'Content-Type: multipart/form-data' \
-F 'app_config={"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}'
let endpoint = `https://api.berri.ai/create_template`;
app_config = {
advanced: { intent: "qa_doc", search: "default" },
prompt: "Be legal and ethical",
output_length: "256",
};
var formdata = new FormData();
formdata.append("app_config", app_config);
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch(endpoint, requestOptions).then((response) => response.json());
import requests
import json
url = "https://api.berri.ai/create_template"
data = {"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}
response = requests.post(url, data={"app_config": json.dumps(data)})
print(response.text)
{
"template_id": "<string>",
"app_config": {}
}Endpoints
Create Template
You can use this to spin up apps for your users with the same configuration
POST
/
create_template
curl -X POST \
https://api.berri.ai/create_template \
-H 'Content-Type: multipart/form-data' \
-F 'app_config={"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}'
let endpoint = `https://api.berri.ai/create_template`;
app_config = {
advanced: { intent: "qa_doc", search: "default" },
prompt: "Be legal and ethical",
output_length: "256",
};
var formdata = new FormData();
formdata.append("app_config", app_config);
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch(endpoint, requestOptions).then((response) => response.json());
import requests
import json
url = "https://api.berri.ai/create_template"
data = {"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}
response = requests.post(url, data={"app_config": json.dumps(data)})
print(response.text)
{
"template_id": "<string>",
"app_config": {}
}Query
string
Create a configuration for your app. This is a JSON dictionary.
Response
string
The app configuration you sent is now stored as a template. This is it’s
unique id. Use it to automatically spin up chatGPT apps with that exact
configuration.
dictionary
We return back the app config you sent. This is to confirm the parameters that
were sent. We also add a score for the prompt (the lower the better), if one
was submitted.
curl -X POST \
https://api.berri.ai/create_template \
-H 'Content-Type: multipart/form-data' \
-F 'app_config={"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}'
let endpoint = `https://api.berri.ai/create_template`;
app_config = {
advanced: { intent: "qa_doc", search: "default" },
prompt: "Be legal and ethical",
output_length: "256",
};
var formdata = new FormData();
formdata.append("app_config", app_config);
var requestOptions = {
method: "POST",
body: formdata,
redirect: "follow",
};
fetch(endpoint, requestOptions).then((response) => response.json());
import requests
import json
url = "https://api.berri.ai/create_template"
data = {"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}
response = requests.post(url, data={"app_config": json.dumps(data)})
print(response.text)

