Import from existing inference logs

Prerequisites: Some logged inferences available in your athina account

  1. Create a dataset by giving it a name and a description

  1. Pick the logged inferences Option and Select the logged inferences you want to include in the dataset

  1. Data will be uploaded to the dataset and you will be able to see them shortly


Upload from JSONL file

Prerequisites: A JSONL file with the required data to create the dataset

1

Create a dataset

Create a dataset by giving it a name and a description

2

Upload JSONL file

  • Rows in the dataset should include one or more of the following fields: query, context, response, expected_response
  • Pick the file upload option and Select the JSONL file you want to upload in the dataset

Make sure that the file format is JSONL.

  • JSONL is a file format that contains a sequence of JSON objects separated by newlines.
  • Each line in a JSONL file is a valid JSON object.

The allowed fields are

  • query
  • context
  • response
  • expected_response.

Note that the context field should be an array of strings.

You can download a sample file from here

3

View your dataset

Your JSONL file will be imported to the dataset and you will be able to see it shortly.

Create Dataset via API

  • Method: POST

  • Endpoint: https://api.athina.ai/api/v1/dataset

  • Headers:

    • athina-api-key: YOUR_ATHINA_API_KEY
    • Content-Type: application/json

Dataset Create Request Body Fields

See the full list of request body parameters here.

dataset_rows is an optional field while creating a dataset. You can use an API mentioned here to add rows separately to a dataset

Sample Request Body

{
  // required fields
  "source": "api",
  "name": "Demo Dataset",

  // optional fields
  "description": "This is a sample demo dataset",
  "language_model_id": "gpt-4",
  "prompt_template": [{
    "role": "system",
    "content": "You are an AI that answers user queries given the information from the context"
  },
  {
    "role": "user",
    "content": "Given this context {context}, Answer this query: {query}"
  }],
  "dataset_rows": [
      {
          "query": "When did Virgin Australia start operating?",
          "context": [
              "\"Virgin Australia, the trading name of Virgin Australia Airlines Pty Ltd, is an Australian-based airline. It is the largest airline by fleet size to use the Virgin brand. It commenced services on 31 August 2000 as Virgin Blue, with two aircraft on a single route. It suddenly found itself as a major airline in Australia's domestic market after the collapse of Ansett Australia in September 2001. The airline has since grown to directly serve 32 cities in Australia, from hubs in Brisbane, Melbourne and Sydney.\""
          ],
          "response": "Virgin Australia commenced services on 31 August 2000 as Virgin Blue, with two aircraft on a single route.",
          "expected_response": "Virgin Australia started services in August 2000"
      },
      {
          "query": "When was Tomoaki Komorida born?",
          "context": [
              "\"Komorida was born in Kumamoto Prefecture on July 10, 1981. After graduating from high school, he joined the J1 League club Avispa Fukuoka in 2000. Although he debuted as a midfielder in 2001, he did not play much and the club was relegated to the J2 League at the end of the 2001 season. In 2002, he moved to the J2 club Oita Trinita. He became a regular player as a defensive midfielder and the club won the championship in 2002 and was promoted in 2003. He played many matches until 2005. In September 2005, he moved to the J2 club Montedio Yamagata. In 2006, he moved to the J2 club Vissel Kobe. Although he became a regular player as a defensive midfielder, his gradually was played less during the summer. In 2007, he moved to the Japan Football League club Rosso Kumamoto (later Roasso Kumamoto) based in his local region. He played as a regular player and the club was promoted to J2 in 2008. Although he did not play as much, he still played in many matches. In 2010, he moved to Indonesia and joined Persela Lamongan. In July 2010, he returned to Japan and joined the J2 club Giravanz Kitakyushu. He played often as a defensive midfielder and center back until 2012 when he retired.\""
          ],
          "response": "Tomoaki Komorida was born on July 10,1981.",
          "expected_response": "Tomoaki Komorida was born in July, 1981"
      },
    ]
}

Sample Response

{
    "status": "success",
    "data": {
        "dataset": {
            "id": "5583b2fd-8940-4a8a-bcf4-e83da95b25a5",
            "source": "api",
            "user_id": "91cfffe9-03f1-4d50-acee-07c4115de42f",
            "org_id": "athina",
            "name": "Demo Dataset",
            "description": "This is a sample demo dataset",
            "language_model_id": "gpt-4",
            "prompt_template": [{
                "role": "system",
                "content": "You are an AI that answers user queries given the information from the context"
              },
              {
                "role": "user",
                "content": "Given this context {context}, Answer this query: {query}"
              }],
            "created_at": "2024-04-12T23:35:24.792Z",
            "updated_at": "2024-04-12T23:35:24.792Z"
        }
    }
}