Feature support by language

Not all features are supported by all languages. Refer to the chart below for feature support by language.

Functions capability by languageAIP LogicTypeScript v1TypeScript v2PythonDescription
Ontology object supportYesYesYesYesThe ability to access Ontology objects in your function.
Ontology interfaces supportNoNoYesNoThe ability to access and edit Ontology interfaces in your function.
Ontology edits supportYesYesYesYesThe ability to edit Ontology objects in your function.
Media handling supportNoYesPartialPartialThe ability to interact with media items. TypeScript v1 supports full media operations, including document OCR and audio transcription. TypeScript v2 and Python support media uploads via Ontology edits and basic operations on media properties, but do not support document-specific or audio-specific operations.
Queryable in WorkshopYesYesYesYesInvoking a function from a Workshop application.
Usable in Pipeline BuilderNoNoNoYesCalling a function from Pipeline Builder pipelines.
Functions on models supportYesYesYesYesExecuting live deployment models from a function. TypeScript v2 and Python require ontology-bound model functions.
Language model integrationNoNoYesYesCalling language models through proxy endpoints using model aliases and Platform SDK imports.
Semantic search supportYesYesYesYesUse functions to create vectors for semantic search.
Webhook supportNoYesNoNoThe ability to call webhooks from functions.
External API call supportNoYesYesYesQuerying external services from within functions.
Serverless execution supportYesYesYesYesA serverless function will be spun up on demand when invoked. Refer to serverless functions below for more information.
Deployed execution supportNoNoYesYesA deployed function will have dedicated resources allocated to it, ready to serve requests.
Staged writes support [Beta]NoNoYesNoThe ability to use staged writes for read-after-write guarantees and atomic execution in edit functions.
Call function from API gatewayYesYesYesYesThe ability to hit a query function from the API gateway.
Marketplace supportYesYesYesYesThe ability to package and ship functions in Marketplace.
Bring-your-own-modelYesYesNoNoThe ability to register a function as a model. The function interface method is a legacy approach that applies to TypeScript v1 only.

Ontology SDK support

Python and TypeScript v2 functions support the Ontology SDK (OSDK). The OSDK allows you to leverage the Ontology directly from your development environment and provides benefits such as compatibility with Developer Console and OSDK versioning. We recommend using Python or TypeScript v2 to access these benefits in your functions repository.

TypeScript v1 vs. TypeScript v2

Both TypeScript v1 and TypeScript v2 allow users to leverage TypeScript's core language features, but there are differences in supported platform features, as shown in the feature support table above. We recommend building workflows using TypeScript v2 functions to take advantage of several key improvements over TypeScript v1:

  • Serverless execution in a full Node.js runtime: TypeScript v2 functions run in a Node.js environment, supporting core modules like fs, child_process, and crypto. This enables greater compatibility with NPM libraries that interact with the file system, perform CPU-intensive tasks in parallel, or require other system-level operations.
  • First-class OSDK support: The OSDK can now be used seamlessly in TypeScript v2 functions, making it easy to reuse code, both in and out of the platform. It also provides more efficient APIs for working with large-scale Ontology data.
  • Configurable resource requests: TypeScript v2 functions allow you to request up to 8 vCPUs and 5GB of memory, offering greater control over performance and scalability.
  • Staged writes [Beta]: TypeScript v2 supports staged writes, an alternative execution model for Ontology edit functions that provides read-after-write guarantees within the function and allows nested calls to other staged-write functions.

Serverless functions

If serverless functions are enabled for your enrollment, new repositories will use serverless functions by default. We recommend using serverless functions instead of deployed functions for most use cases. With serverless functions, you can have multiple versions of a single function available on demand, making upgrades safer.

When using Python or TypeScript v2 functions, there are also some cases where deployed functions are preferred or must be used instead of serverless, but these are not common. If available, serverless functions are preferred for several reasons:

  • Serverless functions enable different versions of a single function to be executed on demand, making upgrades safer. With deployed functions, you can only run a single function version at a time.
  • Serverless functions only incur costs when executed, while deployed functions incur costs as long as the deployment is running.
  • Serverless functions require less upfront setup and long-term maintenance, as the infrastructure is managed automatically.