Outline

Create a personalized outline of resources for a user.

HOST: https://ai.compasai.com/api/agt

SSE /create_outline

Query Parameters

input_str

string

Topic + Proficiency + Materials + Hours e.g Python for Beginner. Videos & Slides only. 10 hours of content

required

library_id

int

ID of the library to create the outline from

required

key_topics

list

Hand picked key topics the learner wants to be in their outline.

optional

strict

boolean

Set to true if user only wants the key topics given above

optional

Response (SSE Events)

Event to listen to when the aggregator has started running
{
    "type": "start", 
    "content": "outline", 
    "seconds": 0.01
}

Sample

import EventSource from "eventsource";

const url = "https://ai.compasai.com/api/agt/create_outline";

const eventSource = new EventSource(url, {
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
  },
});

eventSource.onmessage = (event) => {
  console.log("Received raw:", event.data);
  try {
    const data = JSON.parse(event.data);

    switch (data.type) {
      case "start":
        console.log("Stream started");
        break;

      case "outline":
        console.log("Performing outline creation");
        break;

      case "complete":
        console.log("All done!");
        break;

      default:
        console.log("Unknown event type:", data.type);
    }
  } catch (err) {
    console.log("Non-JSON event:", event.data);
  }
};

eventSource.onerror = (error) => {
  console.error("SSE error:", error);
  eventSource.close();
};

Last updated