# OpenAI integration deprecation

**URL:** <https://support.prodi.gy/t/openai-integration-deprecation/7395>\
**Category:** Uncategorized\
**Created:** [September 24, 2024, 7:06am UTC](https://support.prodi.gy/t/openai-integration-deprecation/7395 "2024-09-24T07:06:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![toadle](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/toadle/32/4456_2.png) [@toadle](https://support.prodi.gy/u/toadle)\
**Post date:** [September 24, 2024, 7:06am UTC](https://support.prodi.gy/t/openai-integration-deprecation/7395/1 "2024-09-24T07:06:08Z")

</div>

Hey guys,

this morning I tried to switch my workflow from `textcat.manual` to `textcat.openai.correct` to save some time. But even after setting all the correct ENV-variables I ended up in this neverending loop:

 ![CleanShot 2024-09-24 at 09.02.47@2x](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/0/01b36411af3b032240815d1ef3e9c80f8afaa7e9.png)

Do I see that correctly that choosing `text-davinci-003` is not possible anymore, because it is not available on the first, but then required on the second API that seems to be called?

---

<div class="post-metadata">

**Author:** ![honnibal](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/honnibal/32/35_2.png) [@honnibal](https://support.prodi.gy/u/honnibal)\
**Post date:** [September 24, 2024, 7:16am UTC](https://support.prodi.gy/t/openai-integration-deprecation/7395/2 "2024-09-24T07:16:58Z")

</div>

Is it possible for you to use the `textcat.llm.correct` recipe? As noted in the error the `.openai.*` recipes are deprecated by the more general `.llm.*` recipes

---

<div class="post-metadata">

**Author:** ![toadle](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/toadle/32/4456_2.png) [@toadle](https://support.prodi.gy/u/toadle)\
**Post date:** [September 24, 2024, 4:06pm UTC](https://support.prodi.gy/t/openai-integration-deprecation/7395/3 "2024-09-24T16:06:40Z")

</div>

MMh, actually I was just to lazy because I hoped it would be more easy to configure using the other pipelines.

Now I tried it with this config

```python
[nlp]

lang = "de"

pipeline = ["llm"]

[components]

[components.llm]

factory = "llm"

save_io = true

[components.llm.task]

@llm_tasks = "spacy.TextCat.v3"

labels = ["Sach- & Haftpflichtversicherungen","Werbungskosten","Privat"]

exclusive_classes = false

[components.llm.task.label_definitions]

"Sach- & Haftpflichtversicherungen" = "xxx"

"Werbungskosten" = "xxx"

"Privat" = "xxx"

[components.llm.model]

@llm_models = "spacy.GPT-4.v3"

config = {"temperature": 0.3}

[components.llm.cache]

@llm_misc = "spacy.BatchCache.v1"

path = "local-cached"

batch_size = 3

max_batches_in_mem = 10

```

Calling it like this: `prodigy textcat.llm.correct bank_turnovers_categorization configs/spacy_textcat_llm_config.cfg assets/bank_turnovers_versicherung.jsonl`

But this results in Prodigy seemingly forever looking like this. I see that it talks to OpenAI, but never comes back.

 ![CleanShot 2024-09-24 at 18.02.02@2x](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/4/481e3b533f9cfafed4b34bc9e213b1a60683ac6d.png)

---

<div class="post-metadata">

**Author:** ![toadle](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/toadle/32/4456_2.png) [@toadle](https://support.prodi.gy/u/toadle)\
**Post date:** [September 24, 2024, 4:10pm UTC](https://support.prodi.gy/t/openai-integration-deprecation/7395/4 "2024-09-24T16:10:55Z")

</div>

OK, on further testing this was just the default model `gpt-4` taking too much time.

Using this config

```python
[nlp]
lang = "de"
pipeline = ["llm"]

[components]

[components.llm]
factory = "llm"
save_io = true

[components.llm.task]
@llm_tasks = "spacy.TextCat.v3"
labels = ["Sach- & Haftpflichtversicherungen","Werbungskosten","Privat"]
exclusive_classes = false

[components.llm.task.label_definitions]
"Sach- & Haftpflichtversicherungen" = "xxx"
"Werbungskosten" = "xxx"
"Privat" = "xxx"

[components.llm.model]
@llm_models = "spacy.GPT-4.v3"
name = "gpt-4o"
config = {"temperature": 0.3}

[components.llm.cache]
@llm_misc = "spacy.BatchCache.v1"
path = "local-cached"
batch_size = 3
max_batches_in_mem = 10

```

I started working.

---

<div class="post-metadata">

**Author:** ![magdaaniol](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/magdaaniol/32/2787_2.png) [@magdaaniol](https://support.prodi.gy/u/magdaaniol)\
**Post date:** [September 25, 2024, 7:26am UTC](https://support.prodi.gy/t/openai-integration-deprecation/7395/5 "2024-09-25T07:26:43Z")

</div>

Hi @toadle,

Glad to hear you managed to implement your workflow with `spacy-llm` recipe. I'll go ahead to change the subject to reflect the content of the thread more accurately, now that we know the issue.
