context

Add context data to the context processor

This endpoint accepts context data and sends it to a context processor for further handling. It returns a success or error response depending on the result from the context processor.

post/api/v1/context/add

Request body

sourcestring required

The source of the context data

context_type'resource' | 'conversation' | 'instruction' required

Type of context being added

scope'internal' | 'external' required

Scope of the context

Response

Context added successfully

successboolean required
context_idstring required
processed_documentsnumber

Example response

{
  "success": true,
  "context_id": "ctx_01HXYZABC",
  "processed_documents": 2
}

Changes

Changed in 8 of the 29 revisions of this API.4126

  • 510cbb709bed3117See the full diff
    • the request property context_type became required

      request-property-became-required

    • the request property documents became required

      request-property-became-required

    • the request property source became required

      request-property-became-required

    • removed the optional property response from the response with the 500 status

      response-optional-property-removed

    • the request property scope with a default value became required

      request-property-became-required-with-default

    • added the media type application/json for the response with the status 401

      response-media-type-added

    • added the media type application/json for the response with the status 402

      response-media-type-added

    • added the media type application/json for the response with the status 403

      response-media-type-added

    • added the media type application/json for the response with the status 404

      response-media-type-added

    • added the optional property message to the response with the 500 status

      response-optional-property-added

    • added the optional property processed_documents to the response with the 201 status

      response-optional-property-added

    • added the optional property status to the response with the 400 status

      response-optional-property-added

    • added the optional property status to the response with the 500 status

      response-optional-property-added

    • added the optional property statusText to the response with the 400 status

      response-optional-property-added

    • added the optional property statusText to the response with the 500 status

      response-optional-property-added

    • the response property success became required for the status 400

      response-property-became-required

    • added the required property context_id to the response with the 201 status

      response-required-property-added

    • added the required property error to the response with the 400 status

      response-required-property-added

    • added the required property error to the response with the 500 status

      response-required-property-added

    • added the required property success to the response with the 201 status

      response-required-property-added

    • added the required property success to the response with the 500 status

      response-required-property-added

    • api operation id addContextSync was added

      api-operation-id-added

    • the metadata/groupName request property type/format changed from string[]/ to array/

      request-property-type-changed

    • added the new optional request property metadata/groupName

      new-optional-request-property

    • added the new optional request property context_type

      new-optional-request-property

    • the endpoint scheme security bearerAuth was added to the API

      api-security-added

    • the endpoint scheme security BearerAuth was removed from the API

      api-security-removed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the endpoint scheme security BearerAuth was added to the API

      api-security-added

    • the endpoint scheme security bearerAuth was removed from the API

      api-security-removed

    • the endpoint scheme security bearerAuth was added to the API

      api-security-added

    • the endpoint scheme security BearerAuth was removed from the API

      api-security-removed