Code Containers

Get all Code Containers

Use this endpoint to fetch all code containers accessible to the authenticated user.

get/code_containers

Request

Headers

Accept'application/vnd.nexla.api.v1+json' | 'application/json'

Setting to application/vnd.nexla.api.v1+json is recommended.

Response

Success

idinteger
namestring
resource_type'transform' | 'ai_function' | 'source' | 'sink' | 'error' | 'validator'

The type of resource that this code container is to be used for.

  • transform: For user defined code that is used in a Nexset transform.
  • ai_function: For user defined code that is used in an AI function. See ai_function_type for the scenarios where this is used.
  • source: For user defined code in a source.
  • sink: For user defined code in a sink.
  • error: For user defined code that acts as an error handler.
  • validator: For user defined code that acts as a validator.
ai_function_type'chunker' | 'context_enricher' | 'query_rewriter' | 'reranker'

The type of AI function that this code container is used for.

  • chunker: Used to chunk parsed file content into smaller chunks in a Document Ingestion flow.
  • context_enricher: Used to enrich the context of a query in a RAG flow.
  • query_rewriter: Used to rewrite a query in a RAG flow.
  • reranker: Used to rerank a list of results in a RAG flow.
reusableboolean
publicboolean
access_rolesstring[]

This property reflects all the permissions the user/team/organization has to this resource.

  1. collaborator: The user/team/organization can view the resource but not make any modifications to it.
  2. operator: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it.
  3. administrator: The user/team/organization has complete administrative rights to this resource.
  4. owner: This user created the resource and so has complete administrative rights to it.
descriptionstring
code_type'jolt_standard' | 'jolt_custom' | 'python' | 'python3' | 'javascript'
output_type'record' | 'attribute' | 'custom'

The type of output that this code container produces.

  • record: Produces a full Nexset record. Used only when the code container is used to modify a Nexset, i.e output_type: transform
  • attribute: Produces value for an attribute inside a Nexset record. Used only when the code container is used to modify a value inside a Nexset, i.e output_type: transform
  • custom: Produces custom output. Used as a catch-all output format when a code container is used in any context other than for Nexset modification.
code_configobject
custom_configobject
code_encodingstring
managedboolean
data_setsinteger[]
copied_from_idinteger
updated_atstring date-time
created_atstring date-time
tagsstring[]

Example response

[
  {
    "id": 1,
    "name": "test",
    "description": "test",
    "code_encoding": "none",
    "code": [
      {
        "operation": "nexla.custom",
        "spec": {
          "language": "python",
          "encoding": "base64",
          "script": "ZGVmIHRyYW5zZm9ybShpbnB1dCwgbWV0YWRhdGEsIGFyZ3MpOgogICMgU2FtcGxlIHB5dGhvbiB0cmFuc2Zvcm0gdG8gcGFzcyBhbGwgYXR0cmlidXRlcyB0aHJvdWdoCiAgcmV0dXJuIGlucHV0"
        }
      }
    ],
    "updated_at": "2023-01-24T03:26:43.000Z",
    "created_at": "2023-01-24T03:26:43.000Z"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.