typesafe-haystack 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (16) hide show
  1. typesafe_haystack-0.1.1/CHANGELOG.md +9 -0
  2. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/PKG-INFO +4 -4
  3. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/pyproject.toml +3 -3
  4. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/src/haystack_integrations/components/classifiers/typesafe/document_classifier.py +7 -2
  5. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/tests/test_document_classifier.py +2 -1
  6. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/.gitignore +0 -0
  7. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/LICENSE.txt +0 -0
  8. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/README.md +0 -0
  9. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/pydoc/config_docusaurus.yml +0 -0
  10. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/src/haystack_integrations/components/classifiers/py.typed +0 -0
  11. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/src/haystack_integrations/components/classifiers/typesafe/__init__.py +0 -0
  12. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/src/haystack_integrations/components/routers/py.typed +0 -0
  13. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/src/haystack_integrations/components/routers/typesafe/__init__.py +0 -0
  14. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/src/haystack_integrations/components/routers/typesafe/text_router.py +0 -0
  15. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/tests/__init__.py +0 -0
  16. {typesafe_haystack-0.1.0 → typesafe_haystack-0.1.1}/tests/test_text_router.py +0 -0
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## [integrations/typesafe-v0.1.0] - 2026-10-05
4
+
5
+ ### 🚀 Features
6
+
7
+ - Add TypeSafe integration (#4025)
8
+
9
+ <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: typesafe-haystack
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Haystack integration for TypeSafe System One decision models
5
5
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/typesafe#readme
6
6
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
@@ -12,16 +12,16 @@ Keywords: Haystack,Jev,Ollaya,TypeSafe,classification,decision model,routing
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: License :: OSI Approved :: Apache Software License
14
14
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Classifier: Programming Language :: Python :: 3.13
19
18
  Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
20
  Classifier: Programming Language :: Python :: Implementation :: CPython
21
21
  Classifier: Programming Language :: Python :: Implementation :: PyPy
22
- Requires-Python: >=3.10
22
+ Requires-Python: >=3.11
23
23
  Requires-Dist: haystack-ai>=3.0.0
24
- Requires-Dist: typesafe-sdk>=0.7.1
24
+ Requires-Dist: typesafe-sdk>=0.7.5
25
25
  Description-Content-Type: text/markdown
26
26
 
27
27
  # typesafe-haystack
@@ -7,7 +7,7 @@ name = "typesafe-haystack"
7
7
  dynamic = ["version"]
8
8
  description = "Haystack integration for TypeSafe System One decision models"
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.11"
11
11
  license = "Apache-2.0"
12
12
  keywords = ["Haystack", "TypeSafe", "Jev", "Ollaya", "classification", "decision model", "routing"]
13
13
  authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }]
@@ -15,15 +15,15 @@ classifiers = [
15
15
  "License :: OSI Approved :: Apache Software License",
16
16
  "Development Status :: 4 - Beta",
17
17
  "Programming Language :: Python",
18
- "Programming Language :: Python :: 3.10",
19
18
  "Programming Language :: Python :: 3.11",
20
19
  "Programming Language :: Python :: 3.12",
21
20
  "Programming Language :: Python :: 3.13",
22
21
  "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
23
  "Programming Language :: Python :: Implementation :: CPython",
24
24
  "Programming Language :: Python :: Implementation :: PyPy",
25
25
  ]
26
- dependencies = ["haystack-ai>=3.0.0", "typesafe-sdk>=0.7.1"]
26
+ dependencies = ["haystack-ai>=3.0.0", "typesafe-sdk>=0.7.5"]
27
27
 
28
28
  [project.urls]
29
29
  Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/typesafe#readme"
@@ -11,6 +11,7 @@ from haystack import Document, component, default_to_dict, logging
11
11
  from haystack.utils import Secret
12
12
  from typesafe_sdk import (
13
13
  AsyncTypeSafeClient,
14
+ Box,
14
15
  Choice,
15
16
  Noul,
16
17
  Question,
@@ -127,13 +128,17 @@ class TypeSafeDocumentClassifier:
127
128
  If `True`, the first failed request raises its error. If `False`, documents whose request failed are
128
129
  returned in `failed_documents`.
129
130
  :raises ValueError:
130
- If `questions` is empty, a question has an unknown `type`, a `choice` or `score` question has no
131
- `criteria`, or `max_workers` is smaller than 1.
131
+ If `questions` is empty, a question has an unknown `type` or is a `Box` question, a `choice` or `score`
132
+ question has no `criteria`, or `max_workers` is smaller than 1.
132
133
  """
133
134
  if not questions:
134
135
  msg = "`questions` must contain at least one question."
135
136
  raise ValueError(msg)
136
137
  for question_id, question in questions.items():
138
+ # Box questions locate objects in an image, so they can't be answered about document text
139
+ if isinstance(question, Box):
140
+ msg = f"Question '{question_id}' is a `Box` question; use one of {_QUESTION_TYPES}."
141
+ raise ValueError(msg)
137
142
  # SDK question objects are validated by the SDK when they are created
138
143
  if isinstance(question, (Choice, Score, Noul)):
139
144
  continue
@@ -11,7 +11,7 @@ import pytest
11
11
  from haystack import Document, Pipeline
12
12
  from haystack.core.serialization import component_from_dict
13
13
  from haystack.utils import Secret
14
- from typesafe_sdk import Choice, Noul, SystemOneResponse, TypeSafeAPIConnectionError
14
+ from typesafe_sdk import Box, Choice, Noul, SystemOneResponse, TypeSafeAPIConnectionError
15
15
 
16
16
  from haystack_integrations.components.classifiers.typesafe import TypeSafeDocumentClassifier
17
17
 
@@ -82,6 +82,7 @@ class TestInit:
82
82
  [
83
83
  ({"questions": {}}, "at least one question"),
84
84
  ({"questions": {"q": {"type": "yesno", "instructions": "?"}}}, "has type 'yesno'"),
85
+ ({"questions": {"q": Box(instructions="The dog")}}, "is a `Box` question"),
85
86
  ({"questions": {"q": {"type": "choice", "instructions": "?"}}}, "needs `criteria`"),
86
87
  ({"questions": {"q": {"type": "score", "instructions": "?", "criteria": []}}}, "needs `criteria`"),
87
88
  ({"questions": QUESTIONS, "max_workers": 0}, "at least 1"),