Repository: explosion/spacy-llm (language: python)

Issue:
Bump version
<!--- Provide a general summary of your changes in the title. -->

## Description
<!--- Use this section to describe your changes. If your changes required
testing, include information about the testing environment and the tests you
ran. If your test fixes a bug reported in an issue, don't forget to include the
issue number. If your PR is still a work in progress, that's totally fine – just
include a note to let us know. -->
Bump version.

### Types of change
<!-- What type of change does your PR cover? Is it a bug fix, an enhancement
or new feature, or a change to the documentation? -->

## Checklist
<!--- Before you submit the PR, go over this checklist and make sure you can
tick off all the boxes. [] -> [x] -->
- [x] I confirm that I have the right to submit this contribution under the project's MIT license.
- [x] I ran all tests in `tests` and `usage_examples/tests`, and all new and existing tests passed. This includes
  - all external tests (i. e. `pytest` ran with `--external`)
  - all tests requiring a GPU
- [x] My changes don't require a change to the documentation, or if they do, I've added all required information.



Discussion / hints:

Fix patch:
diff --git a/setup.cfg b/setup.cfg
index 636c91ef..8253e319 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [metadata]
-version = 0.3.0
+version = 0.3.1
 description = Integrating LLMs into structured NLP pipelines
 author = Explosion
 author_email = contact@explosion.ai


Test patch:
diff --git a/spacy_llm/tests/pipeline/test_llm.py b/spacy_llm/tests/pipeline/test_llm.py
index 6a554e09..d24c21f6 100644
--- a/spacy_llm/tests/pipeline/test_llm.py
+++ b/spacy_llm/tests/pipeline/test_llm.py
@@ -6,6 +6,7 @@
 
 import pytest
 import spacy
+from confection import Config
 from spacy.language import Language
 from spacy.tokens import Doc
 from thinc.api import NumpyOps, get_current_ops
@@ -18,6 +19,7 @@
 from spacy_llm.tasks.noop import _NOOP_PROMPT
 
 from ...cache import BatchCache
+from ...util import assemble_from_config
 from ..compat import has_openai_key
 
 
@@ -230,3 +232,37 @@ def test_llm_logs_default_null_handler(nlp: Language, capsys: pytest.CaptureFixt
     assert f"Generated prompt for doc: {doc.text}" not in captured.out
     assert "Don't do anything" not in captured.out
     assert f"LLM response for doc: {doc.text}" not in captured.out
+
+
+@pytest.mark.external
+@pytest.mark.skipif(has_openai_key is False, reason="OpenAI API key not available")
+def test_pipe_labels():
+    """Test pipe labels with serde."""
+
+    cfg_string = """
+    [nlp]
+    lang = "en"
+    pipeline = ["llm"]
+
+    [components]
+
+    [components.llm]
+    factory = "llm"
+
+    [components.llm.task]
+    @llm_tasks = "spacy.TextCat.v2"
+    labels = ["COMPLIMENT", "INSULT"]
+
+    [components.llm.backend]
+    @llm_backends = "spacy.REST.v1"
+    api = "OpenAI"
+    config = {"model": "gpt-3.5-turbo", "temperature": 0.3}
+    """
+
+    config = Config().from_str(cfg_string)
+    nlp = assemble_from_config(config)
+
+    with spacy.util.make_tempdir() as tmpdir:
+        nlp.to_disk(tmpdir / "tst.nlp")
+        nlp = spacy.load(tmpdir / "tst.nlp")
+        assert nlp.pipe_labels["llm"] == ["COMPLIMENT", "INSULT"]