[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] schema validation error in streaming mode cause reflection API to crash #271

Open
pavelgj opened this issue May 29, 2024 · 1 comment
Labels
bug Something isn't working devui js

Comments

@pavelgj
Copy link
Collaborator
pavelgj commented May 29, 2024

Describe the bug
When running the flow (see below) from the Dev UI in streaming mode the genkit start process "crashes".
Full error: https://gist.github.com/pavelgj/0ef67bc35d2c4436c7c128462a64b0b9

To Reproduce

const jokeSubjectGenerator = defineTool(
  {
    name: 'jokeSubjectGenerator',
    description: 'can be called to generate a subject for a joke',
  },
  async () => {
    return 'banana';
  }
);

export const toolCaller = defineFlow(
  {
    name: 'toolCaller',
    outputSchema: z.string(),
  },
  async (_, streamingCallback) => {
    if (!streamingCallback) {
      throw new Error('this flow only works in streaming mode');
    }

    const { response, stream } = await generateStream({
      model: gemini15ProPreview,
      config: {
        temperature: 1,
      },
      tools: [jokeSubjectGenerator],
      prompt: `tell me a joke`,
    });

    for await (const chunk of stream()) {
      streamingCallback(chunk);
    }

    return (await response()).text();
  }
);

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

@pavelgj pavelgj added bug Something isn't working js labels May 29, 2024
@i14h i14h added this to the 0.5.5 milestone Jul 3, 2024
@chrisraygill
Copy link
Contributor

If this was fixed in Go, do we already know the solution for JS? @pavelgj

@chrisraygill chrisraygill removed this from the 0.5.5 milestone Jul 18, 2024
@pavelgj pavelgj added the devui label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devui js
Projects
None yet
Development

No branches or pull requests

3 participants