npcpy 1.2.14__tar.gz → 1.2.15__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.
Files changed (59) hide show
  1. {npcpy-1.2.14/npcpy.egg-info → npcpy-1.2.15}/PKG-INFO +1 -1
  2. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/gen/response.py +6 -0
  3. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/llm_funcs.py +2 -0
  4. {npcpy-1.2.14 → npcpy-1.2.15/npcpy.egg-info}/PKG-INFO +1 -1
  5. {npcpy-1.2.14 → npcpy-1.2.15}/setup.py +1 -1
  6. {npcpy-1.2.14 → npcpy-1.2.15}/LICENSE +0 -0
  7. {npcpy-1.2.14 → npcpy-1.2.15}/MANIFEST.in +0 -0
  8. {npcpy-1.2.14 → npcpy-1.2.15}/README.md +0 -0
  9. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/__init__.py +0 -0
  10. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/__init__.py +0 -0
  11. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/audio.py +0 -0
  12. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/data_models.py +0 -0
  13. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/image.py +0 -0
  14. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/load.py +0 -0
  15. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/text.py +0 -0
  16. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/video.py +0 -0
  17. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/data/web.py +0 -0
  18. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/gen/__init__.py +0 -0
  19. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/gen/audio_gen.py +0 -0
  20. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/gen/embeddings.py +0 -0
  21. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/gen/image_gen.py +0 -0
  22. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/gen/video_gen.py +0 -0
  23. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/main.py +0 -0
  24. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/memory/__init__.py +0 -0
  25. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/memory/command_history.py +0 -0
  26. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/memory/kg_vis.py +0 -0
  27. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/memory/knowledge_graph.py +0 -0
  28. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/memory/search.py +0 -0
  29. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/mix/__init__.py +0 -0
  30. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/mix/debate.py +0 -0
  31. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/npc_compiler.py +0 -0
  32. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/npc_sysenv.py +0 -0
  33. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/npcs.py +0 -0
  34. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/serve.py +0 -0
  35. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/sql/__init__.py +0 -0
  36. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/sql/model_runner.py +0 -0
  37. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/sql/npcsql.py +0 -0
  38. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/tools.py +0 -0
  39. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/work/__init__.py +0 -0
  40. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/work/desktop.py +0 -0
  41. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/work/plan.py +0 -0
  42. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy/work/trigger.py +0 -0
  43. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy.egg-info/SOURCES.txt +0 -0
  44. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy.egg-info/dependency_links.txt +0 -0
  45. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy.egg-info/requires.txt +0 -0
  46. {npcpy-1.2.14 → npcpy-1.2.15}/npcpy.egg-info/top_level.txt +0 -0
  47. {npcpy-1.2.14 → npcpy-1.2.15}/setup.cfg +0 -0
  48. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_audio.py +0 -0
  49. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_command_history.py +0 -0
  50. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_image.py +0 -0
  51. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_llm_funcs.py +0 -0
  52. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_load.py +0 -0
  53. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_npc_compiler.py +0 -0
  54. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_npcsql.py +0 -0
  55. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_response.py +0 -0
  56. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_serve.py +0 -0
  57. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_text.py +0 -0
  58. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_tools.py +0 -0
  59. {npcpy-1.2.14 → npcpy-1.2.15}/tests/test_web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcpy
3
- Version: 1.2.14
3
+ Version: 1.2.15
4
4
  Summary: npcpy is the premier open-source library for integrating LLMs and Agents into python systems.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcpy
6
6
  Author: Christopher Agostino
@@ -14,6 +14,7 @@ except OSError:
14
14
 
15
15
  print("Ollama is not installed or not available. Please install it to use this feature.")
16
16
  try:
17
+ import litellm
17
18
  from litellm import completion
18
19
  except ImportError:
19
20
  pass
@@ -413,6 +414,7 @@ def get_litellm_response(
413
414
  stream: bool = False,
414
415
  attachments: List[str] = None,
415
416
  auto_process_tool_calls: bool = False,
417
+ include_usage: bool = False,
416
418
  **kwargs,
417
419
  ) -> Dict[str, Any]:
418
420
  result = {
@@ -547,6 +549,10 @@ def get_litellm_response(
547
549
 
548
550
  api_params = {"messages": result["messages"]}
549
551
 
552
+ if include_usage:
553
+ litellm.include_cost_in_streaming_usage = True
554
+ api_params['stream_options'] = {"include_usage": True}
555
+
550
556
  if api_url is not None and (provider == "openai-like" or provider == "openai"):
551
557
  api_params["api_base"] = api_url
552
558
  provider = "openai"
@@ -154,6 +154,7 @@ def get_llm_response(
154
154
  context=None,
155
155
  stream: bool = False,
156
156
  attachments: List[str] = None,
157
+ include_usage: bool = False,
157
158
  **kwargs,
158
159
  ):
159
160
  """This function generates a response using the specified provider and model.
@@ -231,6 +232,7 @@ def get_llm_response(
231
232
  images=images,
232
233
  attachments=attachments,
233
234
  stream=stream,
235
+ include_usage=include_usage,
234
236
  **kwargs,
235
237
  )
236
238
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcpy
3
- Version: 1.2.14
3
+ Version: 1.2.15
4
4
  Summary: npcpy is the premier open-source library for integrating LLMs and Agents into python systems.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcpy
6
6
  Author: Christopher Agostino
@@ -82,7 +82,7 @@ extra_files = package_files("npcpy/npc_team/")
82
82
 
83
83
  setup(
84
84
  name="npcpy",
85
- version="1.2.14",
85
+ version="1.2.15",
86
86
  packages=find_packages(exclude=["tests*"]),
87
87
  install_requires=base_requirements,
88
88
  extras_require={
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes