hamtaa-texttools 1.1.20__py3-none-any.whl → 1.1.22__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.
Files changed (32) hide show
  1. {hamtaa_texttools-1.1.20.dist-info → hamtaa_texttools-1.1.22.dist-info}/METADATA +49 -109
  2. hamtaa_texttools-1.1.22.dist-info/RECORD +32 -0
  3. texttools/__init__.py +3 -3
  4. texttools/batch/batch_config.py +14 -1
  5. texttools/batch/batch_runner.py +2 -2
  6. texttools/internals/async_operator.py +49 -92
  7. texttools/internals/models.py +74 -105
  8. texttools/internals/operator_utils.py +25 -27
  9. texttools/internals/prompt_loader.py +3 -20
  10. texttools/internals/sync_operator.py +49 -92
  11. texttools/prompts/README.md +2 -2
  12. texttools/prompts/categorize.yaml +35 -77
  13. texttools/prompts/check_fact.yaml +2 -2
  14. texttools/prompts/extract_entities.yaml +2 -2
  15. texttools/prompts/extract_keywords.yaml +6 -6
  16. texttools/prompts/is_question.yaml +2 -2
  17. texttools/prompts/merge_questions.yaml +4 -4
  18. texttools/prompts/propositionize.yaml +2 -2
  19. texttools/prompts/rewrite.yaml +6 -6
  20. texttools/prompts/run_custom.yaml +1 -1
  21. texttools/prompts/subject_to_question.yaml +2 -2
  22. texttools/prompts/summarize.yaml +2 -2
  23. texttools/prompts/text_to_question.yaml +2 -2
  24. texttools/prompts/translate.yaml +2 -2
  25. texttools/tools/async_tools.py +393 -487
  26. texttools/tools/sync_tools.py +394 -488
  27. hamtaa_texttools-1.1.20.dist-info/RECORD +0 -33
  28. texttools/batch/internals/utils.py +0 -13
  29. {hamtaa_texttools-1.1.20.dist-info → hamtaa_texttools-1.1.22.dist-info}/WHEEL +0 -0
  30. {hamtaa_texttools-1.1.20.dist-info → hamtaa_texttools-1.1.22.dist-info}/licenses/LICENSE +0 -0
  31. {hamtaa_texttools-1.1.20.dist-info → hamtaa_texttools-1.1.22.dist-info}/top_level.txt +0 -0
  32. /texttools/batch/{internals/batch_manager.py → batch_manager.py} +0 -0
@@ -1,77 +1,35 @@
1
- main_template:
2
-
3
- category_list: |
4
- You are an expert classification agent.
5
- You receive a list of categories.
6
-
7
- Your task:
8
- - Read all provided categories carefully.
9
- - Consider the user query, intent, and task explanation.
10
- - Select exactly one category name from the list that best matches the user’s intent.
11
- - Return only the category name, nothing else.
12
-
13
- Rules:
14
- - Never invent categories that are not in the list.
15
- - If multiple categories seem possible, choose the closest match based on the description and user intent.
16
- - If descriptions are missing or empty, rely on the category name.
17
- - If the correct answer cannot be determined with certainty, choose the most likely one.
18
-
19
- Output format:
20
- {{
21
- "reason": "Explanation of why the input belongs to the category"
22
- "result": "<category_name_only>"
23
- }}
24
-
25
- Available categories with their descriptions:
26
- {category_list}
27
-
28
- The text that has to be categorized:
29
- {input}
30
-
31
- category_tree: |
32
- You are an expert classification agent.
33
- You receive a list of categories at the current level of a hierarchical category tree.
34
-
35
- Your task:
36
- - Read all provided categories carefully.
37
- - Consider the user query, intent, and task explanation.
38
- - Select exactly one category name from the list that best matches the user’s intent.
39
- - Return only the category name, nothing else.
40
-
41
- Rules:
42
- - Never invent categories that are not in the list.
43
- - If multiple categories seem possible, choose the closest match based on the description and user intent.
44
- - If descriptions are missing or empty, rely on the category name.
45
- - If the correct answer cannot be determined with certainty, choose the most likely one.
46
-
47
- Output format:
48
- {{
49
- "reason": "Explanation of why the input belongs to the category"
50
- "result": "<category_name_only>"
51
- }}
52
-
53
- Available categories with their descriptions at this level:
54
- {category_list}
55
-
56
- Do not include category descriptions at all. Only write the raw category.
57
-
58
- The text that has to be categorized:
59
- {input}
60
-
61
- analyze_template:
62
-
63
- category_list: |
64
- We want to categorize the given text.
65
- To improve categorization, we need an analysis of the text.
66
- Analyze the given text and write its main idea and a short analysis of that.
67
- Analysis should be very short.
68
- Text:
69
- {input}
70
-
71
- category_tree: |
72
- We want to categorize the given text.
73
- To improve categorization, we need an analysis of the text.
74
- Analyze the given text and write its main idea and a short analysis of that.
75
- Analysis should be very short.
76
- Text:
77
- {input}
1
+ main_template: |
2
+ You are an expert classification agent.
3
+ You receive a list of categories.
4
+
5
+ Your task:
6
+ - Read all provided categories carefully.
7
+ - Consider the user query, intent, and task explanation.
8
+ - Select exactly one category name from the list that best matches the user’s intent.
9
+ - Return only the category name, nothing else.
10
+
11
+ Rules:
12
+ - Never invent categories that are not in the list.
13
+ - If multiple categories seem possible, choose the closest match based on the description and user intent.
14
+ - If descriptions are missing or empty, rely on the category name.
15
+ - If the correct answer cannot be determined with certainty, choose the most likely one.
16
+
17
+ Output format:
18
+ {{
19
+ "reason": "Explanation of why the input belongs to the category"
20
+ "result": "<category_name_only>"
21
+ }}
22
+
23
+ Available categories with their descriptions:
24
+ {category_list}
25
+
26
+ The text that has to be categorized:
27
+ {text}
28
+
29
+ analyze_template: |
30
+ We want to categorize the given text.
31
+ To improve categorization, we need an analysis of the text.
32
+ Analyze the given text and write its main idea and a short analysis of that.
33
+ Analysis should be very short.
34
+ Text:
35
+ {text}
@@ -5,7 +5,7 @@ main_template: |
5
5
  Respond only in JSON format (Output should be a boolean):
6
6
  {{"result": True/False}}
7
7
  The statement is:
8
- {input}
8
+ {text}
9
9
  The source text is:
10
10
  {source_text}
11
11
 
@@ -14,6 +14,6 @@ analyze_template: |
14
14
  summarized analysis that could help in determining that can the statement
15
15
  be concluded from the source or not.
16
16
  The statement is:
17
- {input}
17
+ {text}
18
18
  The source text is:
19
19
  {source_text}
@@ -12,9 +12,9 @@ main_template: |
12
12
  ]
13
13
  }}
14
14
  Here is the text:
15
- {input}
15
+ {text}
16
16
 
17
17
  analyze_template: |
18
18
  Read the following text and identify any proper nouns, key concepts, or specific mentions that might represent named entities.
19
19
  Provide a brief, summarized analysis that could help in categorizing these entities.
20
- {input}
20
+ {text}
@@ -12,7 +12,7 @@ main_template:
12
12
  - Respond only in JSON format:
13
13
  {{"result": ["keyword1", "keyword2", etc.]}}
14
14
  Here is the text:
15
- {input}
15
+ {text}
16
16
 
17
17
  threshold: |
18
18
  You are an expert keyword extractor specialized in fine-grained concept identification.
@@ -32,7 +32,7 @@ main_template:
32
32
  - Respond only in JSON format:
33
33
  {{"result": ["keyword1", "keyword2", etc.]}}
34
34
  Here is the text:
35
- {input}
35
+ {text}
36
36
 
37
37
  count: |
38
38
  You are an expert keyword extractor with precise output requirements.
@@ -49,20 +49,20 @@ main_template:
49
49
  {{"result": ["keyword1", "keyword2", "keyword3", ...]}}
50
50
 
51
51
  Here is the text:
52
- {input}
52
+ {text}
53
53
 
54
54
  analyze_template:
55
55
  auto: |
56
56
  Analyze the following text to identify its main topics, concepts, and important terms.
57
57
  Provide a concise summary of your findings that will help in extracting relevant keywords.
58
- {input}
58
+ {text}
59
59
 
60
60
  threshold: |
61
61
  Analyze the following text to identify its main topics, concepts, and important terms.
62
62
  Provide a concise summary of your findings that will help in extracting relevant keywords.
63
- {input}
63
+ {text}
64
64
 
65
65
  count: |
66
66
  Analyze the following text to identify its main topics, concepts, and important terms.
67
67
  Provide a concise summary of your findings that will help in extracting relevant keywords.
68
- {input}
68
+ {text}
@@ -4,11 +4,11 @@ main_template: |
4
4
  Respond only in JSON format (Output should be a boolean):
5
5
  {{"result": True/False}}
6
6
  Here is the text:
7
- {input}
7
+ {text}
8
8
 
9
9
  analyze_template: |
10
10
  We want to analyze this text snippet to see if it contains any question or request of some kind or not.
11
11
  Read the text, and reason about it being a request or not.
12
12
  Summerized, short answer.
13
- {input}
13
+ {text}
14
14
 
@@ -12,7 +12,7 @@ main_template:
12
12
  - Respond only in JSON format:
13
13
  {{"result": "string"}}
14
14
  Here is the questions:
15
- {input}
15
+ {text}
16
16
 
17
17
  reason: |
18
18
  You are an AI assistant helping to unify semantically similar questions.
@@ -23,7 +23,7 @@ main_template:
23
23
  Respond only in JSON format:
24
24
  {{"result": "string"}}
25
25
  Here is the questions:
26
- {input}
26
+ {text}
27
27
 
28
28
  analyze_template:
29
29
 
@@ -34,7 +34,7 @@ analyze_template:
34
34
  Provide a brief, summarized understanding of the questions' meaning that
35
35
  will help in merging and rephrasing it accurately without changing its intent.
36
36
  Here is the question:
37
- {input}
37
+ {text}
38
38
 
39
39
  reason: |
40
40
  Analyze the following questions to identify their exact wording, phrasing,
@@ -42,5 +42,5 @@ analyze_template:
42
42
  Provide a brief, summarized analysis of their linguistic structure and current meaning,
43
43
  which will then be used to create a new question containing all of their contents.
44
44
  Here is the question:
45
- {input}
45
+ {text}
46
46
 
@@ -12,11 +12,11 @@ main_template: |
12
12
  4. No Redundancy: Do not extract summary statements that merely repeat facts already listed.
13
13
 
14
14
  Extract the atomic propositions from the following text:
15
- {input}
15
+ {text}
16
16
 
17
17
  analyze_template: |
18
18
  We want to analyze this text snippet and think about where we can split sentence to atomic meaningful propositions.
19
19
  An atomic proposition is a single, self-contained fact that is concise,
20
20
  verifiable, and does not rely on external context.
21
21
  You just have to think around the possible propositions in the text and how a proposition can be made.
22
- {input}
22
+ {text}
@@ -18,7 +18,7 @@ main_template:
18
18
  {{"result": "str"}}
19
19
 
20
20
  Anchor Text:
21
- "{input}"
21
+ "{text}"
22
22
 
23
23
  negative: |
24
24
  You are an AI assistant designed to generate high-quality training data for semantic text embedding models.
@@ -35,7 +35,7 @@ main_template:
35
35
  {{"result": "str"}}
36
36
 
37
37
  Anchor Text:
38
- "{input}"
38
+ "{text}"
39
39
 
40
40
  hard_negative: |
41
41
  You are an AI assistant designed to generate high-quality training data for semantic text embedding models.
@@ -57,7 +57,7 @@ main_template:
57
57
  {{"result": "str"}}
58
58
 
59
59
  Anchor Text:
60
- "{input}"
60
+ "{text}"
61
61
 
62
62
 
63
63
  analyze_template:
@@ -74,7 +74,7 @@ analyze_template:
74
74
  Your analysis should capture the ESSENTIAL MEANING that must be preserved in any paraphrase.
75
75
 
76
76
  Text:
77
- {input}
77
+ {text}
78
78
 
79
79
  negative: |
80
80
  Analyze the following text to identify its SPECIFIC TOPIC and DOMAIN for creating a high-quality NEGATIVE sample.
@@ -88,7 +88,7 @@ analyze_template:
88
88
  The goal is to find topics that are in the same domain but semantically unrelated to this specific text.
89
89
 
90
90
  Text:
91
- {input}
91
+ {text}
92
92
 
93
93
  hard_negative: |
94
94
  Analyze this text to identify EXACTLY ONE ELEMENT that can be changed to create a hard-negative sample.
@@ -107,5 +107,5 @@ analyze_template:
107
107
  - 80-90% of the vocabulary
108
108
 
109
109
  Text:
110
- {input}
110
+ {text}
111
111
 
@@ -1,5 +1,5 @@
1
1
  main_template: |
2
- {input}
2
+ {text}
3
3
  Respond only in JSON format:
4
4
  {output_model_str}
5
5
 
@@ -9,7 +9,7 @@ main_template: |
9
9
  Respond only in JSON format:
10
10
  {{"result": ["question1", "question2", ...], "reason": "string"}}
11
11
  Here is the text:
12
- {input}
12
+ {text}
13
13
 
14
14
  analyze_template: |
15
15
  Our goal is to generate questions from the given subject.
@@ -19,4 +19,4 @@ analyze_template: |
19
19
  What is the subject about?
20
20
  What point of views can we see and generate questoins from it? (Questions that real users might have.)
21
21
  Here is the subject:
22
- {input}
22
+ {text}
@@ -4,11 +4,11 @@ main_template: |
4
4
  Respond only in JSON format:
5
5
  {{"result": "string"}}
6
6
  Provide a concise summary of the following text:
7
- {input}
7
+ {text}
8
8
 
9
9
 
10
10
  analyze_template: |
11
11
  Read the following text and identify its main points, key arguments, and overall purpose.
12
12
  Provide a brief, summarized analysis that will help in generating an accurate and concise summary.
13
- {input}
13
+ {text}
14
14
 
@@ -9,7 +9,7 @@ main_template: |
9
9
  Respond only in JSON format:
10
10
  {{"result": ["question1", "question2", ...], "reason": "string"}}
11
11
  Here is the answer:
12
- {input}
12
+ {text}
13
13
 
14
14
  analyze_template: |
15
15
  Analyze the following answer to identify its key facts,
@@ -18,5 +18,5 @@ analyze_template: |
18
18
  help in formulating relevant and direct questions.
19
19
  Just mention the keypoints that was provided in the answer
20
20
  Here is the answer:
21
- {input}
21
+ {text}
22
22
 
@@ -5,11 +5,11 @@ main_template: |
5
5
  {{"result": "string"}}
6
6
  Don't translate proper name, only transliterate them to {target_language}
7
7
  Translate the following text to {target_language}:
8
- {input}
8
+ {text}
9
9
 
10
10
  analyze_template: |
11
11
  Analyze the following text and identify important linguistic considerations for translation.
12
12
  Point out any idioms, cultural references, or complex structures that need special attention.
13
13
  Also, list all proper nouns that should not be translated. Write your analysis in the {target_language}.
14
- {input}
14
+ {text}
15
15