This page guides you through the process of getting prompt templates in your application. Check out Application Prompt Templates page to manage prompts.

Don’t forget to initialize LangBear client before using it.

Getting a prompt template

The Prompts#get method returns a prompt template related to the specified key. The returned object is a LangBearPromptTemplate that contains multiple prompt templates.

prompt = lb.prompts.get("company-name-generation")


Pass lang as a parameter to the Prompts#get function to get prompt template for a language.

prompt = lb.prompts.get("company-name-generation", lang="fr")

Default language will be used if lang is not specified.

Formatting input variables

Replace {variable} with the value of the variable.

prompt.format(product="colorful socks")