Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

v0.122.0

Choose a tag to compare

@lgrammel lgrammel released this 13 Jan 09:24

Changed

  • breaking change: Switch from positional parameters to named parameters (parameter object) for all model and tool functions. The parameter object is the first and only parameter of the function. Additional options (last parameter before) are now part of the parameter object. Example:

    // old:
    const text = await generateText(
      openai
        .ChatTextGenerator({
          model: "gpt-3.5-turbo",
          maxGenerationTokens: 1000,
        })
        .withTextPrompt(),
    
      "Write a short story about a robot learning to love",
    
      {
        functionId: "example-function",
      }
    );
    
    // new:
    const text = await generateText({
      model: openai
        .ChatTextGenerator({
          model: "gpt-3.5-turbo",
          maxGenerationTokens: 1000,
        })
        .withTextPrompt(),
    
      prompt: "Write a short story about a robot learning to love",
    
      functionId: "example-function",
    });

    This change was made to make the API more flexible and to allow for future extensions.