npcpy 1.1.28__py3-none-any.whl → 1.2.32__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.
Files changed (44) hide show
  1. npcpy/data/audio.py +16 -38
  2. npcpy/data/image.py +29 -29
  3. npcpy/data/load.py +4 -3
  4. npcpy/data/text.py +28 -28
  5. npcpy/data/video.py +6 -6
  6. npcpy/data/web.py +49 -21
  7. npcpy/ft/__init__.py +0 -0
  8. npcpy/ft/diff.py +110 -0
  9. npcpy/ft/ge.py +115 -0
  10. npcpy/ft/memory_trainer.py +171 -0
  11. npcpy/ft/model_ensembler.py +357 -0
  12. npcpy/ft/rl.py +360 -0
  13. npcpy/ft/sft.py +248 -0
  14. npcpy/ft/usft.py +128 -0
  15. npcpy/gen/audio_gen.py +24 -0
  16. npcpy/gen/embeddings.py +13 -13
  17. npcpy/gen/image_gen.py +37 -15
  18. npcpy/gen/response.py +287 -111
  19. npcpy/gen/video_gen.py +10 -9
  20. npcpy/llm_funcs.py +447 -79
  21. npcpy/memory/command_history.py +201 -48
  22. npcpy/memory/kg_vis.py +74 -74
  23. npcpy/memory/knowledge_graph.py +482 -115
  24. npcpy/memory/memory_processor.py +81 -0
  25. npcpy/memory/search.py +70 -70
  26. npcpy/mix/debate.py +192 -3
  27. npcpy/npc_compiler.py +1541 -879
  28. npcpy/npc_sysenv.py +250 -78
  29. npcpy/serve.py +1036 -321
  30. npcpy/sql/ai_function_tools.py +257 -0
  31. npcpy/sql/database_ai_adapters.py +186 -0
  32. npcpy/sql/database_ai_functions.py +163 -0
  33. npcpy/sql/model_runner.py +19 -19
  34. npcpy/sql/npcsql.py +706 -507
  35. npcpy/sql/sql_model_compiler.py +156 -0
  36. npcpy/tools.py +20 -20
  37. npcpy/work/plan.py +8 -8
  38. npcpy/work/trigger.py +3 -3
  39. {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/METADATA +169 -9
  40. npcpy-1.2.32.dist-info/RECORD +54 -0
  41. npcpy-1.1.28.dist-info/RECORD +0 -40
  42. {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/WHEEL +0 -0
  43. {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/licenses/LICENSE +0 -0
  44. {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/top_level.txt +0 -0
npcpy/gen/video_gen.py CHANGED
@@ -16,7 +16,7 @@ def generate_video_diffusers(
16
16
  import os
17
17
  import cv2
18
18
 
19
- # Load pipeline
19
+
20
20
  pipe = DiffusionPipeline.from_pretrained(
21
21
  "damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float32
22
22
  ).to(device)
@@ -32,7 +32,7 @@ def generate_video_diffusers(
32
32
 
33
33
  def save_frames_to_video(frames, output_path, fps=8):
34
34
  """Handle the specific 5D array format (1, num_frames, H, W, 3) with proper type conversion"""
35
- # Verify input format
35
+
36
36
  if not (
37
37
  isinstance(frames, np.ndarray)
38
38
  and frames.ndim == 5
@@ -42,20 +42,20 @@ def generate_video_diffusers(
42
42
  f"Unexpected frame format. Expected 5D RGB array, got {frames.shape}"
43
43
  )
44
44
 
45
- # Remove batch dimension and convert to 0-255 uint8
46
- frames = (frames[0] * 255).astype(np.uint8) # Shape: (num_frames, H, W, 3)
45
+
46
+ frames = (frames[0] * 255).astype(np.uint8)
47
47
 
48
- # Get video dimensions
48
+
49
49
  height, width = frames.shape[1:3]
50
50
 
51
- # Create video writer
51
+
52
52
  fourcc = cv2.VideoWriter_fourcc(*"mp4v")
53
53
  video_writer = cv2.VideoWriter(output_path, fourcc, fps, (width, height))
54
54
 
55
55
  if not video_writer.isOpened():
56
56
  raise IOError(f"Could not open video writer for {output_path}")
57
57
 
58
- # Write frames (convert RGB to BGR for OpenCV)
58
+
59
59
  for frame in frames:
60
60
  video_writer.write(cv2.cvtColor(frame, cv2.COLOR_RGB2BGR))
61
61
 
@@ -71,9 +71,10 @@ def generate_video_diffusers(
71
71
 
72
72
 
73
73
 
74
- # In video_gen.py
74
+
75
75
  def generate_video_veo3(
76
76
  prompt: str,
77
+ model: str,
77
78
  negative_prompt: str = "",
78
79
  output_path: str = "",
79
80
  ):
@@ -93,7 +94,7 @@ def generate_video_veo3(
93
94
  config.negative_prompt = negative_prompt
94
95
 
95
96
  operation = client.models.generate_videos(
96
- model="veo-3.0-generate-preview",
97
+ model=model,
97
98
  prompt=prompt,
98
99
  config=config,
99
100
  )