# GhostAI - Ghost & OpenAI Integration

**URL:** <https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578>\
**Category:** Integrations & API\
**Created:** [April 4, 2023, 5:37pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578 "2023-04-04T17:37:21Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [April 28, 2023, 8:16am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/21 "2023-04-28T08:16:51Z")

</div>

Thanks @lovecactus,  
The new script keeps failing… I attach logs.

 ![Captura de pantalla 2023-04-28 a las 10.15.52](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/c/f/cff6abaa110aefb1669658c858be2641451a2533.png)

 ![CleanShot 2023-04-28 at 10.16.07@2x](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/6/c/6c10d889fff79871a202b907b3788e496215cd2a.png)

---

<div class="post-metadata">

**Author:** ![lovecactus](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lovecactus/32/23908_2.png) [@lovecactus](https://forum.ghost.org/u/lovecactus)\
**Post date:** [April 29, 2023, 4:10am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/22 "2023-04-29T04:10:27Z")

</div>

We appreciate your continued cooperation in providing logs. Once again, we have addressed the issue and updated the code. Please pull the latest version and test it out.  
Should you encounter any additional issues, feel free to reach out to us.

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [April 29, 2023, 9:04am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/23 "2023-04-29T09:04:29Z")

</div>

Thanks for all @lovecactus  
**The script is working properly again!!!** Is it due to a change in Ghost?

In the “ghost\_relation\_tags.py” script I have only seen this error. It generates everything correctly except those 3. I don’t know if it is normal or how I can fix it. But I just published a new article, I have run the 2 scripts and it works!

 ![Captura de pantalla 2023-04-29 a las 11.02.12](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/0/1/018e572bfdef9cd03a4fc8195dd06b38aab660f4.png)

---

<div class="post-metadata">

**Author:** ![lovecactus](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lovecactus/32/23908_2.png) [@lovecactus](https://forum.ghost.org/u/lovecactus)\
**Post date:** [April 30, 2023, 1:06am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/24 "2023-04-30T01:06:03Z")

</div>

We have updated the script to address this warning.  
Please update your code and give it another attempt.

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [May 1, 2023, 8:29am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/25 "2023-05-01T08:29:23Z")

</div>

Is it correct now? Why does it only happen with those 3 records? Or what is the reason?  
Thanks!

 ![Captura de pantalla 2023-05-01 a las 10.27.53](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/f/d/fd93a968d7aa14cd343ea4278c94a6b46663282b.png)

---

<div class="post-metadata">

**Author:** ![lovecactus](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lovecactus/32/23908_2.png) [@lovecactus](https://forum.ghost.org/u/lovecactus)\
**Post date:** [May 2, 2023, 6:43am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/26 "2023-05-02T06:43:59Z")

</div>

This is the appropriate clean-up process. The three records in question were likely remnants of unused cache, and they should not reappear in the future.

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [July 8, 2023, 8:30am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/27 "2023-07-08T08:30:07Z")

</div>

Hi @lovecactus,  
Another bug now when execute the first script “ghost\_embeddings.py”

 ![Captura de pantalla 2023-07-08 a las 10.28.46](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/d/5/d5ed988c90a3202aaa374fb3fb9d80caad4826af.png)

I tried to execute on another computer that i have at home and another error:

 ![Captura de pantalla 2023-07-08 a las 10.38.58](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/8/1/81c3667286af50328660ff5d08fdcc8d49b08058.png)

---

<div class="post-metadata">

**Author:** ![lovecactus](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lovecactus/32/23908_2.png) [@lovecactus](https://forum.ghost.org/u/lovecactus)\
**Post date:** [July 13, 2023, 2:28pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/28 "2023-07-13T14:28:05Z")

</div>

Could you please provide me with the log file located at: ./log/embedding.log? This will assist us in identifying your problem. Thank you!

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [July 13, 2023, 2:50pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/29 "2023-07-13T14:50:46Z")

</div>

Thanks @lovecactus I have sent you a PM on Ghost with the log screenshots.

---

<div class="post-metadata">

**Author:** ![lovecactus](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lovecactus/32/23908_2.png) [@lovecactus](https://forum.ghost.org/u/lovecactus)\
**Post date:** [July 14, 2023, 7:28am UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/30 "2023-07-14T07:28:09Z")

</div>

Replied in PM. Please check it when you have a moment. Thank you!

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [July 14, 2023, 2:21pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/31 "2023-07-14T14:21:39Z")

</div>

Replied @lovecactus  
Thanks!!

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [November 12, 2023, 7:07pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/32 "2023-11-12T19:07:32Z")

</div>

Not working again…@lovecactus

 ![CleanShot 2023-11-12 at 20.05.54@2x](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/2/4/24ee2bcc2e1456db5892427a37732b00e260c073.png)

 ![CleanShot 2023-11-12 at 20.06.51@2x](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/8/4/84f20db61ff24833e2d4ad556df86a8d0d2b72f4.png)  
@

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [November 30, 2023, 8:05pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/33 "2023-11-30T20:05:13Z")

</div>

Any updates @peterwo @lovecactus ?  
Thanks!!

---

<div class="post-metadata">

**Author:** ![Samrh](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/samrh/32/29797_2.png) [@Samrh](https://forum.ghost.org/u/Samrh)\
**Post date:** [April 7, 2024, 5:58pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/34 "2024-04-07T17:58:08Z")

</div>

I fixed it to work with latest openAI version. Also raised a pull request for main branch  
[GitHub - Rhsameera/ghostai: Harnessing AI technology with Ghost Blogging Platform](https://github.com/Rhsameera/ghostai) that my branch with the fixes

---

<div class="post-metadata">

**Author:** ![satonotdead](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/satonotdead/32/33666_2.png) [@satonotdead](https://forum.ghost.org/u/satonotdead)\
**Post date:** [June 24, 2025, 11:26pm UTC](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578/35 "2025-06-24T23:26:56Z")

</div>

I tested it and it works on localhost, I’m excited to ship it on production!

I modified the prompt to get prompts in a different language and added functionality for using it with external OpenAI Compatible endpoints.

> ### Note for implementation
> 
> `systemd` _**([not secure](https://nosystemd.org/) but it’s used by Ghost)**_ and `cron` are needed in order to get the scripts updating the posts.

If someone is interested I can share the code, I’m currently testing it for a few days on my _beta_ websites.

[Previous page](https://forum.ghost.org/t/ghostai-ghost-openai-integration/37578.md?page=1)
