POST
/
create_app
curl -X POST \
  https://api.berri.ai/create_app \
  -H 'Content-Type: multipart/form-data' \
  -F template_id=9a5f0111-4e8b-428d-8fda-863773fe41cd \
  -F user_email=krrish@berri.ai \
  -F data_source=@/Users/krrishdholakia/Downloads/quizlet_wa_test_1.pdf
{
  "api_endpoint": "<string>",
  "website_endpoint": "<string>",
  "instance_id": "<string>",
  "plugin_yaml": "<string>",
  "plugin_manifest": "<string>"
}

Here’s a link to a replit showing how to create an app: https://replit.com/@krrishdholakia/BerriAPIQuizlet?v=1

Query

user_email
string

Pass in your email, this will map the app you create to your account.

data_source
string

You can either send a single data source: a single file (.pdf, .zip, .pptx, .docx, .txt) or a website/API URL.

import requests

url = "https://api.berri.ai/create_app"

data = {"template_id": template_id, "user_email": "krrish@berri.ai"}

files = {'data_source': open('quizlet_wa_test_1.pdf', 'rb')}

response = requests.post(url, files=files, data=data)

Or multiple data sources: a list of strings or website URLs.

import requests
import json

tmp_list = ["hello world", "https://stripe.com/docs/india-accept-international-payments#TransactionPurposeCode"]

url = "https://api.berri.ai/create_app"
data = {"user_email": "krrish@berri.ai", "data_source": json.dumps(tmp_list)}
response = requests.post(url, data=data)
response.text

Additionally, you can also send in metadata for each data source.

import requests
import json

api_endpoint = "https://api.berri.ai/create_app"

data_source = [{"chunk": "hello", "chunk_metadata": "test_metadata"}, {"chunk": "hey there", "chunk_metadata": "test_metadata_2"}]

data = {
  "user_email": "krrish@berri.ai",
  "data_source": json.dumps(data_source)
}

response = requests.post(api_endpoint, data=data)

print(response.text)
template_id
string

The app configuration you sent to /create_template is now stored as a template. This is it’s unique id. Use it to automatically spin up chatGPT apps with that exact configuration.

prompt
string

Optional - use this to help specify how you want your output to be. This will override the prompt you set in your template if this field is set eg. You are an AI customer support bot for Substack blog posts

plugin_name
string

OpenAI Plugin Parameter Use this Parameter to set the name for your plugin ex. resume knowledge

plugin_description
string

OpenAI Plugin Parameter Use this Parameter to set a model description for your plugin ex. Plugin for querying data about Ishaan’s resume

Response

api_endpoint
string

This will return an api endpoint which you can use to query your app.

website_endpoint
string

This will return a website endpoint which you can use for quick prototyping.

instance_id
string

This will return the instance_id, which you can specify when calling api.berri.ai/query

plugin_yaml
string

OpenAI Plugin Field: This is the auto created openapi.yaml file for your berri More info here: https://platform.openai.com/docs/plugins/examples

plugin_manifest
string

OpenAI Plugin Field: This is the auto created ai-plugin.json file for your berri More info here: https://platform.openai.com/docs/plugins/examples