txt2stix 1.1.11__py3-none-any.whl → 1.1.12__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.
@@ -6,7 +6,7 @@ from llama_index.llms.anthropic import Anthropic
6
6
 
7
7
 
8
8
  class AnthropicAIExtractor(BaseAIExtractor, provider="anthropic"):
9
- def __init__(self, **kwargs) -> None:
9
+ def __init__(self, model='claude-sonnet-4-0', **kwargs) -> None:
10
10
  kwargs.setdefault('temperature', float(os.environ.get('TEMPERATURE', 0.0)))
11
- self.llm = Anthropic(max_tokens=4096, system_prompt=self.system_prompt, **kwargs)
11
+ self.llm = Anthropic(max_tokens=4096, model=model, system_prompt=self.system_prompt, **kwargs)
12
12
  super().__init__()
@@ -1,17 +1,17 @@
1
1
 
2
2
  import os
3
3
  from txt2stix.ai_extractor.base import BaseAIExtractor
4
- from llama_index.llms.gemini import Gemini
4
+ from llama_index.llms.google_genai import GoogleGenAI
5
5
 
6
6
 
7
7
  class GeminiAIExtractor(BaseAIExtractor, provider="gemini"):
8
8
  def __init__(self, **kwargs) -> None:
9
9
  kwargs.setdefault('temperature', float(os.environ.get('TEMPERATURE', 0.0)))
10
- self.llm = Gemini(max_tokens=4096, **kwargs)
10
+ self.llm = GoogleGenAI(max_tokens=4096, **kwargs)
11
11
  super().__init__()
12
12
 
13
13
  def count_tokens(self, text):
14
- return self.llm._model.count_tokens(text).total_tokens
14
+ return self.llm._client.models.count_tokens(model=self.llm.model, contents=text).total_tokens
15
15
 
16
16
  @property
17
17
  def extractor_name(self):
txt2stix/txt2stix.py CHANGED
@@ -361,6 +361,7 @@ def validate_token_count(max_tokens, input, extractors: list[BaseAIExtractor]):
361
361
  logging.info('INPUT_TOKEN_LIMIT = %d', max_tokens)
362
362
  for extractor in extractors:
363
363
  token_count = _count_token(extractor, input)
364
+ logging.info(f"{extractor.extractor_name}: input_file token count = {token_count}")
364
365
  if token_count > max_tokens:
365
366
  raise FatalException(f"{extractor.extractor_name}: input_file token count ({token_count}) exceeds INPUT_TOKEN_LIMIT ({max_tokens})")
366
367
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2stix
3
- Version: 1.1.11
3
+ Version: 1.1.12
4
4
  Summary: txt2stix is a Python script that is designed to identify and extract IoCs and TTPs from text files, identify the relationships between them, convert them to STIX 2.1 objects, and output as a STIX 2.1 bundle.
5
5
  Project-URL: Homepage, https://github.com/muchdogesec/txt2stix
6
6
  Project-URL: Issues, https://github.com/muchdogesec/txt2stix/issues
@@ -15,8 +15,8 @@ Requires-Python: >=3.9
15
15
  Requires-Dist: base58>=2.1.1
16
16
  Requires-Dist: beautifulsoup4>=4.12.3
17
17
  Requires-Dist: json-repair
18
- Requires-Dist: llama-index-core>=0.12.42
19
- Requires-Dist: llama-index-llms-openai>=0.4.5
18
+ Requires-Dist: llama-index-core>=0.14.8
19
+ Requires-Dist: llama-index-llms-openai>=0.6.8
20
20
  Requires-Dist: mistune>=3.0.2
21
21
  Requires-Dist: pathvalidate>=3.2.0
22
22
  Requires-Dist: phonenumbers>=8.13.39
@@ -29,13 +29,18 @@ Requires-Dist: tld>=0.13
29
29
  Requires-Dist: tldextract>=5.1.2
30
30
  Requires-Dist: validators>=0.28.3
31
31
  Provides-Extra: anthropic
32
- Requires-Dist: llama-index-llms-anthropic>=0.7.2; extra == 'anthropic'
32
+ Requires-Dist: llama-index-llms-anthropic>=0.9.7; extra == 'anthropic'
33
33
  Provides-Extra: deepseek
34
- Requires-Dist: llama-index-llms-deepseek>=0.1.2; extra == 'deepseek'
34
+ Requires-Dist: llama-index-llms-deepseek>=0.2.2; extra == 'deepseek'
35
35
  Provides-Extra: gemini
36
- Requires-Dist: llama-index-llms-gemini>=0.5.0; extra == 'gemini'
36
+ Requires-Dist: llama-index-llms-google-genai>=0.5.0; extra == 'gemini'
37
+ Provides-Extra: llms
38
+ Requires-Dist: llama-index-llms-anthropic>=0.9.7; extra == 'llms'
39
+ Requires-Dist: llama-index-llms-deepseek>=0.2.2; extra == 'llms'
40
+ Requires-Dist: llama-index-llms-google-genai>=0.5.0; extra == 'llms'
41
+ Requires-Dist: llama-index-llms-openrouter>=0.4.2; extra == 'llms'
37
42
  Provides-Extra: openrouter
38
- Requires-Dist: llama-index-llms-openrouter>=0.3.2; extra == 'openrouter'
43
+ Requires-Dist: llama-index-llms-openrouter>=0.4.2; extra == 'openrouter'
39
44
  Provides-Extra: tests
40
45
  Requires-Dist: pytest; extra == 'tests'
41
46
  Requires-Dist: pytest-cov; extra == 'tests'
@@ -8,13 +8,13 @@ txt2stix/indicator.py,sha256=dyf4wbvVrZRitZpm6t7UusSM98bVW1qc5UkdGpVm3ls,30025
8
8
  txt2stix/lookups.py,sha256=h42YVtYUkWZm6ZPv2h5hHDHDzDs3yBqrT_T7pj2MDZI,2301
9
9
  txt2stix/retriever.py,sha256=sMNhnEYk3l5W44qZsWaDQtJYoHXA1oYIPM6wDqiUHSg,6642
10
10
  txt2stix/stix.py,sha256=9nXD9a2dCY4uaatl-mlIA1k3srwQBhGW-tUSho3iYe0,30
11
- txt2stix/txt2stix.py,sha256=l889ysbkZLFoSLak6Hv4IN8sr0HillVp4cbC2WS-UkI,18769
11
+ txt2stix/txt2stix.py,sha256=CaK2YmkMjBvC8FXZmvkThZfb9_K94sV31Uvns3gPx20,18862
12
12
  txt2stix/utils.py,sha256=n6mh4t9ZRJ7iT4Jvp9ai_dfCXjgXNcRtF_zXO7nkpnk,3304
13
13
  txt2stix/ai_extractor/__init__.py,sha256=5Tf6Co9THzytBdFEVhD-7vvT05TT3nSpltnAV1sfdoM,349
14
- txt2stix/ai_extractor/anthropic.py,sha256=mdz-8CB-BSCEqnK5l35DRZURVPUf508ef2b48XMxmuk,441
14
+ txt2stix/ai_extractor/anthropic.py,sha256=B5Z3nm2-w5KBhLcVJGkhNF0dn4lUo-fW_DnbOeJKA5Q,481
15
15
  txt2stix/ai_extractor/base.py,sha256=t0SCh24FeDEDzXsrGFada6ux9F6m0ILwXtPSaleDiv8,4172
16
16
  txt2stix/ai_extractor/deepseek.py,sha256=2XehIYbWXG6Odq68nQX4CNtl5GdmBlAmjLP_lG2eEFo,660
17
- txt2stix/ai_extractor/gemini.py,sha256=yJC7knYzl-TScyCBd-MTpUf-NT6znC25E7vXxNMqjLU,578
17
+ txt2stix/ai_extractor/gemini.py,sha256=rhhYrCa1zZTjadVk2QFhguD8_Yr03gl-D4Yb2nVBMI4,633
18
18
  txt2stix/ai_extractor/openai.py,sha256=1RxaLy0TJ4GjNKmcJoi6ZiBrCS_gt5ql9jpeE-SOy8g,642
19
19
  txt2stix/ai_extractor/openrouter.py,sha256=hAA6mTOMcpA28XYsOCvuJH7WMJqXCxfqZGJf_VrDsIk,628
20
20
  txt2stix/ai_extractor/prompts.py,sha256=NtqtVyPPtShPlVZ5SrFmo-LCkfpANIIi4H9rjqaxqDo,10559
@@ -114,8 +114,8 @@ txt2stix/includes/lookups/threat_actor.txt,sha256=QfDO9maQuqKBgW_Sdd7VGv1SHZ9Ra-
114
114
  txt2stix/includes/lookups/tld.txt,sha256=-MEgJea2NMG_KDsnc4BVvI8eRk5Dm93L-t8SGYx5wMo,8598
115
115
  txt2stix/includes/lookups/tool.txt,sha256=HGKG6JpUE26w6ezzSxOjBkp15UpSaB7N-mZ_NU_3G7A,6
116
116
  txt2stix/includes/tests/test_cases.yaml,sha256=vErA3c5fySeWvJ5yJ8dCTEo3ufRATASAjaF4gj4Az1M,22424
117
- txt2stix-1.1.11.dist-info/METADATA,sha256=WgfNqcRRCIhML4mqK0qhAxSsDh1H-74Xj9X_QbRmsG4,14739
118
- txt2stix-1.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
119
- txt2stix-1.1.11.dist-info/entry_points.txt,sha256=x6QPtt65hWeomw4IpJ_wQUesBl1M4WOLODbhOKyWMFg,55
120
- txt2stix-1.1.11.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
121
- txt2stix-1.1.11.dist-info/RECORD,,
117
+ txt2stix-1.1.12.dist-info/METADATA,sha256=H_-Z_rIZrd0_yLobzdL9Ftthm400x05vLmSThIRDcVQ,15032
118
+ txt2stix-1.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
119
+ txt2stix-1.1.12.dist-info/entry_points.txt,sha256=x6QPtt65hWeomw4IpJ_wQUesBl1M4WOLODbhOKyWMFg,55
120
+ txt2stix-1.1.12.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
121
+ txt2stix-1.1.12.dist-info/RECORD,,