Skip to main content

Generation

Nipun SahAIyak is a platform to augment education with AI. More info about Nipun SahAIyak here.

Generation is the step of Bharat SahAIyak's AI augmentation for assessment flows where content of the assessments is generated using AI.

Verbal Assessments

A typical verbal assessment flow consists of a paragraph that the assessee is supposed to read at a particular correctness and speed for evaluation. The complexity of these passages changes with grade levels and the assessment thresholds change too. We can use AI to generate these passages in different languages.

For this Nipun SahAIyak contains the Compentency based Passage Generator. This generator uses Autotune's Dataset Builder from Bharat SahAIyak to create the best prompt and model combinations to generate the required passages.

Nipun SahAIyak Architectural Overview

The user is required to enter the complexity of the passage into the prompt along with the model of the users choice to start a workflow. Dataset Builder generates the results and displays it to the user. The user can then mark the output as good examples or bad examples. The good and back examples are appended to the previous prompt leading to better results in subsequent runs till the user is happy with the generated results. The generated prompt and examples are save as a part of workflow which can be used later for fine tuning and ingestion of questions. More info about Dataset Builder {here}

Non - Verbal Assessments

A typical non - verbal assessment flow consists of a form containing questions and the assessee entering or selecting the correct answer. The questions can be:

  • Comprehension based questions - Where a comprehension is shown to the assessee and related questions are asked.
  • Multiple choice questions - Where a question and some choices are shown to the assessee where one of the choices is correct.
  • Free text questions - Where a question is shown to the assessee and the answer is expected as a short paragraph or a long paragraph.

Nipun SahAIyak augments the generation of all the above question types with AI with the Competency based Q&A Generator. This generator also internally uses Autotune's Dataset Builder to allow the user to tune their prompts with good and bad examples.

API

POST
workflow/create Create Workflow

Request Body

{
"workflow_name": "Grade 1 - Math Competency Questions",
"competency_id": "b5b2a68a-3ddd-462c-a79a-382a3b1ea3be",
"prompt_schema_format": "QnA",
"tags": [
"string"
],
"user_prompt": "The task is to generate questions to test addition and substraction for grade 1 students. Your task is to generate addition questions or subtraction questions with single digits numbers."
}

Definition:

NameTypeRequiredDescription
workflow_namestringYesThe name of the workflow for the task.
competency_idstringYesThe unique identifier for the competency being tested.
prompt_schema_formatstringYesThe format for the prompt schema. By default there are few templates present to help generate examples compatible with the GAP format. For now comprehension and QnA values are allowed.
tagsarrayYesA list of tags categorizing the type of content
user_promptstringYesPrompts to be passed to LLM model to generate the questions
POST
workflow/{workflow_id}/iterate Iteration step to generate examples

Request Body

{
"total_examples": 6,
"max_iterations": 5,
"batch_size": 3,
"user_prompt": "string",
"examples": [
{
"text": {... example object},
"label": "",
"reason": ""
}
],
}

Definition:

NameTypeRequiredDescription
total_examplesnumberYesThe total number of examples to generate for the task.
max_iterationsnumberYesThe maximum number of iterations allowed for generating the examples.
batch_sizenumberYesThe number of examples to be processed in each batch.
user_promptstringYesUsers can use this field to fine tune the prompt in each iteration
examplesarrayYesA list of examples to guide the generation process. Ideal example list should contains specific cases or scenarios to be included.
examples.textanyYesAI generated data in the format specified while creating the workflow
examples.labelanyYesTags categorizing the type of content
examples.reasonstringYesExplanation to specify why an example is correct or incorrect that helps fine tune the responses generated by LLM

Response

{
"workflow_cost": "$0.0110",
"iteration_cost": "$0.0019",
"estimated_dataset_cost": "$0.0095",
"data": []
}

Definition:

NameTypeRequiredDescription
workflow_coststringYesThe total cost incurred for running the workflow
iteration_coststringYesThe cost incurred for each iteration
estimated_dataset_coststringYesThe estimated cost for generating the dataset
dataarrayYesA list containing the generated data that can be used again in the iteration step
POST
workflow/{workflow_id}/generation Generation step to build dataset after fine tuning the prompts

Request Body

{
"total_examples": 10,
"batch_size": 10
}

Definition:

NameTypeRequiredDescription
total_examplesnumberYesTotal number of examples to generate
batch_sizenumberYesThe number of examples to be processed in each batch.

Response Body

{
"message": "Tasks creation initiated",
"task_id": "813ae503-bbce-4da7-a1e7-2babb218f543",
"workflow_id": "0d472090-3cf7-4c5f-8a1f-6c1d0ad13494",
"expeced_cost": "0.0095"
}

Definition:

NameTypeDescription
messageStringDescribes the status or action taken
task_idStringUnique identifier for the task
workflow_idStringUnique identifier for the workflow
expeced_costStringExpected cost of the task execution
GET
workflow/dataset?workflow_id={workflow_id}&task_id={task_id}&page={page}&page_size={page_size} Get generated data to review

Definition

NameTypeRequiredDescription
workflow_iduuidYESUnique identifier for the workflow
task_iduuidYESUnique identifier for the task
pagenumberNOThe current page number in a paginated list. It indicates which page of results is being requested or displayed. If not specified, all data will be sent.
page_sizenumberNOThe number of items per page in a paginated list. It defines how many results should be displayed on each page. If not specified, all data will be sent.

Response Body

[
{
"example_id": "b556ef80-7eb2-4e8e-8cbe-d774cb7119c8",
"prompt_id": "0096138f-4c70-43c8-aee2-466f354e21cc",
"text": "5 + 3",
"choices": [
{
"text": "7",
"score": 1
},
{
"text": "8",
"score": 0
},
{
"text": "6",
"score": 0
},
{
"text": "5",
"score": 0
}
]
},
{
"example_id": "cfaf2c88-c4a0-42be-bd92-da7e50666faf",
"prompt_id": "0096138f-4c70-43c8-aee2-466f354e21cc",
"text": "9 - 5",
"choices": [
{
"text": "4",
"score": 1
},
{
"text": "2",
"score": 0
},
{
"text": "3",
"score": 0
},
{
"text": "7",
"score": 0
}
]
}
]

Definition:

NameTypeDescription
example_idStringUnique ID associated with the generated example
prompt_idStringPrompt identifier used to generate this example
...textanyGenerated dataset based on the prompt schema format
POST
workflow/{workflow_id}/ingest Ingest the finalized data

Request Body

{
"workflow_id": "0d472090-3cf7-4c5f-8a1f-6c1d0ad13494",
"task_id": "813ae503-bbce-4da7-a1e7-2babb218f543",
"example_ids": ["cfaf2c88-c4a0-42be-bd92-da7e50666faf", "b556ef80-7eb2-4e8e-8cbe-d774cb7119c8"],
"question_type": "single-select",
"competency_id": "b5b2a68a-3ddd-462c-a79a-382a3b1ea3be",
"prompt_schema_format": "QnA",
"config": {
"text": "Attempt the questions on a copy and answer them below.",
"group_size": 4
}
}

Definition

NameTypeRequiredDescription
workflow_idStringYesUnique identifier for the workflow
task_idStringYesUnique identifier for the task
example_idsArrayYesList of example identifiers
question_typeStringYesType of question, e.g., "single-select"
competency_idStringYesUnique identifier for the competency
prompt_schema_formatStringYesFormat of the prompt schema, e.g., "QnA"
configObjectYesConfiguration object containing additional details
config.textStringYesAdditional instructional text to be added in the questionnaires
config.group_sizenumberYesSize of a group for the QnA type datasets

Response

{
"id": "90IcAqHNbAv0",
"competency_id": "b5b2a68a-3ddd-462c-a79a-382a3b1ea3be",
"data": {...ingested questionnaires},
"description": null,
"created_at": "2024-05-17T05:16:56.187Z",
"updated_at": "2024-05-17T05:16:56.187Z",
"is_active": true
}

Definition

NameTypeRequiredDescription
idStringYesUnique identifier for the object.
competency_idStringYesIdentifier linking to a specific competency.
dataObjectYesList of ingested questionnaires
descriptionStringNoOptional description of the object; may be null.
created_atStringYesTimestamp of object creation.
updated_atStringYesTimestamp of last update.
is_activeBooleanYesIndicates whether the object is currently active.