pilot.linkstec 0.0.93__py3-none-any.whl → 0.0.94__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/__init__.py +0 -0
- pilot/job/base/generate/generateJsonBaseJob.py +42 -0
- pilot/job/base/generate/generateTextBaseJob.py +40 -0
- pilot/unit/impl/base_unit.py +2 -1
- {pilot_linkstec-0.0.93.dist-info → pilot_linkstec-0.0.94.dist-info}/METADATA +1 -1
- {pilot_linkstec-0.0.93.dist-info → pilot_linkstec-0.0.94.dist-info}/RECORD +9 -6
- {pilot_linkstec-0.0.93.dist-info → pilot_linkstec-0.0.94.dist-info}/WHEEL +0 -0
- {pilot_linkstec-0.0.93.dist-info → pilot_linkstec-0.0.94.dist-info}/licenses/LICENSE +0 -0
- {pilot_linkstec-0.0.93.dist-info → pilot_linkstec-0.0.94.dist-info}/top_level.txt +0 -0
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import threading
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
from pilot.job.impl.base_job import BaseJob
|
|
7
|
+
|
|
8
|
+
from pilot.generater.vertexai import VertexAISingleton
|
|
9
|
+
|
|
10
|
+
class generateJsonBaseJob(BaseJob):
|
|
11
|
+
|
|
12
|
+
prompt_content: str
|
|
13
|
+
result_content: str
|
|
14
|
+
result_file_path: str
|
|
15
|
+
|
|
16
|
+
def run(self):
|
|
17
|
+
#with self._begin_file_lock:
|
|
18
|
+
# if not self.change_current_trg_to_begin():
|
|
19
|
+
# return
|
|
20
|
+
#prompt = self.get_file_content()
|
|
21
|
+
prompt = self.prompt_content
|
|
22
|
+
# トークン数チェック
|
|
23
|
+
vertexai = VertexAISingleton.get_instance()
|
|
24
|
+
token_count = vertexai.count_tokens(prompt)
|
|
25
|
+
if token_count == 0:
|
|
26
|
+
super().run()
|
|
27
|
+
return
|
|
28
|
+
if token_count > 900000:
|
|
29
|
+
print(f"警告: promptのトークン数が900000を超えています ({token_count} tokens)")
|
|
30
|
+
super().run()
|
|
31
|
+
return
|
|
32
|
+
# VertexAI で生成
|
|
33
|
+
start = time.time()
|
|
34
|
+
result = vertexai.generate_content(prompt)
|
|
35
|
+
end = time.time()
|
|
36
|
+
print(f"Ai 処理時間 {self.file_path}: {end - start:.2f}秒")
|
|
37
|
+
|
|
38
|
+
result_content = result.get('response', '')
|
|
39
|
+
data = json.loads(result_content)
|
|
40
|
+
with open(self.result_file_path, 'w', encoding='utf-8') as f:
|
|
41
|
+
json.dump(data, f, ensure_ascii=False, indent=2)
|
|
42
|
+
super().run()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import threading
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
from pilot.job.impl.base_job import BaseJob
|
|
7
|
+
|
|
8
|
+
from pilot.generater.vertexai import VertexAISingleton
|
|
9
|
+
|
|
10
|
+
class textBaseJob(BaseJob):
|
|
11
|
+
|
|
12
|
+
prompt_content: str
|
|
13
|
+
result_content: str
|
|
14
|
+
result_file_path: str
|
|
15
|
+
|
|
16
|
+
def run(self):
|
|
17
|
+
#with self._begin_file_lock:
|
|
18
|
+
# if not self.change_current_trg_to_begin():
|
|
19
|
+
# return
|
|
20
|
+
#prompt = self.get_file_content()
|
|
21
|
+
prompt = self.prompt_content
|
|
22
|
+
# トークン数チェック
|
|
23
|
+
vertexai = VertexAISingleton.get_instance()
|
|
24
|
+
token_count = vertexai.count_tokens(prompt)
|
|
25
|
+
if token_count == 0:
|
|
26
|
+
super().run()
|
|
27
|
+
return
|
|
28
|
+
if token_count > 900000:
|
|
29
|
+
print(f"警告: promptのトークン数が900000を超えています ({token_count} tokens)")
|
|
30
|
+
super().run()
|
|
31
|
+
return
|
|
32
|
+
# VertexAI で生成
|
|
33
|
+
start = time.time()
|
|
34
|
+
result = vertexai.generate_content(prompt)
|
|
35
|
+
end = time.time()
|
|
36
|
+
print(f"AI 処理時間 {self.file_path}: {end - start:.2f}秒")
|
|
37
|
+
result_content = result.get('response', '')
|
|
38
|
+
with open(self.result_file_path, 'w', encoding='utf-8') as f:
|
|
39
|
+
f.write(result_content)
|
|
40
|
+
super().run()
|
pilot/unit/impl/base_unit.py
CHANGED
|
@@ -49,6 +49,9 @@ pilot/job/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
49
49
|
pilot/job/base/convert/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
50
|
pilot/job/base/convert/encodingTransformerJob.py,sha256=tJI2JcBK3869pIgJxf9WFa7D-wCnHHO1aU8vQo7qjds,457
|
|
51
51
|
pilot/job/base/convert/tabReplaceJob.py,sha256=ev5uoPbiwhVCSDPdonvFDnWI-vi4R-4Adoa4eJddL9w,917
|
|
52
|
+
pilot/job/base/generate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
+
pilot/job/base/generate/generateJsonBaseJob.py,sha256=5klyS0tj9YTAcLVldcxUe1GXnWYXsQhvpcB7bRjq_n4,1377
|
|
54
|
+
pilot/job/base/generate/generateTextBaseJob.py,sha256=yJVzeM_87T_lqo3x39j9Mi4IuKwGj_Ww3bxXUuY_F6o,1299
|
|
52
55
|
pilot/job/base/generater/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
56
|
pilot/job/base/generater/generateJsonBaseJob.py,sha256=Nea0GUvILgYyBiFpMOb3ZctYlxbE0pwGeJfeEWFjveQ,1348
|
|
54
57
|
pilot/job/base/generater/generateTextBaseJob.py,sha256=UCEkoDGN9qdHPSXrP_zpFDOpHtfjse1SskMuS31uOwk,1265
|
|
@@ -68,11 +71,11 @@ pilot/splitters/cobolsplitter.py,sha256=oPwxKRjA7TyXWaWV3jdy59lJZy1mRn6yxD9ivqFY
|
|
|
68
71
|
pilot/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
72
|
pilot/unit/unit_interface.py,sha256=fE8N4h_rZU-dWLHy9o0EE3yyErGmRyIuGUDb-zqe7qo,167
|
|
70
73
|
pilot/unit/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
-
pilot/unit/impl/base_unit.py,sha256=
|
|
74
|
+
pilot/unit/impl/base_unit.py,sha256=UV-RsCrSAknO6a2yZAQA0vD8Uo9yqJsNCXC5e8yZE6A,1348
|
|
72
75
|
pilot/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
76
|
pilot/util/files.py,sha256=v9uzfzo3Aq4xgnUIASEZeBJoA2nD9Qz_EA3P-FwzGFQ,1896
|
|
74
|
-
pilot_linkstec-0.0.
|
|
75
|
-
pilot_linkstec-0.0.
|
|
76
|
-
pilot_linkstec-0.0.
|
|
77
|
-
pilot_linkstec-0.0.
|
|
78
|
-
pilot_linkstec-0.0.
|
|
77
|
+
pilot_linkstec-0.0.94.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
|
78
|
+
pilot_linkstec-0.0.94.dist-info/METADATA,sha256=14rmXXR-afQoozUrbiOtP-qihKBQK3rSvLLEtWoCEic,679
|
|
79
|
+
pilot_linkstec-0.0.94.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
80
|
+
pilot_linkstec-0.0.94.dist-info/top_level.txt,sha256=BijnVJdXnIPxxx3s60M848seL4Z12gNUPod6KPJxK9c,6
|
|
81
|
+
pilot_linkstec-0.0.94.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|