import requestsimport jsonpayload = [{"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)
Finetune your instance by providing it context and correct answer
POST
/
finetune_instance
Copy
import requestsimport jsonpayload = [{"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)
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:
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:
Copy
[ { "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" } ]
import requestsimport jsonpayload = [{"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)