# US 12,182,506 B2 · Systems and methods for dynamic large language model prompt generation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,182,506 B2
- Document ID: US12182506B2
- Status: Granted
- Kind: B2
- Application number: 18/322,377
- Filed: 2023-05-23
- Published: 2024-10-03
- Granted: 2024-12-31
- Earliest claimed: 2023-04-03
- Assignees: Shopify Inc.
- Applicants: Shopify Inc.
- Inventors: Utkarsh Saxena
- Web page: https://patentgrep.com/patent/US12182506B2

## CPC

- G06F 40/186: Templates
- G06F 8/35: model driven
- G06F 16/958: Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F 40/106: Display of layout of documents; Previewing
- G06F 40/20: Natural language analysis (semantic analysis of natural language G06F40/30)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A website development system automatically generates text for a webpage. The system obtains a prompt template associated with a section of the webpage, where the prompt template includes one or more parameters. Based on the webpage, the prompt template determines a first value for a first one of the one or more parameters. A request to provide input for a second value of a second parameter is sent for display to a user. Using the prompt template, the first value, and the second value, the system generates a prompt to a large language model to generate text for the section of the webpage.

## Claims

### Claim 1

A computer-implemented method comprising:
obtaining a prompt template associated with a section of a webpage, the prompt template including one or more parameters;
determining, based on the webpage, a first value for a first one of the one or more parameters;
sending for display to a user, a request to provide input for a second value corresponding to a second one of the one or more parameters; and
generating, using the prompt template and the first value and the second value, a prompt to a large language model to generate text for the section of the webpage.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein sending the request for display to the user comprises:
selecting, based on the webpage, multiple candidate values for the second value;
sending the candidate values for display to the user; and
in response to receiving a selection from among the candidate values, identifying the selected candidate value as the second value.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein sending the request for display to the user comprises:
predicting the second value based on the webpage;
determining a confidence score for the prediction of the second value is less than a threshold; and
sending the request to provide input for the second value to the user in response to determining the confidence score is less than the threshold.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, further comprising:
sending the generated text for display to a user; and
in response to receiving a request from the user to regenerate the text:
sending information indicative of the first value for display to the user; and
in response to receiving, from the user, a third value to replace the determined first value, modifying the prompt to the large language model based on the third value and the prompt template.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, further comprising:
receiving an input to add the section to the webpage, wherein the prompt to the large language model is generated in response to receiving the input;
generating the section on the webpage; and
adding the generated text to the generated section of the webpage.

### Claim 6 (depends on 5)

The computer-implemented method of claim 5, further comprising:
recommending a section type for the section to be added to the webpage, wherein the recommended section type is one of multiple section types available for adding to the webpage and wherein each of the multiple types of sections is associated with a different prompt template;
wherein obtaining the prompt template associated with the section of the webpage comprises obtaining the prompt template associated with the recommended section type of the section.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein recommending the section type for the section to be added to the webpage comprises:
using a trained machine learning model to generate the recommended section type based on current contents of the webpage, wherein the trained machine learning model is trained based on layouts of other webpages to predict a likely next section type for the webpage based on the current contents of the webpage.

### Claim 8 (depends on 6)

The computer-implemented method of claim 6, wherein receiving the input to add the section to the webpage comprises receiving a specified location for the section on the webpage, and wherein recommending the section type of the section to be added to the webpage comprises:
selecting the recommended section type based on the specified location for the section.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, further comprising:
receiving an input to move the section from the specified location to a second location on the webpage; and
modifying the section type of the section based on the second location;
wherein obtaining the prompt template associated with the section of the webpage comprises retrieving the prompt template that is associated with the modified section type of the section.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein the first one of the one or more parameters specifies a tone for the text, and wherein determining the first value based on the webpage comprises:
sending text retrieved from other sections of the webpage to the large language model for analysis of a tone of the other sections; and
selecting a tone as the first value based on the analysis of the tone of the other sections performed by the large language model.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, wherein the first one of the one or more parameters specifies a tone for the text, and wherein determining the first value based on the webpage comprises:
identifying a product category of a product to be described in the section; and
selecting a tone as the first value based on the product category.

### Claim 12 (depends on 1)

The computer-implemented method of claim 1, wherein determining the first value comprises retrieving the first value from another section on the webpage.

### Claim 13

A non-transitory computer readable storage medium storing executable instructions, execution of which by a processor causing the processor to:
obtain a prompt template associated with a section of a webpage, the prompt template including one or more parameters;
determine, based on the webpage, a first value for a first one of the one or more parameters;
send for display to a user, a request to provide input for a second value corresponding to a second one of the one or more parameters; and
generate, using the prompt template and the first value and the second value, a prompt to a large language model to generate text for the section of the webpage.

### Claim 14 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein sending the request for display to the user comprises:
selecting, based on the webpage, multiple candidate values for the second value;
sending the candidate values for display to the user; and
in response to receiving a selection from among the candidate values, identifying the selected candidate value as the second value.

### Claim 15 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein sending the request for display to the user comprises:
predicting the second value based on the webpage;
determining a confidence score for the prediction of the second value is less than a threshold; and
sending the request to provide input for the second value to the user in response to determining the confidence score is less than the threshold.

### Claim 16 (depends on 13)

The non-transitory computer readable storage medium of claim 13, further comprising:
receiving an input to add the section to the webpage, wherein the prompt to the large language model is generated in response to receiving the input;
generating the section on the webpage; and
adding the generated text to the generated section of the webpage.

### Claim 17 (depends on 16)

The non-transitory computer readable storage medium of claim 16, further comprising:
recommending a section type for the section to be added to the webpage, wherein the recommended section type is one of multiple section types available for adding to the webpage and wherein each of the multiple types of sections is associated with a different prompt template;
wherein obtaining the prompt template associated with the section of the webpage comprises obtaining the prompt template associated with the recommended section type of the section.

### Claim 18 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the first one of the one or more parameters specifies a tone for the text, and wherein determining the first value based on the webpage comprises:
sending text retrieved from other sections of the webpage to the large language model for analysis of a tone of the other sections; and
selecting a tone as the first value based on the analysis of the tone of the other sections performed by the large language model.

### Claim 19 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein determining the first value comprises retrieving the first value from another section on the webpage.

### Claim 20

A system comprising:
at least one hardware processor; and
at least one non-transitory memory storing instructions, which, when executed by the at least one hardware processor, cause the system to:
obtain a prompt template associated with a section of a webpage, the prompt template including one or more parameters;
determine, based on the webpage, a first value for a first one of the one or more parameters;
send for display to a user, a request to provide input for a second value corresponding to a second one of the one or more parameters; and
generate, using the prompt template and the first value and the second value, a prompt to a large language model to generate text for the section of the webpage.
