hamtaa-texttools 1.1.3__py3-none-any.whl → 1.1.4__py3-none-any.whl
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.
- {hamtaa_texttools-1.1.3.dist-info → hamtaa_texttools-1.1.4.dist-info}/METADATA +1 -1
- {hamtaa_texttools-1.1.3.dist-info → hamtaa_texttools-1.1.4.dist-info}/RECORD +9 -9
- texttools/tools/async_the_tool.py +11 -11
- texttools/tools/internals/async_operator.py +2 -2
- texttools/tools/internals/operator.py +2 -2
- texttools/tools/the_tool.py +11 -11
- {hamtaa_texttools-1.1.3.dist-info → hamtaa_texttools-1.1.4.dist-info}/WHEEL +0 -0
- {hamtaa_texttools-1.1.3.dist-info → hamtaa_texttools-1.1.4.dist-info}/licenses/LICENSE +0 -0
- {hamtaa_texttools-1.1.3.dist-info → hamtaa_texttools-1.1.4.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hamtaa-texttools
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.4
|
|
4
4
|
Summary: A high-level NLP toolkit built on top of modern LLMs.
|
|
5
5
|
Author-email: Tohidi <the.mohammad.tohidi@gmail.com>, Montazer <montazerh82@gmail.com>, Givechi <mohamad.m.givechi@gmail.com>, MoosaviNejad <erfanmoosavi84@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
hamtaa_texttools-1.1.
|
|
1
|
+
hamtaa_texttools-1.1.4.dist-info/licenses/LICENSE,sha256=Hb2YOBKy2MJQLnyLrX37B4ZVuac8eaIcE71SvVIMOLg,1082
|
|
2
2
|
texttools/__init__.py,sha256=v3tQCH_Cjj47fCpuhK6sKSVAqEjNkc-cZbY4OJa4IZw,202
|
|
3
3
|
texttools/batch/__init__.py,sha256=q50JsQsmQGp_8RW0KNasYeYWVV0R4FUNZ-ujXwEJemY,143
|
|
4
4
|
texttools/batch/batch_manager.py,sha256=UCJaOq-tTy6kTZJvFuBDBSmzlDeVlLTeFlR83e6eXkQ,8808
|
|
@@ -16,15 +16,15 @@ texttools/prompts/summarize.yaml,sha256=o6rxGPfWtZd61Duvm8NVvCJqfq73b-wAuMSKR6UY
|
|
|
16
16
|
texttools/prompts/text_to_question.yaml,sha256=UheKYpDn6iyKI8NxunHZtFpNyfCLZZe5cvkuXpurUJY,783
|
|
17
17
|
texttools/prompts/translate.yaml,sha256=mGT2uBCei6uucWqVbs4silk-UV060v3G0jnt0P6sr50,634
|
|
18
18
|
texttools/tools/__init__.py,sha256=hG1I28Q7BJ1Dbs95x6QMKXdsAlC5Eh_tqC-EbAibwiU,114
|
|
19
|
-
texttools/tools/async_the_tool.py,sha256=
|
|
20
|
-
texttools/tools/the_tool.py,sha256=
|
|
21
|
-
texttools/tools/internals/async_operator.py,sha256=
|
|
19
|
+
texttools/tools/async_the_tool.py,sha256=2ZY7Lo6Jj9xoTF8bfdh_g8VOXZ7ljMMesd1_QHXyf4s,15395
|
|
20
|
+
texttools/tools/the_tool.py,sha256=XKgZuzriFnk8B-YihJfs6BKivxjGCgOFfe7hnCpEiXs,15161
|
|
21
|
+
texttools/tools/internals/async_operator.py,sha256=pqxceWej3wJmL2RSYEWdowO77MVEN6E7kqppOnsoLOk,9069
|
|
22
22
|
texttools/tools/internals/base_operator.py,sha256=7xRNKyPnh61XTvgPghyQeclBlhw7K7hZxk10ZMC9CQY,3492
|
|
23
23
|
texttools/tools/internals/formatters.py,sha256=tACNLP6PeoqaRpNudVxBaHA25zyWqWYPZQuYysIu88g,941
|
|
24
|
-
texttools/tools/internals/operator.py,sha256=
|
|
24
|
+
texttools/tools/internals/operator.py,sha256=RqCau1F1lxoDQq4BqJvjOnwaf-86SQF_wpoP2V3LYKQ,8951
|
|
25
25
|
texttools/tools/internals/output_models.py,sha256=gbVbzBWeyHUVNsCBuawdgz9ZEzsC7wfygGgZJsAaexY,1662
|
|
26
26
|
texttools/tools/internals/prompt_loader.py,sha256=1khayXcRC5w0Vf2SufpNaN1IUIhbKzS5ATiKheoBcGE,2082
|
|
27
|
-
hamtaa_texttools-1.1.
|
|
28
|
-
hamtaa_texttools-1.1.
|
|
29
|
-
hamtaa_texttools-1.1.
|
|
30
|
-
hamtaa_texttools-1.1.
|
|
27
|
+
hamtaa_texttools-1.1.4.dist-info/METADATA,sha256=-pHGh4p8ZW1agur7LwjY8EUZps9AU9TTWtxxkbleDAw,7449
|
|
28
|
+
hamtaa_texttools-1.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
29
|
+
hamtaa_texttools-1.1.4.dist-info/top_level.txt,sha256=5Mh0jIxxZ5rOXHGJ6Mp-JPKviywwN0MYuH0xk5bEWqE,10
|
|
30
|
+
hamtaa_texttools-1.1.4.dist-info/RECORD,,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal, Any
|
|
1
|
+
from typing import Literal, Any, Callable
|
|
2
2
|
|
|
3
3
|
from openai import AsyncOpenAI
|
|
4
4
|
|
|
@@ -34,7 +34,7 @@ class AsyncTheTool:
|
|
|
34
34
|
temperature: float | None = 0.0,
|
|
35
35
|
logprobs: bool = False,
|
|
36
36
|
top_logprobs: int | None = None,
|
|
37
|
-
validator: Any | None = None,
|
|
37
|
+
validator: Callable[[Any], bool] | None = None,
|
|
38
38
|
) -> OutputModels.ToolOutput:
|
|
39
39
|
"""
|
|
40
40
|
Categorize a text into a single Islamic studies domain category.
|
|
@@ -71,7 +71,7 @@ class AsyncTheTool:
|
|
|
71
71
|
temperature: float | None = 0.0,
|
|
72
72
|
logprobs: bool = False,
|
|
73
73
|
top_logprobs: int | None = None,
|
|
74
|
-
validator: Any | None = None,
|
|
74
|
+
validator: Callable[[Any], bool] | None = None,
|
|
75
75
|
) -> OutputModels.ToolOutput:
|
|
76
76
|
"""
|
|
77
77
|
Extract salient keywords from text.
|
|
@@ -108,7 +108,7 @@ class AsyncTheTool:
|
|
|
108
108
|
temperature: float | None = 0.0,
|
|
109
109
|
logprobs: bool = False,
|
|
110
110
|
top_logprobs: int | None = None,
|
|
111
|
-
validator: Any | None = None,
|
|
111
|
+
validator: Callable[[Any], bool] | None = None,
|
|
112
112
|
) -> OutputModels.ToolOutput:
|
|
113
113
|
"""
|
|
114
114
|
Perform Named Entity Recognition (NER) over the input text.
|
|
@@ -144,7 +144,7 @@ class AsyncTheTool:
|
|
|
144
144
|
temperature: float | None = 0.0,
|
|
145
145
|
logprobs: bool = False,
|
|
146
146
|
top_logprobs: int | None = None,
|
|
147
|
-
validator: Any | None = None,
|
|
147
|
+
validator: Callable[[Any], bool] | None = None,
|
|
148
148
|
) -> OutputModels.ToolOutput:
|
|
149
149
|
"""
|
|
150
150
|
Detect if the input is phrased as a question.
|
|
@@ -181,7 +181,7 @@ class AsyncTheTool:
|
|
|
181
181
|
temperature: float | None = 0.0,
|
|
182
182
|
logprobs: bool = False,
|
|
183
183
|
top_logprobs: int | None = None,
|
|
184
|
-
validator: Any | None = None,
|
|
184
|
+
validator: Callable[[Any], bool] | None = None,
|
|
185
185
|
) -> OutputModels.ToolOutput:
|
|
186
186
|
"""
|
|
187
187
|
Generate a single question from the given text.
|
|
@@ -219,7 +219,7 @@ class AsyncTheTool:
|
|
|
219
219
|
logprobs: bool = False,
|
|
220
220
|
top_logprobs: int | None = None,
|
|
221
221
|
mode: Literal["default", "reason"] = "default",
|
|
222
|
-
validator: Any | None = None,
|
|
222
|
+
validator: Callable[[Any], bool] | None = None,
|
|
223
223
|
) -> OutputModels.ToolOutput:
|
|
224
224
|
"""
|
|
225
225
|
Merge multiple questions into a single unified question.
|
|
@@ -258,7 +258,7 @@ class AsyncTheTool:
|
|
|
258
258
|
logprobs: bool = False,
|
|
259
259
|
top_logprobs: int | None = None,
|
|
260
260
|
mode: Literal["positive", "negative", "hard_negative"] = "positive",
|
|
261
|
-
validator: Any | None = None,
|
|
261
|
+
validator: Callable[[Any], bool] | None = None,
|
|
262
262
|
) -> OutputModels.ToolOutput:
|
|
263
263
|
"""
|
|
264
264
|
Rewrite a text with different modes.
|
|
@@ -296,7 +296,7 @@ class AsyncTheTool:
|
|
|
296
296
|
temperature: float | None = 0.0,
|
|
297
297
|
logprobs: bool = False,
|
|
298
298
|
top_logprobs: int | None = None,
|
|
299
|
-
validator: Any | None = None,
|
|
299
|
+
validator: Callable[[Any], bool] | None = None,
|
|
300
300
|
) -> OutputModels.ToolOutput:
|
|
301
301
|
"""
|
|
302
302
|
Generate a list of questions about a subject.
|
|
@@ -334,7 +334,7 @@ class AsyncTheTool:
|
|
|
334
334
|
temperature: float | None = 0.0,
|
|
335
335
|
logprobs: bool = False,
|
|
336
336
|
top_logprobs: int | None = None,
|
|
337
|
-
validator: Any | None = None,
|
|
337
|
+
validator: Callable[[Any], bool] | None = None,
|
|
338
338
|
) -> OutputModels.ToolOutput:
|
|
339
339
|
"""
|
|
340
340
|
Summarize the given subject text.
|
|
@@ -371,7 +371,7 @@ class AsyncTheTool:
|
|
|
371
371
|
temperature: float | None = 0.0,
|
|
372
372
|
logprobs: bool = False,
|
|
373
373
|
top_logprobs: int | None = None,
|
|
374
|
-
validator: Any | None = None,
|
|
374
|
+
validator: Callable[[Any], bool] | None = None,
|
|
375
375
|
) -> OutputModels.ToolOutput:
|
|
376
376
|
"""
|
|
377
377
|
Translate text between languages.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, TypeVar, Type, Literal
|
|
1
|
+
from typing import Any, TypeVar, Type, Literal, Callable
|
|
2
2
|
import logging
|
|
3
3
|
|
|
4
4
|
from openai import AsyncOpenAI
|
|
@@ -115,7 +115,7 @@ class AsyncOperator(BaseOperator):
|
|
|
115
115
|
temperature: float,
|
|
116
116
|
logprobs: bool,
|
|
117
117
|
top_logprobs: int | None,
|
|
118
|
-
validator: Any | None,
|
|
118
|
+
validator: Callable[[Any], bool] | None,
|
|
119
119
|
# Internal parameters
|
|
120
120
|
prompt_file: str,
|
|
121
121
|
output_model: Type[T],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, TypeVar, Type, Literal
|
|
1
|
+
from typing import Any, TypeVar, Type, Literal, Callable
|
|
2
2
|
import logging
|
|
3
3
|
|
|
4
4
|
from openai import OpenAI
|
|
@@ -115,7 +115,7 @@ class Operator(BaseOperator):
|
|
|
115
115
|
temperature: float,
|
|
116
116
|
logprobs: bool,
|
|
117
117
|
top_logprobs: int | None,
|
|
118
|
-
validator: Any | None,
|
|
118
|
+
validator: Callable[[Any], bool] | None,
|
|
119
119
|
# Internal parameters
|
|
120
120
|
prompt_file: str,
|
|
121
121
|
output_model: Type[T],
|
texttools/tools/the_tool.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal, Any
|
|
1
|
+
from typing import Literal, Any, Callable
|
|
2
2
|
|
|
3
3
|
from openai import OpenAI
|
|
4
4
|
|
|
@@ -32,7 +32,7 @@ class TheTool:
|
|
|
32
32
|
temperature: float | None = 0.0,
|
|
33
33
|
logprobs: bool = False,
|
|
34
34
|
top_logprobs: int | None = None,
|
|
35
|
-
validator: Any | None = None,
|
|
35
|
+
validator: Callable[[Any], bool] | None = None,
|
|
36
36
|
) -> OutputModels.ToolOutput:
|
|
37
37
|
"""
|
|
38
38
|
Categorize a text into a single Islamic studies domain category.
|
|
@@ -69,7 +69,7 @@ class TheTool:
|
|
|
69
69
|
temperature: float | None = 0.0,
|
|
70
70
|
logprobs: bool = False,
|
|
71
71
|
top_logprobs: int | None = None,
|
|
72
|
-
validator: Any | None = None,
|
|
72
|
+
validator: Callable[[Any], bool] | None = None,
|
|
73
73
|
) -> OutputModels.ToolOutput:
|
|
74
74
|
"""
|
|
75
75
|
Extract salient keywords from text.
|
|
@@ -106,7 +106,7 @@ class TheTool:
|
|
|
106
106
|
temperature: float | None = 0.0,
|
|
107
107
|
logprobs: bool = False,
|
|
108
108
|
top_logprobs: int | None = None,
|
|
109
|
-
validator: Any | None = None,
|
|
109
|
+
validator: Callable[[Any], bool] | None = None,
|
|
110
110
|
) -> OutputModels.ToolOutput:
|
|
111
111
|
"""
|
|
112
112
|
Perform Named Entity Recognition (NER) over the input text.
|
|
@@ -142,7 +142,7 @@ class TheTool:
|
|
|
142
142
|
temperature: float | None = 0.0,
|
|
143
143
|
logprobs: bool = False,
|
|
144
144
|
top_logprobs: int | None = None,
|
|
145
|
-
validator: Any | None = None,
|
|
145
|
+
validator: Callable[[Any], bool] | None = None,
|
|
146
146
|
) -> OutputModels.ToolOutput:
|
|
147
147
|
"""
|
|
148
148
|
Detect if the input is phrased as a question.
|
|
@@ -179,7 +179,7 @@ class TheTool:
|
|
|
179
179
|
temperature: float | None = 0.0,
|
|
180
180
|
logprobs: bool = False,
|
|
181
181
|
top_logprobs: int | None = None,
|
|
182
|
-
validator: Any | None = None,
|
|
182
|
+
validator: Callable[[Any], bool] | None = None,
|
|
183
183
|
) -> OutputModels.ToolOutput:
|
|
184
184
|
"""
|
|
185
185
|
Generate a single question from the given text.
|
|
@@ -217,7 +217,7 @@ class TheTool:
|
|
|
217
217
|
logprobs: bool = False,
|
|
218
218
|
top_logprobs: int | None = None,
|
|
219
219
|
mode: Literal["default", "reason"] = "default",
|
|
220
|
-
validator: Any | None = None,
|
|
220
|
+
validator: Callable[[Any], bool] | None = None,
|
|
221
221
|
) -> OutputModels.ToolOutput:
|
|
222
222
|
"""
|
|
223
223
|
Merge multiple questions into a single unified question.
|
|
@@ -256,7 +256,7 @@ class TheTool:
|
|
|
256
256
|
logprobs: bool = False,
|
|
257
257
|
top_logprobs: int | None = None,
|
|
258
258
|
mode: Literal["positive", "negative", "hard_negative"] = "positive",
|
|
259
|
-
validator: Any | None = None,
|
|
259
|
+
validator: Callable[[Any], bool] | None = None,
|
|
260
260
|
) -> OutputModels.ToolOutput:
|
|
261
261
|
"""
|
|
262
262
|
Rewrite a text with different modes.
|
|
@@ -294,7 +294,7 @@ class TheTool:
|
|
|
294
294
|
temperature: float | None = 0.0,
|
|
295
295
|
logprobs: bool = False,
|
|
296
296
|
top_logprobs: int | None = None,
|
|
297
|
-
validator: Any | None = None,
|
|
297
|
+
validator: Callable[[Any], bool] | None = None,
|
|
298
298
|
) -> OutputModels.ToolOutput:
|
|
299
299
|
"""
|
|
300
300
|
Generate a list of questions about a subject.
|
|
@@ -332,7 +332,7 @@ class TheTool:
|
|
|
332
332
|
temperature: float | None = 0.0,
|
|
333
333
|
logprobs: bool = False,
|
|
334
334
|
top_logprobs: int | None = None,
|
|
335
|
-
validator: Any | None = None,
|
|
335
|
+
validator: Callable[[Any], bool] | None = None,
|
|
336
336
|
) -> OutputModels.ToolOutput:
|
|
337
337
|
"""
|
|
338
338
|
Summarize the given subject text.
|
|
@@ -369,7 +369,7 @@ class TheTool:
|
|
|
369
369
|
temperature: float | None = 0.0,
|
|
370
370
|
logprobs: bool = False,
|
|
371
371
|
top_logprobs: int | None = None,
|
|
372
|
-
validator: Any | None = None,
|
|
372
|
+
validator: Callable[[Any], bool] | None = None,
|
|
373
373
|
) -> OutputModels.ToolOutput:
|
|
374
374
|
"""
|
|
375
375
|
Translate text between languages.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|