langchain.js
    Preparing search index...

    Class for interacting with the Google Routes API It extends the StructuredTool class to perform retrieval.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    apiKey: string
    description: string
    name: string
    schema: ZodObject<
        {
            arrivalTime: ZodOptional<ZodString>;
            computeAlternativeRoutes: ZodBoolean;
            departureTime: ZodOptional<ZodString>;
            destination: ZodString;
            extraComputations: ZodOptional<ZodArray<ZodEnum<["TOLLS"]>, "many">>;
            origin: ZodString;
            transitPreferences: ZodOptional<
                ZodObject<
                    { routingPreference: ZodEnum<["LESS_WALKING", "FEWER_TRANSFERS"]> },
                    "strip",
                    ZodTypeAny,
                    { routingPreference: "LESS_WALKING" | "FEWER_TRANSFERS" },
                    { routingPreference: "LESS_WALKING" | "FEWER_TRANSFERS" },
                >,
            >;
            travel_mode: ZodEnum<
                ["DRIVE", "WALK", "BICYCLE", "TRANSIT", "TWO_WHEELER"],
            >;
        },
        "strip",
        ZodTypeAny,
        {
            arrivalTime?: string;
            computeAlternativeRoutes: boolean;
            departureTime?: string;
            destination: string;
            extraComputations?: "TOLLS"[];
            origin: string;
            transitPreferences?: {
                routingPreference: "LESS_WALKING"
                | "FEWER_TRANSFERS";
            };
            travel_mode: "DRIVE"
            | "WALK"
            | "BICYCLE"
            | "TRANSIT"
            | "TWO_WHEELER";
        },
        {
            arrivalTime?: string;
            computeAlternativeRoutes: boolean;
            departureTime?: string;
            destination: string;
            extraComputations?: "TOLLS"[];
            origin: string;
            transitPreferences?: {
                routingPreference: "LESS_WALKING"
                | "FEWER_TRANSFERS";
            };
            travel_mode: "DRIVE"
            | "WALK"
            | "BICYCLE"
            | "TRANSIT"
            | "TWO_WHEELER";
        },
    > = defaultGoogleRoutesSchema

    Accessors

    • get lc_secrets(): undefined | { [key: string]: string }

      Returns undefined | { [key: string]: string }

    Methods

    • Parameters

      • input: InferInteropZodOutput<
            ZodObject<
                {
                    arrivalTime: ZodOptional<ZodString>;
                    computeAlternativeRoutes: ZodBoolean;
                    departureTime: ZodOptional<ZodString>;
                    destination: ZodString;
                    extraComputations: ZodOptional<ZodArray<ZodEnum<["TOLLS"]>, "many">>;
                    origin: ZodString;
                    transitPreferences: ZodOptional<
                        ZodObject<
                            { routingPreference: ZodEnum<["LESS_WALKING", "FEWER_TRANSFERS"]> },
                            "strip",
                            ZodTypeAny,
                            { routingPreference: "LESS_WALKING" | "FEWER_TRANSFERS" },
                            { routingPreference: "LESS_WALKING" | "FEWER_TRANSFERS" },
                        >,
                    >;
                    travel_mode: ZodEnum<
                        ["DRIVE", "WALK", "BICYCLE", "TRANSIT", "TWO_WHEELER"],
                    >;
                },
                "strip",
                ZodTypeAny,
                {
                    arrivalTime?: string;
                    computeAlternativeRoutes: boolean;
                    departureTime?: string;
                    destination: string;
                    extraComputations?: "TOLLS"[];
                    origin: string;
                    transitPreferences?: {
                        routingPreference: "LESS_WALKING"
                        | "FEWER_TRANSFERS";
                    };
                    travel_mode: "DRIVE"
                    | "WALK"
                    | "BICYCLE"
                    | "TRANSIT"
                    | "TWO_WHEELER";
                },
                {
                    arrivalTime?: string;
                    computeAlternativeRoutes: boolean;
                    departureTime?: string;
                    destination: string;
                    extraComputations?: "TOLLS"[];
                    origin: string;
                    transitPreferences?: {
                        routingPreference: "LESS_WALKING"
                        | "FEWER_TRANSFERS";
                    };
                    travel_mode: "DRIVE"
                    | "WALK"
                    | "BICYCLE"
                    | "TRANSIT"
                    | "TWO_WHEELER";
                },
            >,
        >

      Returns Promise<string>

    • Returns string