Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

[Question] Typescript textRequest contexts are limited to one #110

@leomongeg

Description

@leomongeg

Quick question,

why the contexts are limited to one in the interface QueryRequestOptions definition:

    /**
     * Base query request options.
     * See details at https://docs.api.ai/docs/query
     */
    interface QueryRequestOptions extends RequestOptions {
        timezone?: string;
        resetContexts?: boolean;
        sessionId: string;
        contexts?: [any]; // Forced to be an array of one element
        entities?: [any];
        version?: string;
        requestSource?: string;
        originalRequest?: any;
    }

As you can see the contexts are limited to be an array of one element and the API allows more than one context in the query request:

Name Type Description Required
contexts Array Array of additional context objects. Should be sent via a POST /query request. Contexts sent in a query are activated before the query. See Contexts. Optional

There is a reason for that?

Kind Regards,
Leonardo Monge García.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions