Generate Text in Generative AI

Host a text generation large language generation model in OCI Generative AI on a dedicated AI cluster to generate text or extract information from text. We recommend that you use the chat models instead.

Important

  • Not Available on-demand: All OCI Generative AI foundational pretrained models supported for the on-demand serving mode that use the text generation and summarization APIs (including the playground) are now retired. We recommend that you use the chat models instead.
  • Can be hosted on clusters: If you host a summarization or a generation model such as cohere.command on a dedicated AI cluster, (dedicated serving mode), you can continue to use that model until it's retired. These models, when hosted on a dedicated AI cluster are only available in US Midwest (Chicago). See Retiring the Models for retirement dates and definitions.
    1. In the navigation bar of the Console, select the US Midwest (Chicago) region.
    2. Open the navigation menu and click Analytics & AI. Under AI Services, click Generative AI.
    3. Select a compartment that you have permission to work in. If you don't see the playground, ask an administrator to give you access to Generative AI resources and then return to the following steps.
    4. Click Playground.
    5. Click Generation.
    6. Select a model for text generation by performing one of the following actions:
      • Click View model details, select a model, and then click Choose model.
    7. Either enter a prompt or select an example from the Example list to use as a base prompt or to learn from.
    8. (Optional) Set new values for the parameters. For parameter details, see Generation Model Parameters.
      Note

      For the cohere.command hosted models, if you select Show likelihoods, after the model generates a response, you can hover the mouse over the generated words to see the tokens and their likelihood.
    9. Click Generate.
    10. (Optional) To change the output, update the prompts and parameters and click Generate. Repeat this step until you're happy with the output.
      Note

      To maintain the context of prior prompts for follow-up questions, click Copy output and include the output in the next prompt.
    11. To copy the generated output, click Copy output.

      The output is copied to the computer clipboard.

    12. (Optional) To copy the code that generated the output, click View code, select a programming language, click Copy code, paste the code into a file and save the file. Ensure that the file maintains the format of the pasted code.
      Tip

      If you're using the code in an application, ensure that you authenticate your code.
    13. (Optional) To start a new prompt, click Clear under the Input area.
      Note

      When you click Clear the model parameters reset to their default values.
  • To generate text, use the generate-text-result operation.

    Enter the following command for a list of options to generate text.

    oci generative-ai-inference generate-text-result -h

    For a complete list of parameters and values for the OCIGenerative AI CLI commands, see Generative AI Inference CLI and Generative AI Management CLI.

  • Run the GenerateText operation to generate text.

    For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.