janus-llm 3.5.2__py3-none-any.whl → 4.0.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- janus/__init__.py +1 -1
- janus/cli.py +90 -42
- janus/converter/converter.py +111 -142
- janus/converter/diagram.py +21 -109
- janus/converter/translate.py +1 -1
- janus/language/alc/_tests/test_alc.py +1 -1
- janus/language/alc/alc.py +16 -11
- janus/language/binary/_tests/test_binary.py +1 -1
- janus/language/binary/binary.py +2 -2
- janus/language/mumps/_tests/test_mumps.py +1 -1
- janus/language/mumps/mumps.py +2 -3
- janus/language/naive/simple_ast.py +3 -2
- janus/language/splitter.py +7 -4
- janus/language/treesitter/_tests/test_treesitter.py +1 -1
- janus/language/treesitter/treesitter.py +2 -2
- janus/llm/model_callbacks.py +13 -0
- janus/llm/models_info.py +118 -71
- janus/metrics/metric.py +15 -14
- janus/parsers/uml.py +60 -23
- janus/refiners/refiner.py +106 -64
- janus/retrievers/retriever.py +42 -0
- {janus_llm-3.5.2.dist-info → janus_llm-4.0.0.dist-info}/METADATA +1 -1
- {janus_llm-3.5.2.dist-info → janus_llm-4.0.0.dist-info}/RECORD +26 -26
- janus/parsers/refiner_parser.py +0 -46
- {janus_llm-3.5.2.dist-info → janus_llm-4.0.0.dist-info}/LICENSE +0 -0
- {janus_llm-3.5.2.dist-info → janus_llm-4.0.0.dist-info}/WHEEL +0 -0
- {janus_llm-3.5.2.dist-info → janus_llm-4.0.0.dist-info}/entry_points.txt +0 -0
@@ -1,19 +1,19 @@
|
|
1
|
-
janus/__init__.py,sha256=
|
1
|
+
janus/__init__.py,sha256=gL7W9Io7zembI938nQAbVjAY107vRS0acvWfDDrEVyg,361
|
2
2
|
janus/__main__.py,sha256=lEkpNtLVPtFo8ySDZeXJ_NXDHb0GVdZFPWB4gD4RPS8,64
|
3
3
|
janus/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
janus/_tests/conftest.py,sha256=V7uW-oq3YbFiRPvrq15YoVVrA1n_83pjgiyTZ-IUGW8,963
|
5
5
|
janus/_tests/test_cli.py,sha256=6ef7h11bg4i7Q6L1-r0ZdcY7YrH4n472kvDiA03T4c8,4275
|
6
|
-
janus/cli.py,sha256=
|
6
|
+
janus/cli.py,sha256=lX8GzLOXan8nqjy_dx-3EF4qaLOVTsyDqp0OLBZctw0,38177
|
7
7
|
janus/converter/__init__.py,sha256=U2EOMcCykiC0ZqhorNefOP_04hOF18qhYoPKrVp1Vrk,345
|
8
8
|
janus/converter/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
janus/converter/_tests/test_translate.py,sha256=yzcFEGc_z8QmBBBmC9dZnfL9tT8CD1rkpc8Hz44Jp4c,5631
|
10
10
|
janus/converter/aggregator.py,sha256=MuAXMKmq6PuUo_w6ljyiuDn81Gk2dN-Ci7FVeLc6vhs,1966
|
11
|
-
janus/converter/converter.py,sha256=
|
12
|
-
janus/converter/diagram.py,sha256
|
11
|
+
janus/converter/converter.py,sha256=HWw-a4j-Qq0AWDyyk6cMVOwYjJeXxa3bvs9OOlKo_KI,25965
|
12
|
+
janus/converter/diagram.py,sha256=-wktVBPrSBgNIQfHIfa2bJNg6L9CYJQgrr9-xU8DFPw,1646
|
13
13
|
janus/converter/document.py,sha256=qNt2UncMheUBadXCFHGq74tqCrvZub5DCgZpd3Qa54o,4564
|
14
14
|
janus/converter/evaluate.py,sha256=APWQUY3gjAXqkJkPzvj0UA4wPK3Cv9QSJLM-YK9t-ng,476
|
15
15
|
janus/converter/requirements.py,sha256=9tvQ40FZJtG8niIFn45gPQCgKKHVPPoFLinBv6RAqO4,2027
|
16
|
-
janus/converter/translate.py,sha256=
|
16
|
+
janus/converter/translate.py,sha256=S1DPZdmX9Vrn_sJPcobvXmhmS8U53yl5cRXjsmXPtas,4246
|
17
17
|
janus/embedding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
janus/embedding/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
janus/embedding/_tests/test_collections.py,sha256=llg-JSuRRFhKkHFiWWSHEWV3iaT6Lwue0lp2tEml9io,2668
|
@@ -29,36 +29,36 @@ janus/language/_tests/test_combine.py,sha256=sjVVPUg4LYkAmazXGUw_S1xPrzWm67_0tCx
|
|
29
29
|
janus/language/_tests/test_splitter.py,sha256=Hqexa39LLEXlK3ZUw7Zot4PUIACvye2vkq0Jaox0T10,373
|
30
30
|
janus/language/alc/__init__.py,sha256=j7vOMGhT1Vri6p8dsjSaY-fkO5uFn0sJ0nrNGGvcizM,42
|
31
31
|
janus/language/alc/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
|
-
janus/language/alc/_tests/test_alc.py,sha256=
|
33
|
-
janus/language/alc/alc.py,sha256=
|
32
|
+
janus/language/alc/_tests/test_alc.py,sha256=jrvZCsz3uvbq6pqTKmymWNDgb20HHs69tj9TRbx69aM,1018
|
33
|
+
janus/language/alc/alc.py,sha256=fKZDtbeLXiJ2e8t-eWSjeAW6WCMCTn2Fw7_jxvMPdNc,6863
|
34
34
|
janus/language/binary/__init__.py,sha256=AlNAe12ZA366kcGSrQ1FJyOdbwxFqGBFkYR2K6yL818,51
|
35
35
|
janus/language/binary/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
|
-
janus/language/binary/_tests/test_binary.py,sha256=
|
37
|
-
janus/language/binary/binary.py,sha256=
|
36
|
+
janus/language/binary/_tests/test_binary.py,sha256=cIKIxjj6kIY3rcxLwqUPESP9bxWrHqMHx9TNuICgfeQ,1724
|
37
|
+
janus/language/binary/binary.py,sha256=PHsVa8jcM7sW9aTboGRWXj6ewQznz0kVPNWtP4B9YPU,6555
|
38
38
|
janus/language/binary/reveng/decompile_script.py,sha256=veW51oJzuO-4UD3Er062jXZ_FYtTFo9OCkl82Z2xr6A,2182
|
39
39
|
janus/language/block.py,sha256=2rjAYUosHFfWRgLnzf50uAgTMST4Md9Kx6JrlUfEfX4,9398
|
40
40
|
janus/language/combine.py,sha256=Wtve06fa-_Wjv_V5RIf1Nfmg0UxcOEtFNj4vVHpSNbo,2940
|
41
41
|
janus/language/file.py,sha256=jy-cReAoI6F97TXR5bbhPyt8XyUZCdFYnVboubDA_y4,571
|
42
42
|
janus/language/mumps/__init__.py,sha256=-Ou_wJ-JgHezfp1dub2_qCYNiK9wO-zo2MlqxM9qiwE,48
|
43
43
|
janus/language/mumps/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
|
-
janus/language/mumps/_tests/test_mumps.py,sha256=
|
45
|
-
janus/language/mumps/mumps.py,sha256
|
44
|
+
janus/language/mumps/_tests/test_mumps.py,sha256=YxnQkobM9VR_Zow2oLaZxZs8bPipvbFWSza4zlWbMi8,1010
|
45
|
+
janus/language/mumps/mumps.py,sha256=-eyafFN9IeUQMU7yEsICJDrDb5tkYV_EydqFCjcuM_o,7381
|
46
46
|
janus/language/mumps/patterns.py,sha256=fLbgEnPYYggfqTnBwXf0XbnlU3g_bM4tsmO1YHYv5Jw,2313
|
47
47
|
janus/language/naive/__init__.py,sha256=_Gq4inONyVYxe8WLB59d_69kqGbtF40BGKoJPnK4tZ0,258
|
48
48
|
janus/language/naive/basic_splitter.py,sha256=RM9pJK2YkHfb6_EFEV-dh_rLqkjS6v0cn3ASPf8A6Fg,459
|
49
49
|
janus/language/naive/chunk_splitter.py,sha256=ebRSbaJhDW-Hyr5__ukbdmAl6kQ1WWFqrq_SfCgHo6k,772
|
50
50
|
janus/language/naive/registry.py,sha256=8YQX1q0IdAm7t69-oC_00I-vfkdRnHuX-OD3KEjEIuU,294
|
51
|
-
janus/language/naive/simple_ast.py,sha256=
|
51
|
+
janus/language/naive/simple_ast.py,sha256=YzeUJomVsnttJc8tI9eDROb2Hx9Vm9XKmOnLEp3TkzI,3112
|
52
52
|
janus/language/naive/tag_splitter.py,sha256=IXWMn9tBVUGAtzvQi89GhoZ6g7fPXk5MzO0kMCr2mb0,2045
|
53
53
|
janus/language/node.py,sha256=baoYFtapwBQqBtUN6EvHFYRkbR-EcEw1b3fQvH9zIAM,204
|
54
|
-
janus/language/splitter.py,sha256=
|
54
|
+
janus/language/splitter.py,sha256=pYvDhGAYDDP7E4CZeNn76I6zVnHMNj6gTFUegKXyRPk,17005
|
55
55
|
janus/language/treesitter/__init__.py,sha256=mUliw7ZJLZ8NkJKyUQMSoUV82hYXE0HvLHrEdGPJF4Q,43
|
56
56
|
janus/language/treesitter/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
57
|
-
janus/language/treesitter/_tests/test_treesitter.py,sha256=
|
58
|
-
janus/language/treesitter/treesitter.py,sha256=
|
57
|
+
janus/language/treesitter/_tests/test_treesitter.py,sha256=fmr_mFSja7vaCVu0TVyLDua3A94jMjY4AqSC5NqnOdQ,2179
|
58
|
+
janus/language/treesitter/treesitter.py,sha256=q7fqfFxt7QsqM6tE39uqutRMsOfEgBd3omv7zVZSEOc,7517
|
59
59
|
janus/llm/__init__.py,sha256=TKLYvnsWKWfxMucy-lCLQ-4bkN9ENotJZDywDEQmrKg,45
|
60
|
-
janus/llm/model_callbacks.py,sha256=
|
61
|
-
janus/llm/models_info.py,sha256=
|
60
|
+
janus/llm/model_callbacks.py,sha256=iaLsnHt2LcMgHPW4ouQdot9ahOHUOBCtydpVaag1Zak,7564
|
61
|
+
janus/llm/models_info.py,sha256=GxAr7iwjcvM7RWUe1I6AuOqiYA-Wnc4Mr8DEVBq91KA,9662
|
62
62
|
janus/metrics/__init__.py,sha256=AsxtZJUzZiXJPr2ehPPltuYP-ddechjg6X85WZUO7mA,241
|
63
63
|
janus/metrics/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
64
|
janus/metrics/_tests/reference.py,sha256=hiaJPP9CXkvFBV_wL-gOe_BzELTw0nvB6uCxhxtIiE8,13
|
@@ -77,7 +77,7 @@ janus/metrics/cli.py,sha256=Duuw2RF47Z-t1pal0cg3L_-N_91rx29krirqtIwjYLY,157
|
|
77
77
|
janus/metrics/complexity_metrics.py,sha256=9sHxa9tY9IgdFC4grCmDSuu8Nkphm_FWbTecxgW78go,6574
|
78
78
|
janus/metrics/file_pairing.py,sha256=b0848gbDTqKVge-uGiujtHdsgcbkpJ04nWF2ul_gbCw,3749
|
79
79
|
janus/metrics/llm_metrics.py,sha256=nzzJMSnoZfgtzzltjoCu1l4-Qwuycd-V3z17AtStYdY,5700
|
80
|
-
janus/metrics/metric.py,sha256=
|
80
|
+
janus/metrics/metric.py,sha256=ZQXz2LLXA3_WW6BluF8Q2LdJKYVWZLYmhO4Ai116ZPY,17168
|
81
81
|
janus/metrics/reading.py,sha256=RyOSebENWPGD1m_-QfKM9v2vfNAQVkiZ2Oyynb2HrVI,3253
|
82
82
|
janus/metrics/rouge_score.py,sha256=XnA2ABAceIzzA_9rIYDaMtyD4pphHxXVwxaYvMcqZWE,2878
|
83
83
|
janus/metrics/similarity.py,sha256=NKd-m8hMB27i1_1CQkG5o7HrAK2wTr89B21Y36kqHiE,1630
|
@@ -89,12 +89,12 @@ janus/parsers/code_parser.py,sha256=3l0HfzgrvJuiwk779s9ZsgUl3xbp1nE1qZxh8aDYRBI,
|
|
89
89
|
janus/parsers/doc_parser.py,sha256=0pUsNZ9hKQLjIi8L8BgkOBHQZ_EGoFLHrBQ4hoDkjSw,5862
|
90
90
|
janus/parsers/eval_parser.py,sha256=Gjh6aTZgpYd2ASJUEPMo4LpCL00cBmbOqc4KM3hy8x8,2922
|
91
91
|
janus/parsers/parser.py,sha256=y6VV64bgVidf-oEFla3I--_28tnJsPBc6QUD_SkbfSE,1614
|
92
|
-
janus/parsers/refiner_parser.py,sha256=W7ecDX7j6N-uWtRBYFD1EiEzDpDQws16nrVFzyArzf8,1632
|
93
92
|
janus/parsers/reqs_parser.py,sha256=uRQC41Iqp22GjIvakb5UKv70UWHkcOTbOVl_RDnipYw,2438
|
94
|
-
janus/parsers/uml.py,sha256=
|
93
|
+
janus/parsers/uml.py,sha256=SwaoG9QrHKQP8rSxlf3qu_rp7OMQqYSmLgDYBapOa9M,3379
|
95
94
|
janus/prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
96
95
|
janus/prompts/prompt.py,sha256=3796YXIzzIec9b0iUzd8VZlq-AdQbzq8qUGXLy4KH-0,10586
|
97
|
-
janus/refiners/refiner.py,sha256=
|
96
|
+
janus/refiners/refiner.py,sha256=lKAVS9Nszx8aO7hLB0xzdMmUNfhX7K5SaXwcit2QBHs,3774
|
97
|
+
janus/retrievers/retriever.py,sha256=WzsYn329GbyJfmJ9KyU9yiYdhLkuS6WPKTKoHx5fBYQ,1339
|
98
98
|
janus/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
99
99
|
janus/utils/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
100
100
|
janus/utils/_tests/test_logger.py,sha256=jkkvrCTKwsFCsZtmyuvc-WJ0rC7LJi2Z91sIe4IiKzA,2209
|
@@ -102,8 +102,8 @@ janus/utils/_tests/test_progress.py,sha256=Rs_u5PiGjP-L-o6C1fhwfE1ig8jYu9Xo9s4p8
|
|
102
102
|
janus/utils/enums.py,sha256=AoilbdiYyMvY2Mp0AM4xlbLSELfut2XMwhIM1S_msP4,27610
|
103
103
|
janus/utils/logger.py,sha256=KZeuaMAnlSZCsj4yL0P6N-JzZwpxXygzACWfdZFeuek,2337
|
104
104
|
janus/utils/progress.py,sha256=PIpcQec7SrhsfqB25LHj2CDDkfm9umZx90d9LZnAx6k,1469
|
105
|
-
janus_llm-
|
106
|
-
janus_llm-
|
107
|
-
janus_llm-
|
108
|
-
janus_llm-
|
109
|
-
janus_llm-
|
105
|
+
janus_llm-4.0.0.dist-info/LICENSE,sha256=_j0st0a-HB6MRbP3_BW3PUqpS16v54luyy-1zVyl8NU,10789
|
106
|
+
janus_llm-4.0.0.dist-info/METADATA,sha256=LiMK2QiE9nzhufdK43eDYll_CbSThm2Wjit7bpG3XdE,4184
|
107
|
+
janus_llm-4.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
108
|
+
janus_llm-4.0.0.dist-info/entry_points.txt,sha256=OGhQwzj6pvXp79B0SaBD5apGekCu7Dwe9fZZT_TZ544,39
|
109
|
+
janus_llm-4.0.0.dist-info/RECORD,,
|
janus/parsers/refiner_parser.py
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
from langchain_core.exceptions import OutputParserException
|
2
|
-
from langchain_core.language_models import BaseLanguageModel
|
3
|
-
from langchain_core.messages import BaseMessage
|
4
|
-
from langchain_core.output_parsers import BaseOutputParser
|
5
|
-
|
6
|
-
from janus.parsers.parser import JanusParser
|
7
|
-
from janus.refiners.refiner import Refiner
|
8
|
-
|
9
|
-
|
10
|
-
class RefinerParser(JanusParser):
|
11
|
-
"""Parser for performing refinement with a refiner
|
12
|
-
|
13
|
-
Properties:
|
14
|
-
llm: the language model to use
|
15
|
-
parser: the parser to use for parsing llm output
|
16
|
-
initial_prompt: initial prompt used to generate output
|
17
|
-
refiner: refiner that gives new subsequent prompts
|
18
|
-
max_retires: maximum number of times to attempt refining
|
19
|
-
"""
|
20
|
-
|
21
|
-
class Config:
|
22
|
-
arbitrary_types_allowed = True
|
23
|
-
|
24
|
-
llm: BaseLanguageModel
|
25
|
-
parser: BaseOutputParser
|
26
|
-
initial_prompt: str
|
27
|
-
refiner: Refiner
|
28
|
-
max_retries: int
|
29
|
-
|
30
|
-
def parse(self, text: str | BaseMessage) -> str:
|
31
|
-
last_prompt = self.initial_prompt
|
32
|
-
for _ in range(self.max_retries):
|
33
|
-
try:
|
34
|
-
return self.parser.parse(text)
|
35
|
-
except OutputParserException as oe:
|
36
|
-
err = str(oe)
|
37
|
-
new_prompt, prompt_arguments = self.refiner.refine(
|
38
|
-
self.initial_prompt, last_prompt, text, err
|
39
|
-
)
|
40
|
-
new_chain = new_prompt | self.llm
|
41
|
-
text = new_chain.invoke(prompt_arguments)
|
42
|
-
last_prompt = new_prompt.format(**prompt_arguments)
|
43
|
-
|
44
|
-
raise OutputParserException(
|
45
|
-
f"Error: unable to correct output after {self.max_retries} attempts"
|
46
|
-
)
|
File without changes
|
File without changes
|
File without changes
|