Sources

Sources represent the data that is accessible by an application and the language model. A source can be raw text, a file (see files for supported types), a URL (website), or a set of URLs (many pages of a website).

When you create a new source, Chariot automatically extracts the text from the source (based on the source type), splits the text into chunks, embeds the chunks, and stores the resulting vectors in our vector database. This is managed for you so you don't have to maintain it in your app.

Sources are retrieved and included as relevant context for the language model during conversations with an application.

The source object

  • Name
    id
    Type
    string
    Description

    Unique identifier for the source

  • Name
    application_id
    Type
    string
    Description

    Unique identifier for the application this source is associated with.

  • Name
    name
    Type
    string
    Description

    Name of the source. Used when displaying where information came from in a conversation.

  • Name
    type
    Type
    string
    Description

    Type of source. Used to determine how to process the source.

  • Name
    content
    Type
    undefined
    Description

    Source content. This can be text, a list of URLs to crawl, or a file.

  • Name
    embed_status
    Type
    string
    Description

    Status of the source embedding process. Once complete, your source can be queried in conversations with your application.

  • Name
    embed_status_message
    Type
    string
    Description

    Optional message associated with the embed_status. If there is an error processing the source, this field will contain the error message.

  • Name
    updated_at
    Type
    string
    Description

    Timestamp of when the source was last updated

  • Name
    created_at
    Type
    string
    Description

    Timestamp of when the source was created.


GET/sources

List sources

Returns a list of all sources for your account. To get a list of all sources for an application, include the application_id query parameter.

Request

GET
/sources
curl https://api.chariotai.com/sources \
  -H "Authorization: Bearer {YOUR_API_KEY}"

Response

[
  {
        "id": "string",
        "application_id": "app_123",
        "name": "string",
        "type": "string",
        "content": null,
        "embed_status": "PENDING",
        "embed_status_message": "string",
        "updated_at": "2023-05-21T23:59:59",
        "created_at": "2023-05-19T23:59:59"
  }
]

POST/sources

Create source

Creates a new source.

Required attributes

  • Name
    application_id
    Type
    string
    Description

    Unique identifier for the application this source should be associated with.

  • Name
    name
    Type
    string
    Description

    Name of the source. Used when displaying where information came from in a conversation.

  • Name
    type
    Type
    string
    Description

    Type of source. Used to determine how to process the source.

  • Name
    content
    Type
    undefined
    Description

    Source content. This can be text, a list of URLs to crawl, or a file.

Request

POST
/sources
curl https://api.chariotai.com/sources \
  -H "Authorization: Bearer {YOUR_API_KEY}"

Response

{
  "id": "string",
  "application_id": "app_123",
  "name": "string",
  "type": "string",
  "content": null,
  "embed_status": "PENDING",
  "embed_status_message": "string",
  "updated_at": "2023-05-21T23:59:59",
  "created_at": "2023-05-19T23:59:59"
}

GET/sources/{id}

Get source

Retrieves a single source.

Request

GET
/sources/{id}
curl https://api.chariotai.com/sources/{id} \
  -H "Authorization: Bearer {YOUR_API_KEY}"

Response

{
  "id": "string",
  "application_id": "app_123",
  "name": "string",
  "type": "string",
  "content": null,
  "embed_status": "PENDING",
  "embed_status_message": "string",
  "updated_at": "2023-05-21T23:59:59",
  "created_at": "2023-05-19T23:59:59"
}

DELETE/sources/{id}

Delete source

Permanently deletes the specified source. This cannot be undone.

Request

DELETE
/sources/{id}
curl https://api.chariotai.com/sources/{id} \
  -H "Authorization: Bearer {YOUR_API_KEY}"