pilot.linkstec 0.0.109__py3-none-any.whl → 0.0.111__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.
- pilot/job/base/generate/generatePromptBaseJob.py +23 -0
- pilot/job/base/generate/generateTextBaseJob.py +6 -0
- pilot/job/impl/base_job.py +1 -1
- {pilot_linkstec-0.0.109.dist-info → pilot_linkstec-0.0.111.dist-info}/METADATA +1 -1
- {pilot_linkstec-0.0.109.dist-info → pilot_linkstec-0.0.111.dist-info}/RECORD +8 -7
- {pilot_linkstec-0.0.109.dist-info → pilot_linkstec-0.0.111.dist-info}/WHEEL +0 -0
- {pilot_linkstec-0.0.109.dist-info → pilot_linkstec-0.0.111.dist-info}/licenses/LICENSE +0 -0
- {pilot_linkstec-0.0.109.dist-info → pilot_linkstec-0.0.111.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from pilot.file_tool.create_prompt_file import process_file
|
|
5
|
+
from pilot.job.impl.base_job import BaseJob
|
|
6
|
+
|
|
7
|
+
class GeneratePromptBaseJob(BaseJob):
|
|
8
|
+
prompt_file_path: str = None
|
|
9
|
+
template_file_path:list = []
|
|
10
|
+
prompt_content: str
|
|
11
|
+
result_content: str
|
|
12
|
+
result_file_path: str
|
|
13
|
+
replace_map = {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def run(self):
|
|
17
|
+
if self.prompt_file_path is None:
|
|
18
|
+
self.prompt_file_path = self.change_extension_pathlib(self.file_path, 'prompt')
|
|
19
|
+
cwd = os.getcwd()
|
|
20
|
+
self.template_file_path.insert(0, cwd)
|
|
21
|
+
template = os.path.join(*self.template_file_path)
|
|
22
|
+
process_file(template, self.prompt_file_path, self.replace_map)
|
|
23
|
+
super().run()
|
|
@@ -12,9 +12,14 @@ class GenerateTextBaseJob(BaseJob):
|
|
|
12
12
|
prompt_content: str
|
|
13
13
|
result_content: str
|
|
14
14
|
result_file_path: str
|
|
15
|
+
result_extension = '.md'
|
|
15
16
|
|
|
16
17
|
def run(self):
|
|
17
18
|
prompt = self.prompt_content
|
|
19
|
+
if prompt is None or prompt == '':
|
|
20
|
+
prompt = self.get_file_content()
|
|
21
|
+
if self.result_file_path is None:
|
|
22
|
+
self.result_file_path = self.change_extension_pathlib(self.file_path, self.result_extension)
|
|
18
23
|
# トークン数チェック
|
|
19
24
|
vera_ai = VeraSingleton.get_instance()
|
|
20
25
|
#token_count = vertexai.count_tokens(prompt)
|
|
@@ -31,6 +36,7 @@ class GenerateTextBaseJob(BaseJob):
|
|
|
31
36
|
end = time.time()
|
|
32
37
|
print(f"AI 処理時間 {self.file_path}: {end - start:.2f}秒")
|
|
33
38
|
result_content = result.get('response', '')
|
|
39
|
+
|
|
34
40
|
with open(self.result_file_path, 'w', encoding='utf-8') as f:
|
|
35
41
|
f.write(result_content)
|
|
36
42
|
super().run()
|
pilot/job/impl/base_job.py
CHANGED
|
@@ -369,7 +369,7 @@ class BaseJob(JobInterface):
|
|
|
369
369
|
return os.path.splitext(os.path.basename(file_name))[0]
|
|
370
370
|
|
|
371
371
|
|
|
372
|
-
def change_extension_pathlib(file_path: str, new_ext: str) -> str:
|
|
372
|
+
def change_extension_pathlib(self,file_path: str, new_ext: str) -> str:
|
|
373
373
|
p = Path(file_path)
|
|
374
374
|
new_path = p.with_suffix(new_ext) # 例: ".csv"
|
|
375
375
|
p.rename(new_path)
|
|
@@ -57,7 +57,8 @@ pilot/job/base/convert/encodingTransformerJob.py,sha256=P6txCqAcQ4w999ttA_gmA4VK
|
|
|
57
57
|
pilot/job/base/convert/tabReplaceJob.py,sha256=FtPLbWwDPgH1jGsK3y5_sY4lAZ4Lhsv7GQ-1A-QgAFE,743
|
|
58
58
|
pilot/job/base/generate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
59
|
pilot/job/base/generate/generateJsonBaseJob.py,sha256=0sWNqvfV-1DgsNjyD_GUBHogjQPNRdcqx0siNNFnSsE,1208
|
|
60
|
-
pilot/job/base/generate/
|
|
60
|
+
pilot/job/base/generate/generatePromptBaseJob.py,sha256=Z-DmeNW4vc2M7HOJMqsqAq_Vfv7xZLjREM4IvLSKKdc,733
|
|
61
|
+
pilot/job/base/generate/generateTextBaseJob.py,sha256=ce1Wr9r9cG2o4sl9mQLCDo8qVVfJ2mSkFocohZR_XZw,1409
|
|
61
62
|
pilot/job/base/program/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
63
|
pilot/job/base/program/cobol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
64
|
pilot/job/base/program/cobol/convert/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -65,7 +66,7 @@ pilot/job/base/program/cobol/convert/spitPreDigit.py,sha256=uGmIKOSaxNmPkzy45i0w
|
|
|
65
66
|
pilot/job/base/program/java/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
67
|
pilot/job/base/program/java/generateDetailDesignPrompt.py,sha256=JcXxRQeJPpFNhli1nWOOxh8ZTdp_IN3-OoFQahHprjs,5651
|
|
67
68
|
pilot/job/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
pilot/job/impl/base_job.py,sha256=
|
|
69
|
+
pilot/job/impl/base_job.py,sha256=cCPr0q7GLEDYOvVyXA1HT7MXpLW8evX4x9NyHcmyAuw,15312
|
|
69
70
|
pilot/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
71
|
pilot/logging/logger.py,sha256=TF7eGr3w8GK5v4sf71lDt97uVoBtCgqrZuCdbMmeQBU,1815
|
|
71
72
|
pilot/prompt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -77,8 +78,8 @@ pilot/unit/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
77
78
|
pilot/unit/impl/base_unit.py,sha256=h6PMtd4ja0wa6mttFeI7rsv92yy96UgfLIU0QSs6Dmk,2108
|
|
78
79
|
pilot/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
80
|
pilot/util/files.py,sha256=v9uzfzo3Aq4xgnUIASEZeBJoA2nD9Qz_EA3P-FwzGFQ,1896
|
|
80
|
-
pilot_linkstec-0.0.
|
|
81
|
-
pilot_linkstec-0.0.
|
|
82
|
-
pilot_linkstec-0.0.
|
|
83
|
-
pilot_linkstec-0.0.
|
|
84
|
-
pilot_linkstec-0.0.
|
|
81
|
+
pilot_linkstec-0.0.111.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
|
82
|
+
pilot_linkstec-0.0.111.dist-info/METADATA,sha256=QohDGlAmDFL7TNQHBBLi7Wa5M-4VU56GVzoYTxAvxgY,680
|
|
83
|
+
pilot_linkstec-0.0.111.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
84
|
+
pilot_linkstec-0.0.111.dist-info/top_level.txt,sha256=BijnVJdXnIPxxx3s60M848seL4Z12gNUPod6KPJxK9c,6
|
|
85
|
+
pilot_linkstec-0.0.111.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|