# Issue with how AI ‘completed prompt’ is displaying

**URL:** https://community.glideapps.com/t/issue-with-how-ai-completed-prompt-is-displaying/66515
**Category:** Ask for Help
**Tags:** ai, openai
**Created:** [September 25, 2023, 7:28pm UTC](https://community.glideapps.com/t/issue-with-how-ai-completed-prompt-is-displaying/66515 "2023-09-25T19:28:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![iam\_laurad](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/iam_laurad/32/64180_2.png) [@iam\_laurad](https://community.glideapps.com/u/iam_laurad)
#### Post date: [September 25, 2023, 7:28pm UTC](https://community.glideapps.com/t/issue-with-how-ai-completed-prompt-is-displaying/66515/1 "2023-09-25T19:28:47Z")

</div>

Hi everyone, first time posting here… hoping someone can help.

Im using the OpenAI integration with the ‘complete a prompt’ function twice, to generate two pieces of text.

The first piece of text is a summary. I then reference this summary in the prompt for the section piece of text (an article).

For some reason (maybe to do with token limits?) the end of the summary (first piece of text) sometimes doesn’t show up on that cell, but appears at the beginning of the article (second piece of text).

Any ideas how to stop this from happening?

Thanks!

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [September 26, 2023, 12:19am UTC](https://community.glideapps.com/t/issue-with-how-ai-completed-prompt-is-displaying/66515/2 "2023-09-26T00:19:14Z")

</div>

Can you show us how you’re constructing the prompts and the OpenAI columns/actions?

What input do you have for the “summary” part? Why do you generate a summary before the article? How are they linked to each other?

---

<div class="post-metadata">

### Author: ![iam\_laurad](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/iam_laurad/32/64180_2.png) [@iam\_laurad](https://community.glideapps.com/u/iam_laurad)
#### Post date: [September 27, 2023, 11:37am UTC](https://community.glideapps.com/t/issue-with-how-ai-completed-prompt-is-displaying/66515/3 "2023-09-27T11:37:43Z")

</div>

Of course.

So I have the summary first, to create a style guide per brand. This is then used in the prompt for a ‘create article’ function.

Prompt to create style guide:

 ![Screenshot 2023-09-27 at 12.29.34](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/9/b9497ce8500bdac9b7c9ffaf29bfe79fbf0c4f2d.png)

Table structure - includes the prompt column (template) and completed prompt column (triggered on ‘submit’)

 ![Screenshot 2023-09-27 at 12.30.06](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/c/4c99f60470a8c1f374309dbe18723af5ec69b1a6.png)

This is what a completed prompt cell looks like - cuts off the end of the sentence:

 ![Screenshot 2023-09-27 at 12.30.22](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/691b1f1b634170990fc9aa52a359ec529a653bd8.png)

Then I have a separate table to generate each article, which pulls through the style guide from my ‘client’ table as a Relation and Lookup (two columns). Then there’s a prompt (template) for generating the article, and completed prompt column.

 ![Screenshot 2023-09-27 at 12.30.35](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/b/9b118a616f9c27256a270cb0b58ab9feff269c29.png)

In my ‘article’ table, the completed prompt column (where the article appears) starts with the end of the missing sentence:

 ![Screenshot 2023-09-27 at 12.30.44](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/5/656c30c0660f42622b9728e1cab1c7165c4eb078.png)

I’m guessing there’s something about token limits but no idea why it’s showing it like this!
