pro-craft 0.1.26__tar.gz → 0.1.27__tar.gz

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.

Potentially problematic release.


This version of pro-craft might be problematic. Click here for more details.

Files changed (27) hide show
  1. {pro_craft-0.1.26 → pro_craft-0.1.27}/PKG-INFO +1 -1
  2. {pro_craft-0.1.26 → pro_craft-0.1.27}/pyproject.toml +1 -1
  3. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/prompt_craft/async_.py +19 -6
  4. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft.egg-info/PKG-INFO +1 -1
  5. {pro_craft-0.1.26 → pro_craft-0.1.27}/README.md +0 -0
  6. {pro_craft-0.1.26 → pro_craft-0.1.27}/setup.cfg +0 -0
  7. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/__init__.py +0 -0
  8. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/code_helper/coder.py +0 -0
  9. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/code_helper/designer.py +0 -0
  10. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/database.py +0 -0
  11. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/file_manager.py +0 -0
  12. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/log.py +0 -0
  13. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/prompt_craft/__init__.py +0 -0
  14. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/prompt_craft/new.py +0 -0
  15. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/prompt_craft/sync.py +0 -0
  16. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/server/mcp/__init__.py +0 -0
  17. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/server/mcp/prompt.py +0 -0
  18. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/server/router/__init__.py +0 -0
  19. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/server/router/prompt.py +0 -0
  20. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft/utils.py +0 -0
  21. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft.egg-info/SOURCES.txt +0 -0
  22. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft.egg-info/dependency_links.txt +0 -0
  23. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft.egg-info/requires.txt +0 -0
  24. {pro_craft-0.1.26 → pro_craft-0.1.27}/src/pro_craft.egg-info/top_level.txt +0 -0
  25. {pro_craft-0.1.26 → pro_craft-0.1.27}/tests/test22.py +0 -0
  26. {pro_craft-0.1.26 → pro_craft-0.1.27}/tests/test_coder.py +0 -0
  27. {pro_craft-0.1.26 → pro_craft-0.1.27}/tests/test_designer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pro-craft
3
- Version: 0.1.26
3
+ Version: 0.1.27
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pro-craft"
3
- version = "0.1.26"
3
+ version = "0.1.27"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -159,7 +159,7 @@ class AsyncIntel():
159
159
  pool_pre_ping=True, # 使用前检查连接活性
160
160
  pool_timeout=30 # 等待连接池中连接的最长时间(秒)
161
161
  )
162
-
162
+ self.create_specific_database(self.engine,["ai_prompts","ai_usecase"])
163
163
 
164
164
  if model_name in ["gemini-2.5-flash-preview-05-20-nothinking",]:
165
165
  self.llm = BianXieAdapter(model_name = model_name)
@@ -169,8 +169,23 @@ class AsyncIntel():
169
169
  print('Use BianXieAdapter')
170
170
  self.llm = BianXieAdapter()
171
171
 
172
- async def create_database(self):
173
- async with self.engine.begin() as conn:
172
+ async def create_specific_database(self,engine, tables_to_create_names: list[str]):
173
+ async with engine.begin() as conn:
174
+ # 从 metadata 中获取对应的 Table 对象
175
+ specific_database_objects = []
176
+ for table_name in tables_to_create_names:
177
+ if table_name in PromptBase.metadata.tables:
178
+ specific_database_objects.append(PromptBase.metadata.tables[table_name])
179
+ else:
180
+ print(f"Warning: Table '{table_name}' not found in metadata.")
181
+
182
+ if specific_database_objects:
183
+ await conn.run_sync(PromptBase.metadata.create_all, tables=specific_database_objects)
184
+ else:
185
+ print("No specific tables to create.")
186
+
187
+ async def create_database(self,engine):
188
+ async with engine.begin() as conn:
174
189
  await conn.run_sync(PromptBase.metadata.create_all)
175
190
 
176
191
  async def _get_latest_prompt_version(self,target_prompt_id,session):
@@ -218,9 +233,7 @@ class AsyncIntel():
218
233
 
219
234
  async def sync_prompt_data_to_database(self,database_url:str):
220
235
  target_engine = create_async_engine(database_url, echo=False)
221
- async with target_engine.begin() as conn:
222
- await conn.run_sync(PromptBase.metadata.create_all)
223
-
236
+ await self.create_database(target_engine)
224
237
  async with create_async_session(self.engine) as source_session:
225
238
  async with create_async_session(target_engine) as target_session:
226
239
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pro-craft
3
- Version: 0.1.26
3
+ Version: 0.1.27
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
File without changes
File without changes
File without changes