Skip to content

Typing a StepsFunction directly seems to require a streamingCallback argument, despite type parameters? #20

@cabljac

Description

@cabljac

Hi, I was moving some code about and playing around with the types in the js packages, and trying to call a typed stepsFunction i get an error:

import z from "zod";

import { StepsFunction } from "@genkit-ai/flow";

const testInputSchema = z.string();
const testOutputSchema = z.string();

type TestStepsFunctionInput = StepsFunction<
  typeof testInputSchema,
  typeof testOutputSchema
>;

const testStepsFunction: TestStepsFunctionInput = async (input) => {
  return input;
};

testStepsFunction("test");

For example:
327717432-456a392e-0b04-462a-9007-407423abb90f

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions