deepl-haystack 0.2.1__tar.gz → 0.2.2__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.
- {deepl_haystack-0.2.1 → deepl_haystack-0.2.2}/PKG-INFO +5 -11
- {deepl_haystack-0.2.1 → deepl_haystack-0.2.2}/README.md +4 -10
- {deepl_haystack-0.2.1 → deepl_haystack-0.2.2}/pyproject.toml +1 -3
- {deepl_haystack-0.2.1 → deepl_haystack-0.2.2}/LICENSE +0 -0
- {deepl_haystack-0.2.1 → deepl_haystack-0.2.2}/deepl_haystack/__init__.py +0 -0
- {deepl_haystack-0.2.1 → deepl_haystack-0.2.2}/deepl_haystack/components.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: deepl-haystack
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Haystack integration with DeepL translation services provider.
|
|
5
5
|
Home-page: https://github.com/dribia/deepl-haystack
|
|
6
6
|
License: Apache-2.0
|
|
@@ -96,15 +96,9 @@ print("\n".join([f"{doc.content}, {doc.meta}" for doc in translated_documents]))
|
|
|
96
96
|
|
|
97
97
|
### Haystack Pipeline Integration
|
|
98
98
|
|
|
99
|
-
> [!TIP]
|
|
100
|
-
> To run this example, you'll need to have the `MarkdownToDocument` requirements installed:
|
|
101
|
-
> ```shell
|
|
102
|
-
> pip install markdown-it-py, mdit-plain
|
|
103
|
-
> ```
|
|
104
|
-
|
|
105
99
|
```python
|
|
106
100
|
from haystack import Pipeline
|
|
107
|
-
from haystack.components.converters import
|
|
101
|
+
from haystack.components.converters import TextFileToDocument
|
|
108
102
|
from haystack.components.writers import DocumentWriter
|
|
109
103
|
from haystack.dataclasses.byte_stream import ByteStream
|
|
110
104
|
from haystack.document_stores.in_memory import InMemoryDocumentStore
|
|
@@ -115,10 +109,10 @@ from deepl_haystack import DeepLDocumentTranslator
|
|
|
115
109
|
document_store = InMemoryDocumentStore()
|
|
116
110
|
|
|
117
111
|
pipeline = Pipeline()
|
|
118
|
-
pipeline.add_component(instance=
|
|
112
|
+
pipeline.add_component(instance=TextFileToDocument(), name="converter")
|
|
119
113
|
pipeline.add_component(
|
|
120
114
|
instance=DeepLDocumentTranslator(
|
|
121
|
-
api_key=Secret.from_token("
|
|
115
|
+
api_key=Secret.from_token("your_api_key_here"),
|
|
122
116
|
target_lang="ES",
|
|
123
117
|
),
|
|
124
118
|
name="translator",
|
|
@@ -128,7 +122,7 @@ pipeline.add_component(
|
|
|
128
122
|
)
|
|
129
123
|
pipeline.connect("converter", "translator")
|
|
130
124
|
pipeline.connect("translator", "document_store")
|
|
131
|
-
pipeline.run({"converter": {"sources": [ByteStream.from_string("
|
|
125
|
+
pipeline.run({"converter": {"sources": [ByteStream.from_string("Hello world!")]}})
|
|
132
126
|
print(document_store.filter_documents())
|
|
133
127
|
# [Document(id=..., content: '¡Hola, mundo!', meta: {'source_lang': 'EN', 'language': 'ES'})]
|
|
134
128
|
```
|
|
@@ -67,15 +67,9 @@ print("\n".join([f"{doc.content}, {doc.meta}" for doc in translated_documents]))
|
|
|
67
67
|
|
|
68
68
|
### Haystack Pipeline Integration
|
|
69
69
|
|
|
70
|
-
> [!TIP]
|
|
71
|
-
> To run this example, you'll need to have the `MarkdownToDocument` requirements installed:
|
|
72
|
-
> ```shell
|
|
73
|
-
> pip install markdown-it-py, mdit-plain
|
|
74
|
-
> ```
|
|
75
|
-
|
|
76
70
|
```python
|
|
77
71
|
from haystack import Pipeline
|
|
78
|
-
from haystack.components.converters import
|
|
72
|
+
from haystack.components.converters import TextFileToDocument
|
|
79
73
|
from haystack.components.writers import DocumentWriter
|
|
80
74
|
from haystack.dataclasses.byte_stream import ByteStream
|
|
81
75
|
from haystack.document_stores.in_memory import InMemoryDocumentStore
|
|
@@ -86,10 +80,10 @@ from deepl_haystack import DeepLDocumentTranslator
|
|
|
86
80
|
document_store = InMemoryDocumentStore()
|
|
87
81
|
|
|
88
82
|
pipeline = Pipeline()
|
|
89
|
-
pipeline.add_component(instance=
|
|
83
|
+
pipeline.add_component(instance=TextFileToDocument(), name="converter")
|
|
90
84
|
pipeline.add_component(
|
|
91
85
|
instance=DeepLDocumentTranslator(
|
|
92
|
-
api_key=Secret.from_token("
|
|
86
|
+
api_key=Secret.from_token("your_api_key_here"),
|
|
93
87
|
target_lang="ES",
|
|
94
88
|
),
|
|
95
89
|
name="translator",
|
|
@@ -99,7 +93,7 @@ pipeline.add_component(
|
|
|
99
93
|
)
|
|
100
94
|
pipeline.connect("converter", "translator")
|
|
101
95
|
pipeline.connect("translator", "document_store")
|
|
102
|
-
pipeline.run({"converter": {"sources": [ByteStream.from_string("
|
|
96
|
+
pipeline.run({"converter": {"sources": [ByteStream.from_string("Hello world!")]}})
|
|
103
97
|
print(document_store.filter_documents())
|
|
104
98
|
# [Document(id=..., content: '¡Hola, mundo!', meta: {'source_lang': 'EN', 'language': 'ES'})]
|
|
105
99
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "deepl-haystack"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "Haystack integration with DeepL translation services provider."
|
|
5
5
|
authors = ["Albert Iribarne <iribarne@dribia.com>"]
|
|
6
6
|
maintainers = ["Albert Iribarne <iribarne@dribia.com>", "Dribia Data Research <code@dribia.com>"]
|
|
@@ -36,8 +36,6 @@ mypy = "1.11.0"
|
|
|
36
36
|
|
|
37
37
|
[tool.poetry.group.dev.dependencies]
|
|
38
38
|
pre-commit = "^3.7.1"
|
|
39
|
-
markdown-it-py = "^3.0.0"
|
|
40
|
-
mdit-plain = "^1.0.1"
|
|
41
39
|
|
|
42
40
|
[tool.ruff]
|
|
43
41
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|