Skip to content

[ai-sdk] ai-sdk streamText and gateway() #1081

@ibolmo

Description

@ibolmo

This appears to have introduced a regression.

with:

const { streamText } = wrapAISDK(ai) as typeof ai;

const runTestAi = wrapTraced(
  async () => {
    console.log("getPromptVersions");
    const promptVersions = await getPromptVersions(
      "c08893e4-d1dd-4947-addf-943992c786c9",
      "80942bae-fc33-4e64-8605-b7c88c5be8b4"
    );

    console.log(promptVersions);

    const prompt = await loadPrompt({
      projectName: "switchboard",
      slug: "ai-task"
    });

    const compiledPrompt = prompt.build(
      {
        criticlevel: "expert",
        movie: "Dune: Part Two film (2024)"
      },
      {
        flavor: "chat"
      }
    );

    const result = streamText({
      // biome-ignore lint/suspicious/noExplicitAny: eeek
      ...(compiledPrompt as any),
      model: gateway("openai/gpt-5-nano")
    });

    return await result.content;
  },
  {
    name: "trigger.test-ai"
  }
);

when executed with 0.4.6, the prompt correctly gets linked however when executed with 0.4.9, the prompt does not get linked

Originally posted by @financialvice in #1021 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions