Skip to main content
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

app_config
string
Create a configuration for your app. This is a JSON dictionary.

Response

template_id
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.
app_config
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)