Generating text with code

Build foundation model prompts programmatically by using various development methods and coding languages.

Experiment with different ways to prompt foundation models programmatically, including:

  • Text generation: Focus on the basic interaction, where you submit input to a foundation model and get output. You manage the larger workflow of the solution. See Text generation.

    Starting in 2.3.1, the text generation API is deprecated and will be removed in the future.

  • Chat: Build a conversational workflow that adds options for different input types, including model instructions, multimedia inputs, and tool definitions. See Chat.