unique_toolkit 1.38.4__tar.gz → 1.39.0__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 (220) hide show
  1. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/CHANGELOG.md +3 -0
  2. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/PKG-INFO +25 -20
  3. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/README.md +22 -20
  4. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/pyproject.toml +1 -1
  5. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/schemas.py +15 -7
  6. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/services/chat_service.py +409 -1
  7. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/short_term_memory/functions.py +126 -4
  8. unique_toolkit-1.39.0/unique_toolkit/short_term_memory/schemas.py +54 -0
  9. unique_toolkit-1.38.4/unique_toolkit/short_term_memory/schemas.py +0 -49
  10. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/LICENSE +0 -0
  11. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/__init__.py +0 -0
  12. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/_base_service.py +0 -0
  13. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/_time_utils.py +0 -0
  14. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/api_calling/human_verification_manager.py +0 -0
  15. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/base_model_type_attribute.py +0 -0
  16. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/chunk_relevancy_sorter/config.py +0 -0
  17. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/chunk_relevancy_sorter/exception.py +0 -0
  18. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/chunk_relevancy_sorter/schemas.py +0 -0
  19. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/chunk_relevancy_sorter/service.py +0 -0
  20. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/chunk_relevancy_sorter/tests/test_service.py +0 -0
  21. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/default_language_model.py +0 -0
  22. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/docx_generator/__init__.py +0 -0
  23. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/docx_generator/config.py +0 -0
  24. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/docx_generator/schemas.py +0 -0
  25. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/docx_generator/service.py +0 -0
  26. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/docx_generator/template/Doc Template.docx +0 -0
  27. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/endpoint_builder.py +0 -0
  28. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/endpoint_requestor.py +0 -0
  29. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/exception.py +0 -0
  30. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/execution.py +0 -0
  31. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/experimental/endpoint_builder.py +0 -0
  32. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/experimental/endpoint_requestor.py +0 -0
  33. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/feature_flags/schema.py +0 -0
  34. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/pydantic/rjsf_tags.py +0 -0
  35. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/pydantic_helpers.py +0 -0
  36. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/referencing.py +0 -0
  37. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/string_utilities.py +0 -0
  38. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/tests/test_referencing.py +0 -0
  39. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/tests/test_string_utilities.py +0 -0
  40. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/token/image_token_counting.py +0 -0
  41. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/token/token_counting.py +0 -0
  42. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/__init__.py +0 -0
  43. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/files.py +0 -0
  44. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/image/encode.py +0 -0
  45. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/jinja/helpers.py +0 -0
  46. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/jinja/render.py +0 -0
  47. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/jinja/schema.py +0 -0
  48. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/jinja/utils.py +0 -0
  49. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/structured_output/__init__.py +0 -0
  50. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/structured_output/schema.py +0 -0
  51. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/utils/write_configuration.py +0 -0
  52. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/validate_required_values.py +0 -0
  53. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/_common/validators.py +0 -0
  54. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/__init__.py +0 -0
  55. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/debug_info_manager/debug_info_manager.py +0 -0
  56. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/debug_info_manager/test/test_debug_info_manager.py +0 -0
  57. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/config.py +0 -0
  58. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/context_relevancy/prompts.py +0 -0
  59. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/context_relevancy/schema.py +0 -0
  60. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/context_relevancy/service.py +0 -0
  61. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/evaluation_manager.py +0 -0
  62. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/exception.py +0 -0
  63. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/hallucination/constants.py +0 -0
  64. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/hallucination/hallucination_evaluation.py +0 -0
  65. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/hallucination/prompts.py +0 -0
  66. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/hallucination/service.py +0 -0
  67. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/hallucination/utils.py +0 -0
  68. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/output_parser.py +0 -0
  69. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/schemas.py +0 -0
  70. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/tests/test_context_relevancy_service.py +0 -0
  71. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/evaluation/tests/test_output_parser.py +0 -0
  72. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/history_manager/history_construction_with_contents.py +0 -0
  73. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/history_manager/history_manager.py +0 -0
  74. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/history_manager/loop_token_reducer.py +0 -0
  75. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/history_manager/utils.py +0 -0
  76. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/__init__.py +0 -0
  77. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/_iteration_handler_utils.py +0 -0
  78. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/_stream_handler_utils.py +0 -0
  79. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/base.py +0 -0
  80. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/middleware/__init__.py +0 -0
  81. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/middleware/planning/__init__.py +0 -0
  82. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/middleware/planning/planning.py +0 -0
  83. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/middleware/planning/schema.py +0 -0
  84. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/runners/__init__.py +0 -0
  85. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/runners/basic.py +0 -0
  86. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/runners/qwen/__init__.py +0 -0
  87. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/runners/qwen/helpers.py +0 -0
  88. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/loop_runner/runners/qwen/qwen_runner.py +0 -0
  89. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/message_log_manager/__init__.py +0 -0
  90. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/message_log_manager/service.py +0 -0
  91. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/postprocessor/postprocessor_manager.py +0 -0
  92. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/reference_manager/reference_manager.py +0 -0
  93. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/responses_api/__init__.py +0 -0
  94. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/responses_api/postprocessors/code_display.py +0 -0
  95. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/responses_api/postprocessors/generated_files.py +0 -0
  96. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/responses_api/stream_handler.py +0 -0
  97. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/short_term_memory_manager/persistent_short_term_memory_manager.py +0 -0
  98. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/thinking_manager/thinking_manager.py +0 -0
  99. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/__init__.py +0 -0
  100. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/__init__.py +0 -0
  101. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/config.py +0 -0
  102. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/evaluation/__init__.py +0 -0
  103. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/evaluation/_utils.py +0 -0
  104. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/evaluation/config.py +0 -0
  105. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/evaluation/evaluator.py +0 -0
  106. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/evaluation/summarization_user_message.j2 +0 -0
  107. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/manager.py +0 -0
  108. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/__init__.py +0 -0
  109. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/_display_utils.py +0 -0
  110. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/_ref_utils.py +0 -0
  111. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/config.py +0 -0
  112. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/display.py +0 -0
  113. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/references.py +0 -0
  114. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/test/test_display.py +0 -0
  115. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/test/test_display_utils.py +0 -0
  116. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/postprocessing/test/test_ref_utils.py +0 -0
  117. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/prompts.py +0 -0
  118. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/response_watcher/__init__.py +0 -0
  119. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/response_watcher/service.py +0 -0
  120. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/tool/__init__.py +0 -0
  121. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/tool/_memory.py +0 -0
  122. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/tool/_schema.py +0 -0
  123. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/tool/config.py +0 -0
  124. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/tool/service.py +0 -0
  125. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/a2a/tool/test/test_service_utils.py +0 -0
  126. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/agent_chunks_hanlder.py +0 -0
  127. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/config.py +0 -0
  128. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/factory.py +0 -0
  129. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/mcp/__init__.py +0 -0
  130. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/mcp/manager.py +0 -0
  131. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/mcp/models.py +0 -0
  132. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/mcp/tool_wrapper.py +0 -0
  133. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/openai_builtin/__init__.py +0 -0
  134. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/openai_builtin/base.py +0 -0
  135. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/openai_builtin/code_interpreter/__init__.py +0 -0
  136. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/openai_builtin/code_interpreter/config.py +0 -0
  137. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/openai_builtin/code_interpreter/service.py +0 -0
  138. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/openai_builtin/manager.py +0 -0
  139. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/schemas.py +0 -0
  140. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/test/test_mcp_manager.py +0 -0
  141. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/test/test_tool_progress_reporter.py +0 -0
  142. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/tool.py +0 -0
  143. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/tool_manager.py +0 -0
  144. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/tool_progress_reporter.py +0 -0
  145. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/utils/__init__.py +0 -0
  146. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/utils/source_handling/__init__.py +0 -0
  147. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/utils/source_handling/schema.py +0 -0
  148. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/utils/source_handling/source_formatting.py +0 -0
  149. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/agentic/tools/utils/source_handling/tests/test_source_formatting.py +0 -0
  150. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/__init__.py +0 -0
  151. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/dev_util.py +0 -0
  152. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/fast_api_factory.py +0 -0
  153. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/init_logging.py +0 -0
  154. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/init_sdk.py +0 -0
  155. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/performance/async_tasks.py +0 -0
  156. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/performance/async_wrapper.py +0 -0
  157. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/unique_settings.py +0 -0
  158. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/verification.py +0 -0
  159. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/app/webhook.py +0 -0
  160. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/__init__.py +0 -0
  161. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/constants.py +0 -0
  162. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/deprecated/service.py +0 -0
  163. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/functions.py +0 -0
  164. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/rendering.py +0 -0
  165. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/responses_api.py +0 -0
  166. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/schemas.py +0 -0
  167. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/service.py +0 -0
  168. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/state.py +0 -0
  169. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/chat/utils.py +0 -0
  170. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/__init__.py +0 -0
  171. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/constants.py +0 -0
  172. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/functions.py +0 -0
  173. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/schemas.py +0 -0
  174. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/service.py +0 -0
  175. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/smart_rules.py +0 -0
  176. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/content/utils.py +0 -0
  177. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/README.md +0 -0
  178. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/__init__.py +0 -0
  179. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/augmented/__init__.py +0 -0
  180. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/augmented/service.py +0 -0
  181. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/base.py +0 -0
  182. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/basic/__init__.py +0 -0
  183. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/basic/config.py +0 -0
  184. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/basic/prompt.py +0 -0
  185. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/data_extraction/basic/service.py +0 -0
  186. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/embedding/__init__.py +0 -0
  187. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/embedding/constants.py +0 -0
  188. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/embedding/functions.py +0 -0
  189. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/embedding/schemas.py +0 -0
  190. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/embedding/service.py +0 -0
  191. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/embedding/utils.py +0 -0
  192. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/__init__.py +0 -0
  193. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/langchain/__init__.py +0 -0
  194. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/langchain/client.py +0 -0
  195. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/langchain/history.py +0 -0
  196. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/openai/__init__.py +0 -0
  197. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/openai/client.py +0 -0
  198. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/openai/message_builder.py +0 -0
  199. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/framework_utilities/utils.py +0 -0
  200. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/__init__.py +0 -0
  201. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/_responses_api_utils.py +0 -0
  202. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/builder.py +0 -0
  203. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/constants.py +0 -0
  204. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/default_language_model.py +0 -0
  205. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/functions.py +0 -0
  206. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/infos.py +0 -0
  207. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/prompt.py +0 -0
  208. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/reference.py +0 -0
  209. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/schemas.py +0 -0
  210. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/service.py +0 -0
  211. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/language_model/utils.py +0 -0
  212. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/protocols/support.py +0 -0
  213. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/services/__init__.py +0 -0
  214. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/services/knowledge_base.py +0 -0
  215. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/short_term_memory/__init__.py +0 -0
  216. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/short_term_memory/constants.py +0 -0
  217. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/short_term_memory/service.py +0 -0
  218. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/smart_rules/__init__.py +0 -0
  219. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/smart_rules/compile.py +0 -0
  220. {unique_toolkit-1.38.4 → unique_toolkit-1.39.0}/unique_toolkit/test_utilities/events.py +0 -0
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.39.0] - 2025-12-17
9
+ - Adding simpler shortterm message abilities to chat service
10
+
8
11
  ## [1.38.4] - 2025-12-17
9
12
  - Improving handling of tool calls with Qwen models
10
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 1.38.4
3
+ Version: 1.39.0
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Cedric Klinkert
@@ -41,9 +41,25 @@ The Toolkit is structured along the following domains:
41
41
  - `unique_toolkit.language_model`
42
42
  - `unique_toolkit.short_term_memory`
43
43
 
44
- Each domain comprises a set of functions (in `functions.py`) and a service class (in `service.py`) which encapsulates the basic functionalities to interact with the domain entities, the schemas (in `schemas.py`) used in the service and required for interacting with the service functions, utility functions (in `utils.py`) which give additional functionality to interact with the domain entities (all domains except embedding) and other domain specific functionalities which are explained in the respective domain documentation.
44
+ Each domain comprises a set of schemas (in `schemas.py`) are used in functions (in `functions.py`) which encapsulates the basic functionalities to interact with the plattform.
45
+ The above domains represent the internal structure of the Unique platform.
45
46
 
46
- In addition, the `unique_toolkit.app` module provides functions to initialize apps that interact with the Unique platform. It also includes some utility functions to run async tasks in parallel (async webserver and app implementation required).
47
+ For the `developers` we expose interfaces via `services` classes that correspond directly to an frontend or an entity the `user` interacts with.
48
+
49
+ The following services are currently available:
50
+
51
+ | Service | Responsability |
52
+ |--|--|
53
+ | ChatService | All interactions with the chat interface |
54
+ | KnowledgeBaseService | All interaction with the knowledgebase |
55
+
56
+ The services can be directly import as
57
+
58
+ ```
59
+ from unique_toolkit import ChatService, KnowledgeBaseService
60
+
61
+
62
+ In addition, the `unique_toolkit.app` module provides functions to initialize apps and dev utilities to interact with the Unique platform.
47
63
 
48
64
  ## Changelog
49
65
 
@@ -65,7 +81,6 @@ The `unique_toolkit.app` module encompasses functions for initializing and secur
65
81
  The `unique_toolkit.chat` module encompasses all chat related functionality.
66
82
 
67
83
  - `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
68
- - `service.py` comprises the ChatService and provides an interface to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message and stream complete.
69
84
  - `schemas.py` comprises all relevant schemas, e.g., ChatMessage, used in the ChatService.
70
85
  - `utils.py` comprises utility functions to use and convert ChatMessage objects in assistants, e.g., convert_chat_history_to_injectable_string converts the chat history to a string that can be injected into a prompt.
71
86
 
@@ -74,11 +89,10 @@ The `unique_toolkit.chat` module encompasses all chat related functionality.
74
89
  The `unique_toolkit.content` module encompasses all content related functionality. Content can be any type of textual data that is stored in the Knowledgebase on the Unique platform. During the ingestion of the content, the content is parsed, split in chunks, indexed, and stored in the database.
75
90
 
76
91
  - `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
77
- - `service.py` comprises the ContentService and provides an interface to interact with the content, e.g., search content, search content chunks, upload and download content.
78
92
  - `schemas.py` comprises all relevant schemas, e.g., Content and ContentChunk, used in the ContentService.
79
93
  - `utils.py` comprise utility functions to manipulate Content and ContentChunk objects, e.g., sort_content_chunks and merge_content_chunks.
80
94
 
81
- ## Embedding
95
+ ## Embedding (To be Deprecated)
82
96
 
83
97
  The `unique_toolkit.embedding` module encompasses all embedding related functionality. Embeddings are used to represent textual data in a high-dimensional space. The embeddings can be used to calculate the similarity between two texts, for instance.
84
98
 
@@ -86,34 +100,22 @@ The `unique_toolkit.embedding` module encompasses all embedding related function
86
100
  - `service.py` encompasses the EmbeddingService and provides an interface to interact with the embeddings, e.g., embed text and calculate the similarity between two texts.
87
101
  - `schemas.py` comprises all relevant schemas, e.g., Embeddings, used in the EmbeddingService.
88
102
 
89
- ## Language Model
103
+ ## Language Model
90
104
 
91
105
  The `unique_toolkit.language_model` module encompasses all language model related functionality and information on the different language models deployed through the
92
106
  Unique platform.
93
107
 
94
108
  - `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.AZURE_GPT_4o_2024_1120) to get the information on the specific language model like the name, version, token limits or retirement date.
95
109
  - `functions.py` comprises the functions to complete and stream complete to chat.
96
- - `service.py` comprises the LanguageModelService and provides an interface to interact with the language models, e.g., complete.
97
110
  - `schemas.py` comprises all relevant schemas, e.g., LanguageModelResponse, used in the LanguageModelService.
98
111
  - `utils.py` comprises utility functions to parse the output of the language model, e.g., convert_string_to_json finds and parses the last json object in a string.
99
112
 
100
- ## Short Term Memory
113
+ ## Short Term Memory
101
114
 
102
115
  The `unique_toolkit.short_term_memory` module encompasses all short term memory related functionality.
103
116
 
104
117
  - `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
105
- - `service.py` comprises the ShortTermMemoryService and provides an interface to interact with the short term memory, e.g., create memory.
106
118
  - `schemas.py` comprises all relevant schemas, e.g., ShortTermMemory, used in the ShortTermMemoryService.
107
-
108
- # Development instructions
109
-
110
- 1. Install poetry on your system (through `brew` or `pipx`).
111
-
112
- 2. Install `pyenv` and install python 3.11. `pyenv` is recommended as otherwise poetry uses the python version used to install itself and not the user preferred python version.
113
-
114
- 3. If you then run `python --version` in your terminal, you should be able to see python version as specified in `.python-version`.
115
-
116
- 4. Then finally run `poetry install` to install the package and all dependencies.
117
119
  # Changelog
118
120
 
119
121
  All notable changes to this project will be documented in this file.
@@ -121,6 +123,9 @@ All notable changes to this project will be documented in this file.
121
123
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
122
124
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
123
125
 
126
+ ## [1.39.0] - 2025-12-17
127
+ - Adding simpler shortterm message abilities to chat service
128
+
124
129
  ## [1.38.4] - 2025-12-17
125
130
  - Improving handling of tool calls with Qwen models
126
131
 
@@ -9,9 +9,25 @@ The Toolkit is structured along the following domains:
9
9
  - `unique_toolkit.language_model`
10
10
  - `unique_toolkit.short_term_memory`
11
11
 
12
- Each domain comprises a set of functions (in `functions.py`) and a service class (in `service.py`) which encapsulates the basic functionalities to interact with the domain entities, the schemas (in `schemas.py`) used in the service and required for interacting with the service functions, utility functions (in `utils.py`) which give additional functionality to interact with the domain entities (all domains except embedding) and other domain specific functionalities which are explained in the respective domain documentation.
12
+ Each domain comprises a set of schemas (in `schemas.py`) are used in functions (in `functions.py`) which encapsulates the basic functionalities to interact with the plattform.
13
+ The above domains represent the internal structure of the Unique platform.
13
14
 
14
- In addition, the `unique_toolkit.app` module provides functions to initialize apps that interact with the Unique platform. It also includes some utility functions to run async tasks in parallel (async webserver and app implementation required).
15
+ For the `developers` we expose interfaces via `services` classes that correspond directly to an frontend or an entity the `user` interacts with.
16
+
17
+ The following services are currently available:
18
+
19
+ | Service | Responsability |
20
+ |--|--|
21
+ | ChatService | All interactions with the chat interface |
22
+ | KnowledgeBaseService | All interaction with the knowledgebase |
23
+
24
+ The services can be directly import as
25
+
26
+ ```
27
+ from unique_toolkit import ChatService, KnowledgeBaseService
28
+
29
+
30
+ In addition, the `unique_toolkit.app` module provides functions to initialize apps and dev utilities to interact with the Unique platform.
15
31
 
16
32
  ## Changelog
17
33
 
@@ -33,7 +49,6 @@ The `unique_toolkit.app` module encompasses functions for initializing and secur
33
49
  The `unique_toolkit.chat` module encompasses all chat related functionality.
34
50
 
35
51
  - `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
36
- - `service.py` comprises the ChatService and provides an interface to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message and stream complete.
37
52
  - `schemas.py` comprises all relevant schemas, e.g., ChatMessage, used in the ChatService.
38
53
  - `utils.py` comprises utility functions to use and convert ChatMessage objects in assistants, e.g., convert_chat_history_to_injectable_string converts the chat history to a string that can be injected into a prompt.
39
54
 
@@ -42,11 +57,10 @@ The `unique_toolkit.chat` module encompasses all chat related functionality.
42
57
  The `unique_toolkit.content` module encompasses all content related functionality. Content can be any type of textual data that is stored in the Knowledgebase on the Unique platform. During the ingestion of the content, the content is parsed, split in chunks, indexed, and stored in the database.
43
58
 
44
59
  - `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
45
- - `service.py` comprises the ContentService and provides an interface to interact with the content, e.g., search content, search content chunks, upload and download content.
46
60
  - `schemas.py` comprises all relevant schemas, e.g., Content and ContentChunk, used in the ContentService.
47
61
  - `utils.py` comprise utility functions to manipulate Content and ContentChunk objects, e.g., sort_content_chunks and merge_content_chunks.
48
62
 
49
- ## Embedding
63
+ ## Embedding (To be Deprecated)
50
64
 
51
65
  The `unique_toolkit.embedding` module encompasses all embedding related functionality. Embeddings are used to represent textual data in a high-dimensional space. The embeddings can be used to calculate the similarity between two texts, for instance.
52
66
 
@@ -54,31 +68,19 @@ The `unique_toolkit.embedding` module encompasses all embedding related function
54
68
  - `service.py` encompasses the EmbeddingService and provides an interface to interact with the embeddings, e.g., embed text and calculate the similarity between two texts.
55
69
  - `schemas.py` comprises all relevant schemas, e.g., Embeddings, used in the EmbeddingService.
56
70
 
57
- ## Language Model
71
+ ## Language Model
58
72
 
59
73
  The `unique_toolkit.language_model` module encompasses all language model related functionality and information on the different language models deployed through the
60
74
  Unique platform.
61
75
 
62
76
  - `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.AZURE_GPT_4o_2024_1120) to get the information on the specific language model like the name, version, token limits or retirement date.
63
77
  - `functions.py` comprises the functions to complete and stream complete to chat.
64
- - `service.py` comprises the LanguageModelService and provides an interface to interact with the language models, e.g., complete.
65
78
  - `schemas.py` comprises all relevant schemas, e.g., LanguageModelResponse, used in the LanguageModelService.
66
79
  - `utils.py` comprises utility functions to parse the output of the language model, e.g., convert_string_to_json finds and parses the last json object in a string.
67
80
 
68
- ## Short Term Memory
81
+ ## Short Term Memory
69
82
 
70
83
  The `unique_toolkit.short_term_memory` module encompasses all short term memory related functionality.
71
84
 
72
85
  - `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
73
- - `service.py` comprises the ShortTermMemoryService and provides an interface to interact with the short term memory, e.g., create memory.
74
- - `schemas.py` comprises all relevant schemas, e.g., ShortTermMemory, used in the ShortTermMemoryService.
75
-
76
- # Development instructions
77
-
78
- 1. Install poetry on your system (through `brew` or `pipx`).
79
-
80
- 2. Install `pyenv` and install python 3.11. `pyenv` is recommended as otherwise poetry uses the python version used to install itself and not the user preferred python version.
81
-
82
- 3. If you then run `python --version` in your terminal, you should be able to see python version as specified in `.python-version`.
83
-
84
- 4. Then finally run `poetry install` to install the package and all dependencies.
86
+ - `schemas.py` comprises all relevant schemas, e.g., ShortTermMemory, used in the ShortTermMemoryService.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_toolkit"
3
- version = "1.38.4"
3
+ version = "1.39.0"
4
4
  description = ""
5
5
  authors = [
6
6
  "Cedric Klinkert <cedric.klinkert@unique.ch>",
@@ -120,11 +120,15 @@ class McpServer(BaseModel):
120
120
  class ChatEventUserMessage(BaseModel):
121
121
  model_config = model_config
122
122
 
123
- id: str
124
- text: str
125
- original_text: str
126
- created_at: str
127
- language: str
123
+ id: str = Field(
124
+ description="The id of the user message. On an event this corresponds to the user message that created the event."
125
+ )
126
+ text: str = Field(description="The text of the user message.")
127
+ original_text: str = Field(description="The original text of the user message.")
128
+ created_at: str = Field(
129
+ description="The creation date and time of the user message."
130
+ )
131
+ language: str = Field(description="The language of the user message.")
128
132
 
129
133
 
130
134
  @deprecated(
@@ -140,8 +144,12 @@ class EventUserMessage(ChatEventUserMessage):
140
144
  class ChatEventAssistantMessage(BaseModel):
141
145
  model_config = model_config
142
146
 
143
- id: str
144
- created_at: str
147
+ id: str = Field(
148
+ description="The id of the assistant message. On an event this corresponds to the assistant message that will be returned by the process handling the event."
149
+ )
150
+ created_at: str = Field(
151
+ description="The creation date and time of the assistant message."
152
+ )
145
153
 
146
154
 
147
155
  @deprecated(
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, Sequence
2
+ from typing import Any, Sequence, overload
3
3
 
4
4
  import unique_sdk
5
5
  from openai.types.chat import ChatCompletionToolChoiceOptionParam
@@ -13,6 +13,7 @@ from openai.types.responses import (
13
13
  response_create_params,
14
14
  )
15
15
  from openai.types.shared_params import Metadata, Reasoning
16
+ from pydantic import BaseModel
16
17
  from typing_extensions import deprecated
17
18
 
18
19
  from unique_toolkit._common.utils.files import is_file_content, is_image_content
@@ -93,6 +94,13 @@ from unique_toolkit.language_model.schemas import (
93
94
  LanguageModelToolDescription,
94
95
  ResponsesLanguageModelStreamResponse,
95
96
  )
97
+ from unique_toolkit.short_term_memory.functions import (
98
+ create_memory,
99
+ create_memory_async,
100
+ find_latest_memory,
101
+ find_latest_memory_async,
102
+ )
103
+ from unique_toolkit.short_term_memory.schemas import ShortTermMemory
96
104
 
97
105
  logger = logging.getLogger(f"toolkit.{DOMAIN_NAME}.{__name__}")
98
106
 
@@ -1654,3 +1662,403 @@ class ChatService(ChatServiceDeprecated):
1654
1662
  if is_image_content(filename=c.key):
1655
1663
  images.append(c)
1656
1664
  return images, files
1665
+
1666
+ # Short Term Memories
1667
+ ############################################################################
1668
+
1669
+ def create_chat_memory_by_id(
1670
+ self, *, chat_id: str, key: str, value: str | dict | BaseModel
1671
+ ) -> ShortTermMemory:
1672
+ """Creates a short-term memory for a specific chat synchronously.
1673
+
1674
+ Args:
1675
+ chat_id (str): The chat ID
1676
+ key (str): The memory key
1677
+ value (str | dict | BaseModel): The memory value
1678
+
1679
+ Returns:
1680
+ ShortTermMemory: The created short-term memory
1681
+
1682
+ Raises:
1683
+ Exception: If the creation fails
1684
+ """
1685
+ # Convert BaseModel to JSON string if needed
1686
+ if isinstance(value, BaseModel):
1687
+ value = value.model_dump_json()
1688
+
1689
+ return create_memory(
1690
+ user_id=self._user_id,
1691
+ company_id=self._company_id,
1692
+ key=key,
1693
+ value=value,
1694
+ chat_id=chat_id,
1695
+ )
1696
+
1697
+ async def create_chat_memory_by_id_async(
1698
+ self, *, chat_id: str, key: str, value: str | dict | BaseModel
1699
+ ) -> ShortTermMemory:
1700
+ """Creates a short-term memory for a specific chat asynchronously.
1701
+
1702
+ Args:
1703
+ chat_id (str): The chat ID
1704
+ key (str): The memory key
1705
+ value (str | dict | BaseModel): The memory value
1706
+
1707
+ Returns:
1708
+ ShortTermMemory: The created short-term memory
1709
+
1710
+ Raises:
1711
+ Exception: If the creation fails
1712
+ """
1713
+ # Convert BaseModel to JSON string if needed
1714
+ if isinstance(value, BaseModel):
1715
+ value = value.model_dump_json()
1716
+
1717
+ return await create_memory_async(
1718
+ user_id=self._user_id,
1719
+ company_id=self._company_id,
1720
+ key=key,
1721
+ value=value,
1722
+ chat_id=chat_id,
1723
+ )
1724
+
1725
+ def create_message_memory_by_id(
1726
+ self, *, message_id: str, key: str, value: str | dict | BaseModel
1727
+ ) -> ShortTermMemory:
1728
+ """Creates a short-term memory for a specific message synchronously.
1729
+
1730
+ Args:
1731
+ message_id (str): The message ID
1732
+ key (str): The memory key
1733
+ value (str | dict | BaseModel): The memory value
1734
+
1735
+ Returns:
1736
+ ShortTermMemory: The created short-term memory
1737
+
1738
+ Raises:
1739
+ Exception: If the creation fails
1740
+ """
1741
+ # Convert BaseModel to JSON string if needed
1742
+ if isinstance(value, BaseModel):
1743
+ value = value.model_dump_json()
1744
+
1745
+ return create_memory(
1746
+ user_id=self._user_id,
1747
+ company_id=self._company_id,
1748
+ key=key,
1749
+ value=value,
1750
+ message_id=message_id,
1751
+ )
1752
+
1753
+ async def create_message_memory_by_id_async(
1754
+ self, *, message_id: str, key: str, value: str | dict | BaseModel
1755
+ ) -> ShortTermMemory:
1756
+ """Creates a short-term memory for a specific message asynchronously.
1757
+
1758
+ Args:
1759
+ message_id (str): The message ID
1760
+ key (str): The memory key
1761
+ value (str | dict | BaseModel): The memory value
1762
+
1763
+ Returns:
1764
+ ShortTermMemory: The created short-term memory
1765
+
1766
+ Raises:
1767
+ Exception: If the creation fails
1768
+ """
1769
+ # Convert BaseModel to JSON string if needed
1770
+ if isinstance(value, BaseModel):
1771
+ value = value.model_dump_json()
1772
+
1773
+ return await create_memory_async(
1774
+ user_id=self._user_id,
1775
+ company_id=self._company_id,
1776
+ key=key,
1777
+ value=value,
1778
+ message_id=message_id,
1779
+ )
1780
+
1781
+ def find_chat_memory_by_id(self, *, chat_id: str, key: str) -> ShortTermMemory:
1782
+ """Finds the latest short-term memory for a specific chat synchronously.
1783
+
1784
+ Args:
1785
+ chat_id (str): The chat ID
1786
+ key (str): The memory key
1787
+
1788
+ Returns:
1789
+ ShortTermMemory: The latest short-term memory
1790
+
1791
+ Raises:
1792
+ Exception: If the retrieval fails
1793
+ """
1794
+ return find_latest_memory(
1795
+ user_id=self._user_id,
1796
+ company_id=self._company_id,
1797
+ key=key,
1798
+ chat_id=chat_id,
1799
+ )
1800
+
1801
+ async def find_chat_memory_by_id_async(
1802
+ self, *, chat_id: str, key: str
1803
+ ) -> ShortTermMemory:
1804
+ """Finds the latest short-term memory for a specific chat asynchronously.
1805
+
1806
+ Args:
1807
+ chat_id (str): The chat ID
1808
+ key (str): The memory key
1809
+
1810
+ Returns:
1811
+ ShortTermMemory: The latest short-term memory
1812
+
1813
+ Raises:
1814
+ Exception: If the retrieval fails
1815
+ """
1816
+ return await find_latest_memory_async(
1817
+ user_id=self._user_id,
1818
+ company_id=self._company_id,
1819
+ key=key,
1820
+ chat_id=chat_id,
1821
+ )
1822
+
1823
+ def find_message_memory_by_id(
1824
+ self, *, message_id: str, key: str
1825
+ ) -> ShortTermMemory:
1826
+ """Finds the latest short-term memory for a specific message synchronously.
1827
+
1828
+ Args:
1829
+ message_id (str): The message ID
1830
+ key (str): The memory key
1831
+
1832
+ Returns:
1833
+ ShortTermMemory: The latest short-term memory
1834
+
1835
+ Raises:
1836
+ Exception: If the retrieval fails
1837
+ """
1838
+ return find_latest_memory(
1839
+ user_id=self._user_id,
1840
+ company_id=self._company_id,
1841
+ key=key,
1842
+ message_id=message_id,
1843
+ )
1844
+
1845
+ async def find_message_memory_by_id_async(
1846
+ self, *, message_id: str, key: str
1847
+ ) -> ShortTermMemory:
1848
+ """Finds the latest short-term memory for a specific message asynchronously.
1849
+
1850
+ Args:
1851
+ message_id (str): The message ID
1852
+ key (str): The memory key
1853
+
1854
+ Returns:
1855
+ ShortTermMemory: The latest short-term memory
1856
+
1857
+ Raises:
1858
+ Exception: If the retrieval fails
1859
+ """
1860
+ return await find_latest_memory_async(
1861
+ user_id=self._user_id,
1862
+ company_id=self._company_id,
1863
+ key=key,
1864
+ message_id=message_id,
1865
+ )
1866
+
1867
+ # Convenience methods using current chat/message IDs
1868
+ ############################################################################
1869
+
1870
+ def create_chat_memory(
1871
+ self, *, key: str, value: str | dict | BaseModel
1872
+ ) -> ShortTermMemory:
1873
+ """Creates a short-term memory for the current chat synchronously.
1874
+
1875
+ Args:
1876
+ key (str): The memory key
1877
+ value (str | dict | BaseModel): The memory value
1878
+
1879
+ Returns:
1880
+ ShortTermMemory: The created short-term memory
1881
+
1882
+ Raises:
1883
+ Exception: If the creation fails
1884
+ """
1885
+ return self.create_chat_memory_by_id(
1886
+ chat_id=self._chat_id,
1887
+ key=key,
1888
+ value=value,
1889
+ )
1890
+
1891
+ async def create_chat_memory_async(
1892
+ self, *, key: str, value: str | dict | BaseModel
1893
+ ) -> ShortTermMemory:
1894
+ """Creates a short-term memory for the current chat asynchronously.
1895
+
1896
+ Args:
1897
+ key (str): The memory key
1898
+ value (str | dict | BaseModel): The memory value
1899
+
1900
+ Returns:
1901
+ ShortTermMemory: The created short-term memory
1902
+
1903
+ Raises:
1904
+ Exception: If the creation fails
1905
+ """
1906
+ return await self.create_chat_memory_by_id_async(
1907
+ chat_id=self._chat_id,
1908
+ key=key,
1909
+ value=value,
1910
+ )
1911
+
1912
+ @overload
1913
+ def create_message_memory(
1914
+ self,
1915
+ *,
1916
+ key: str,
1917
+ value: str | dict | BaseModel,
1918
+ ) -> ShortTermMemory: ...
1919
+
1920
+ @overload
1921
+ def create_message_memory(
1922
+ self, *, key: str, value: str | dict | BaseModel, message_id: str
1923
+ ) -> ShortTermMemory: ...
1924
+
1925
+ def create_message_memory(
1926
+ self, *, key: str, value: str | dict | BaseModel, message_id: str | None = None
1927
+ ) -> ShortTermMemory:
1928
+ """Creates a short-term memory for the current assistant message synchronously.
1929
+
1930
+ Args:
1931
+ key (str): The memory key
1932
+ value (str | dict | BaseModel): The memory value
1933
+
1934
+ Returns:
1935
+ ShortTermMemory: The created short-term memory
1936
+
1937
+ Raises:
1938
+ Exception: If the creation fails
1939
+ """
1940
+ return self.create_message_memory_by_id(
1941
+ key=key,
1942
+ value=value,
1943
+ message_id=message_id or self._assistant_message_id,
1944
+ )
1945
+
1946
+ @overload
1947
+ async def create_message_memory_async(
1948
+ self,
1949
+ *,
1950
+ key: str,
1951
+ value: str | dict | BaseModel,
1952
+ ) -> ShortTermMemory: ...
1953
+
1954
+ @overload
1955
+ async def create_message_memory_async(
1956
+ self, *, key: str, value: str | dict | BaseModel, message_id: str
1957
+ ) -> ShortTermMemory: ...
1958
+
1959
+ async def create_message_memory_async(
1960
+ self, *, key: str, value: str | dict | BaseModel, message_id: str | None = None
1961
+ ) -> ShortTermMemory:
1962
+ """Creates a short-term memory for the current assistant message asynchronously.
1963
+
1964
+ Args:
1965
+ key (str): The memory key
1966
+ value (str | dict | BaseModel): The memory value
1967
+
1968
+ Returns:
1969
+ ShortTermMemory: The created short-term memory
1970
+
1971
+ Raises:
1972
+ Exception: If the creation fails
1973
+ """
1974
+ return await self.create_message_memory_by_id_async(
1975
+ message_id=message_id or self._assistant_message_id,
1976
+ key=key,
1977
+ value=value,
1978
+ )
1979
+
1980
+ def find_chat_memory(self, *, key: str) -> ShortTermMemory:
1981
+ """Finds the latest short-term memory for the current chat synchronously.
1982
+
1983
+ Args:
1984
+ key (str): The memory key
1985
+
1986
+ Returns:
1987
+ ShortTermMemory: The latest short-term memory
1988
+
1989
+ Raises:
1990
+ Exception: If the retrieval fails
1991
+ """
1992
+ return self.find_chat_memory_by_id(
1993
+ chat_id=self._chat_id,
1994
+ key=key,
1995
+ )
1996
+
1997
+ async def find_chat_memory_async(self, *, key: str) -> ShortTermMemory:
1998
+ """Finds the latest short-term memory for the current chat asynchronously.
1999
+
2000
+ Args:
2001
+ key (str): The memory key
2002
+
2003
+ Returns:
2004
+ ShortTermMemory: The latest short-term memory
2005
+
2006
+ Raises:
2007
+ Exception: If the retrieval fails
2008
+ """
2009
+ return await self.find_chat_memory_by_id_async(
2010
+ chat_id=self._chat_id,
2011
+ key=key,
2012
+ )
2013
+
2014
+ @overload
2015
+ def find_message_memory(self, *, key: str) -> ShortTermMemory: ...
2016
+
2017
+ @overload
2018
+ def find_message_memory(self, *, key: str, message_id: str) -> ShortTermMemory: ...
2019
+
2020
+ def find_message_memory(
2021
+ self, *, key: str, message_id: str | None = None
2022
+ ) -> ShortTermMemory:
2023
+ """Finds the latest short-term memory for the current assistant message synchronously.
2024
+
2025
+ Args:
2026
+ key (str): The memory key
2027
+
2028
+ Returns:
2029
+ ShortTermMemory: The latest short-term memory
2030
+
2031
+ Raises:
2032
+ Exception: If the retrieval fails
2033
+ """
2034
+ return self.find_message_memory_by_id(
2035
+ message_id=message_id or self._assistant_message_id,
2036
+ key=key,
2037
+ )
2038
+
2039
+ @overload
2040
+ async def find_message_memory_async(self, *, key: str) -> ShortTermMemory: ...
2041
+
2042
+ @overload
2043
+ async def find_message_memory_async(
2044
+ self, *, key: str, message_id: str
2045
+ ) -> ShortTermMemory: ...
2046
+
2047
+ async def find_message_memory_async(
2048
+ self, *, key: str, message_id: str | None = None
2049
+ ) -> ShortTermMemory:
2050
+ """Finds the latest short-term memory for the current assistant message asynchronously.
2051
+
2052
+ Args:
2053
+ key (str): The memory key
2054
+
2055
+ Returns:
2056
+ ShortTermMemory: The latest short-term memory
2057
+
2058
+ Raises:
2059
+ Exception: If the retrieval fails
2060
+ """
2061
+ return await self.find_message_memory_by_id_async(
2062
+ message_id=message_id or self._assistant_message_id,
2063
+ key=key,
2064
+ )