UNPKG

@genkit-ai/flow

Version:

Genkit AI framework workflow APIs.

48 lines (44 loc) 1.64 kB
import z__default from 'zod'; import { Context } from './context.js'; import '@genkit-ai/core'; import './flow-DR52DKjZ.js'; import 'body-parser'; import 'cors'; import 'express'; /** * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Adds flows specific prefix for OpenTelemetry span attributes. */ declare function metadataPrefix(name: string): string; /** * Returns current active context. */ declare function getActiveContext(): Context<z__default.ZodTypeAny, z__default.ZodTypeAny, z__default.ZodTypeAny> | undefined; /** * Execute the provided function in the flow context. Call {@link getActiveContext()} anywhere * within the async call stack to retrieve the context. */ declare function runWithActiveContext<R>(ctx: Context<z__default.ZodTypeAny, z__default.ZodTypeAny, z__default.ZodTypeAny>, fn: () => R): R; /** * Generates a flow ID. */ declare function generateFlowId(): string; /** * Gets the auth object from the current context. */ declare function getFlowAuth(): any; export { generateFlowId, getActiveContext, getFlowAuth, metadataPrefix, runWithActiveContext };