ElementalInference / Client / get_function

get_function

ElementalInference.Client.get_function(**kwargs)

Retrieves the details of a function, including its expressions, the media context that Elemental Inference derived from the request expression, and the feeds that currently reference it.

See also: AWS API Documentation

Request Syntax

response = client.get_function(
    id='string'
)
Parameters:

id (string) –

[REQUIRED]

The ID of the function.

Return type:

dict

Returns:

Response Syntax

{
    'name': 'string',
    'target': {
        'bedrock': {
            'api': 'INVOKE_MODEL',
            'model': 'string'
        },
        'passthrough': {}
    },
    'requestExpression': 'string',
    'responseExpression': 'string',
    'description': 'string',
    'eventBridgeDelivery': 'ENABLED'|'DISABLED',
    'arn': 'string',
    'id': 'string',
    'status': 'CREATING'|'AVAILABLE'|'REFERENCED'|'DELETING'|'DELETED',
    'references': [
        'string',
    ],
    'contextTypes': [
        'FRAMES'|'SUBTITLES'|'CONTEXTUAL_METADATA'|'CLIP_METADATA',
    ],
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • name (string) –

      The name of the function.

    • target (dict) –

      The destination for the request that the function builds.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: bedrock, passthrough. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
      
      • bedrock (dict) –

        Send the request to an Amazon Bedrock model.

        • api (string) –

          The Amazon Bedrock API to call. The only valid value is INVOKE_MODEL.

        • model (string) –

          The model to invoke. Specify one of the following:

          • A model ID.

          • An inference profile ID.

          • The ARN of a custom model.

          • The ARN of a provisioned model.

          Elemental Inference invokes the model in the Region of the feed. To use a model in other Regions, specify a cross-Region inference profile ID. A custom or provisioned model must be in the Region of the feed.

          The request expression must produce a request body that this model accepts, and the model must accept the kind of media that the request expression references. For example, a text-only model can’t accept a request that references media.frames.

      • passthrough (dict) –

        Send the request nowhere. Use this target to reshape the metadata that Elemental Inference already produces, with no model invocation and no model charges.

    • requestExpression (string) –

      The JSONata expression that builds the request. Elemental Inference evaluates it against the media object of the feed, which holds the media and metadata that the function asked for.

    • responseExpression (string) –

      The JSONata expression that selects what to store. Elemental Inference evaluates it against the result as its root: the model response for a Bedrock target, or the output of the request expression for a passthrough target. If a function has no response expression, Elemental Inference stores the entire result.

    • description (string) –

      The description of the function.

    • eventBridgeDelivery (string) –

      Indicates whether Elemental Inference also sends this function’s results to Amazon EventBridge. With ENABLED, each result that is a JSON object with a top-level eventBridge field set to true is also sent as a Function Metadata Generated event to the default event bus in your account.

    • arn (string) –

      The ARN of the function.

    • id (string) –

      The ID of the function.

    • status (string) –

      The status of the function.

    • references (list) –

      The IDs of the feeds that have a function output, enabled or disabled, that references this function. While this list isn’t empty, the function can’t be deleted, and its name and target can’t be changed.

      • (string) –

    • contextTypes (list) –

      The kinds of media context that this function uses. Elemental Inference derives this field from the media paths that the request expression references; you can’t set it. An empty list means that the expression references no media, so Elemental Inference supplies none at run time.

      • (string) –

        One kind of media context that a function reads. Elemental Inference derives this value from the media paths that the request expression references:

        • FRAMES – Derived from media.frames.

        • SUBTITLES – Derived from media.transcript.

        • CONTEXTUAL_METADATA – Derived from media.contextual.

        • CLIP_METADATA – Derived from media.clip.

        A request expression can reference at most one of SUBTITLES, CONTEXTUAL_METADATA, and CLIP_METADATA, in addition to FRAMES.

    • tags (dict) –

      The tags associated with the function.

      • (string) –

        • (string) –

Exceptions