POST
/
finetune_instance
import requests
import json

payload = [{
"context": "In what year did Neil Armstrong land on the moon?",
"correct_response": "1969"
}, {
"context": "Who is the author of the book 'To Kill a Mockingbird'?",
"correct_response": "Harper Lee"
}, {
"context": "What is the capital of France?",
"correct_response": "Paris"
}]

url = "https://api.berri.ai/finetune_instance"
args = {
"user_email": "krrish@berri.ai",
"instance_id": "7156c47f-2f70-4c81-a622-5dc21ef716d2"
}
headers = {'Content-Type': 'application/json'}
data = json.dumps(payload)
response = requests.post(url, params=args, headers=headers, data=data)
print(response.text)

{
  "status": "<string>",
  "api_endpoint": "<string>"
}

Fine-tune

This endpoint is used to finetune an instance by passing in the required information as parameters in the request.

Request Body The request body should contain a list of JSON objects, with each object containing both context and correct_response attributes. The structure of the request body should be as follows:

user_email
string

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

instance_id
string

The instance_id you received after calling create_app

data
string
default: "[]"required

The request body should contain a list of JSON objects, with each object containing both context and correct_response attributes. The structure of the request body should be as follows:

  [
      {
          "context": "In what year did Neil Armstrong land on the moon?",
          "correct_response": "1969"
      },
      {    "context": "Who is the author of the book 'To Kill a Mockingbird'?",
          "correct_response": "Harper Lee"
      },
      {    "context": "What is the capital of France?",
          "correct_response": "Paris"
      }
  ]

Response

status
string

A string indicating the status of the request. This will be “success” if the request was successful and the feedback was stored

api_endpoint
string

Your api endpoint of the finetuned instance