echotools 2.3.42__tar.gz → 2.3.43__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 (190) hide show
  1. {echotools-2.3.42 → echotools-2.3.43}/PKG-INFO +1 -1
  2. {echotools-2.3.42 → echotools-2.3.43}/pyproject.toml +1 -1
  3. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_think/core.py +21 -10
  4. {echotools-2.3.42 → echotools-2.3.43}/src/echotools.egg-info/PKG-INFO +1 -1
  5. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_entml_protocol.py +17 -11
  6. {echotools-2.3.42 → echotools-2.3.43}/README.md +0 -0
  7. {echotools-2.3.42 → echotools-2.3.43}/docs/README.md +0 -0
  8. {echotools-2.3.42 → echotools-2.3.43}/setup.cfg +0 -0
  9. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/__init__.py +0 -0
  10. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/cache/__init__.py +0 -0
  11. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/cache/list_cache.py +0 -0
  12. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/cache/memory_cache.py +0 -0
  13. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/__init__.py +0 -0
  14. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/base.py +0 -0
  15. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/center.py +0 -0
  16. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/center_notify.py +0 -0
  17. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/center_template.py +0 -0
  18. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/loader.py +0 -0
  19. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/config/merge.py +0 -0
  20. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/errors/__init__.py +0 -0
  21. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/errors/base.py +0 -0
  22. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/errors/classify.py +0 -0
  23. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/errors/common.py +0 -0
  24. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/errors/http.py +0 -0
  25. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/ids/__init__.py +0 -0
  26. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/ids/generator.py +0 -0
  27. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/io/__init__.py +0 -0
  28. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/io/io_utils.py +0 -0
  29. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/io/printstream.py +0 -0
  30. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/logger/__init__.py +0 -0
  31. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/logger/manager.py +0 -0
  32. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/retry/__init__.py +0 -0
  33. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/base/retry/retry.py +0 -0
  34. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/compat.py +0 -0
  35. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/__init__.py +0 -0
  36. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/candidate.py +0 -0
  37. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/dispatcher.py +0 -0
  38. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/proxy_selector.py +0 -0
  39. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/race.py +0 -0
  40. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/selector.py +0 -0
  41. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/dispatch/usage.py +0 -0
  42. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/__init__.py +0 -0
  43. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/parsers/__init__.py +0 -0
  44. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/parsers/stream.py +0 -0
  45. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/parsers/xml_params.py +0 -0
  46. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/parsers/xml_parser.py +0 -0
  47. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/prompt/__init__.py +0 -0
  48. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/prompt/history.py +0 -0
  49. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/prompt/history_format.py +0 -0
  50. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/prompt/inject.py +0 -0
  51. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/prompt/prompt_helpers.py +0 -0
  52. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/prompt/templates.py +0 -0
  53. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/__init__.py +0 -0
  54. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml.py +0 -0
  55. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_invoke.py +0 -0
  56. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_patterns.py +0 -0
  57. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_think/__init__.py +0 -0
  58. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_think/hist.py +0 -0
  59. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_think/parse.py +0 -0
  60. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_tools.py +0 -0
  61. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/protocols/entml_values.py +0 -0
  62. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/registry.py +0 -0
  63. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/shared/__init__.py +0 -0
  64. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/shared/coercion.py +0 -0
  65. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/shared/loop_detect.py +0 -0
  66. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/shared/normalization.py +0 -0
  67. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/shared/schema_render.py +0 -0
  68. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/fncall/shared/xml_helpers.py +0 -0
  69. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/keys.py +0 -0
  70. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/lifecycle/__init__.py +0 -0
  71. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/lifecycle/manager.py +0 -0
  72. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/lifecycle/updater.py +0 -0
  73. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/lifecycle/updater_pull.py +0 -0
  74. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/process/__init__.py +0 -0
  75. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/process/port.py +0 -0
  76. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/protocol/__init__.py +0 -0
  77. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/protocol/base.py +0 -0
  78. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/__init__.py +0 -0
  79. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/conpty.py +0 -0
  80. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/local/__init__.py +0 -0
  81. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/local/core.py +0 -0
  82. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/local/proc.py +0 -0
  83. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/local/unix.py +0 -0
  84. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/local/win.py +0 -0
  85. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/sanitize.py +0 -0
  86. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/session/__init__.py +0 -0
  87. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/session/base.py +0 -0
  88. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/session/client.py +0 -0
  89. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/ssh.py +0 -0
  90. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/exec/terminal/tmux.py +0 -0
  91. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/console/__init__.py +0 -0
  92. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/console/charmap.py +0 -0
  93. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/console/spinner.py +0 -0
  94. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/console/ui.py +0 -0
  95. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/events/__init__.py +0 -0
  96. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/events/bus.py +0 -0
  97. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/events/event.py +0 -0
  98. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/spinner/__init__.py +0 -0
  99. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/spinner/spinner.py +0 -0
  100. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/spinner/spinner_color.py +0 -0
  101. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/tracing/__init__.py +0 -0
  102. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/tracing/context.py +0 -0
  103. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/tracing/span.py +0 -0
  104. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/tracing/tracer.py +0 -0
  105. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/translate.py +0 -0
  106. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/watcher/__init__.py +0 -0
  107. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/watcher/file_watcher.py +0 -0
  108. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/__init__.py +0 -0
  109. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/application.py +0 -0
  110. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/broker.py +0 -0
  111. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/app.js +0 -0
  112. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/filezone.js +0 -0
  113. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/motionkit.js +0 -0
  114. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/sendbutton.js +0 -0
  115. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/sortablelist.css +0 -0
  116. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/sortablelist.js +0 -0
  117. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/textinput.js +0 -0
  118. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/components/voiceinput.js +0 -0
  119. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/fonts/inter-500.woff2 +0 -0
  120. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/fonts/inter-600.woff2 +0 -0
  121. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/fonts/inter400.woff2 +0 -0
  122. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/fonts/tailwind.css +0 -0
  123. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/inputbox.css +0 -0
  124. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/inputbox.js +0 -0
  125. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/style.css +0 -0
  126. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/input_box/voicegif.js +0 -0
  127. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/middleware.py +0 -0
  128. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/stats.py +0 -0
  129. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/media/web/utils.py +0 -0
  130. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/files/__init__.py +0 -0
  131. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/files/file_util.py +0 -0
  132. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/network/__init__.py +0 -0
  133. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/network/http_utils.py +0 -0
  134. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/plugin/__init__.py +0 -0
  135. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/plugin/base.py +0 -0
  136. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/plugin/discovery.py +0 -0
  137. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/plugin/registry.py +0 -0
  138. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/plugin/registry_ops.py +0 -0
  139. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/proxy/__init__.py +0 -0
  140. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/proxy/manager.py +0 -0
  141. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/runtime/__init__.py +0 -0
  142. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/runtime/collector.py +0 -0
  143. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/scheduler/__init__.py +0 -0
  144. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/scheduler/scheduler.py +0 -0
  145. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/sdk/__init__.py +0 -0
  146. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/plat/sdk/facade.py +0 -0
  147. {echotools-2.3.42 → echotools-2.3.43}/src/echotools/version.py +0 -0
  148. {echotools-2.3.42 → echotools-2.3.43}/src/echotools.egg-info/SOURCES.txt +0 -0
  149. {echotools-2.3.42 → echotools-2.3.43}/src/echotools.egg-info/dependency_links.txt +0 -0
  150. {echotools-2.3.42 → echotools-2.3.43}/src/echotools.egg-info/requires.txt +0 -0
  151. {echotools-2.3.42 → echotools-2.3.43}/src/echotools.egg-info/top_level.txt +0 -0
  152. {echotools-2.3.42 → echotools-2.3.43}/src/tests/bench_import.py +0 -0
  153. {echotools-2.3.42 → echotools-2.3.43}/src/tests/conftest.py +0 -0
  154. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_cache_retry.py +0 -0
  155. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_completion.py +0 -0
  156. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_config.py +0 -0
  157. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_config_extended.py +0 -0
  158. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_console.py +0 -0
  159. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_coverage_core.py +0 -0
  160. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_dispatch.py +0 -0
  161. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_dispatch_extended.py +0 -0
  162. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_dispatch_race.py +0 -0
  163. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_entml_thinking_history.py +0 -0
  164. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_entml_thinking_parse.py +0 -0
  165. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_entml_tools.py +0 -0
  166. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_errors.py +0 -0
  167. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_errors_common.py +0 -0
  168. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_events.py +0 -0
  169. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_events_event.py +0 -0
  170. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_facade.py +0 -0
  171. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_fncall.py +0 -0
  172. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_fncall_stream_thinking.py +0 -0
  173. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_ids.py +0 -0
  174. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_imports.py +0 -0
  175. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_io.py +0 -0
  176. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_keys.py +0 -0
  177. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_lifecycle.py +0 -0
  178. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_logger.py +0 -0
  179. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_merge.py +0 -0
  180. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_plugin.py +0 -0
  181. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_printstream.py +0 -0
  182. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_protocols.py +0 -0
  183. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_proxy.py +0 -0
  184. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_proxy_selector.py +0 -0
  185. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_runtime.py +0 -0
  186. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_scheduler.py +0 -0
  187. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_tracing.py +0 -0
  188. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_usage.py +0 -0
  189. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_web.py +0 -0
  190. {echotools-2.3.42 → echotools-2.3.43}/src/tests/test_web_broker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: echotools
3
- Version: 2.3.42
3
+ Version: 2.3.43
4
4
  Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
5
  Author: nichengfuben
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "echotools"
7
- version = "2.3.42"
7
+ version = "2.3.43"
8
8
  description = "通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链"
9
9
  readme = "docs/README.md"
10
10
  requires-python = ">=3.8"
@@ -53,11 +53,11 @@ _INJECTION_MODE_ALIASES: Dict[str, str] = {
53
53
  }
54
54
 
55
55
  _DEFAULT_MAX_BY_LEVEL: Dict[str, int] = {
56
- "low": 6554,
57
- "medium": 13108,
58
- "high": 32768,
59
- "xhigh": 52428,
60
- "max": 62260,
56
+ "low": 12800,
57
+ "medium": 25600,
58
+ "high": 64000,
59
+ "xhigh": 102400,
60
+ "max": 134736,
61
61
  }
62
62
 
63
63
  _LEGACY_ON_DEFAULT_MAX = _DEFAULT_MAX_BY_LEVEL["medium"]
@@ -120,9 +120,12 @@ def parse_max_thinking_length(value: Any) -> Optional[int]:
120
120
  def resolve_thinking_injection(
121
121
  protocol_options: Optional[Dict[str, Any]] = None,
122
122
  ) -> Optional[Tuple[str, Optional[int]]]:
123
- """解析注入用 thinking_mode (on/auto) 与 max_thinking_length。
123
+ """解析注入用 thinking_mode 与 max_thinking_length。
124
124
 
125
- 返回 None 表示不注入任何思考相关内容(none / off)。
125
+ - thinking_level 为 low|medium|high|xhigh|max 时,thinking_mode 直接传该挡位名。
126
+ - 仅 thinking_mode=on(无 level)时用 ``on``,并按 medium 默认长度。
127
+ - auto 传 ``auto``,无默认 max_thinking_length。
128
+ - none / off 返回 None,不注入任何思考相关内容。
126
129
  """
127
130
  opts = protocol_options or {}
128
131
 
@@ -130,8 +133,12 @@ def resolve_thinking_injection(
130
133
  if level is not None:
131
134
  if level == "none":
132
135
  return None
133
- injection_mode = "auto" if level == "auto" else "on"
134
- default_max = default_max_thinking_length_for_level(level)
136
+ if level == "auto":
137
+ injection_mode = "auto"
138
+ default_max = None
139
+ else:
140
+ injection_mode = level
141
+ default_max = default_max_thinking_length_for_level(level)
135
142
  else:
136
143
  mode = normalize_thinking_mode(opts.get("thinking_mode"))
137
144
  if mode is None or mode == "off":
@@ -144,8 +151,12 @@ def resolve_thinking_injection(
144
151
  return injection_mode, max_length
145
152
 
146
153
 
154
+ def _uses_forced_thinking_behavior(injection_mode: str) -> bool:
155
+ return injection_mode != "auto"
156
+
157
+
147
158
  def _format_thinking_behavior(injection_mode: str) -> str:
148
- body = _THINKING_BEHAVIOR_ON if injection_mode == "on" else _THINKING_BEHAVIOR_AUTO
159
+ body = _THINKING_BEHAVIOR_ON if _uses_forced_thinking_behavior(injection_mode) else _THINKING_BEHAVIOR_AUTO
149
160
  return f"<thinking_behavior>\n{body}\n</thinking_behavior>"
150
161
 
151
162
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: echotools
3
- Version: 2.3.42
3
+ Version: 2.3.43
4
4
  Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
5
  Author: nichengfuben
6
6
  License: MIT
@@ -128,11 +128,11 @@ def test_normalize_thinking_level(raw, expected) -> None:
128
128
  @pytest.mark.parametrize(
129
129
  "level,expected",
130
130
  [
131
- ("low", 6554),
132
- ("medium", 13108),
133
- ("high", 32768),
134
- ("xhigh", 52428),
135
- ("max", 62260),
131
+ ("low", 12800),
132
+ ("medium", 25600),
133
+ ("high", 64000),
134
+ ("xhigh", 102400),
135
+ ("max", 134736),
136
136
  ("none", None),
137
137
  ("auto", None),
138
138
  ],
@@ -143,13 +143,13 @@ def test_default_max_thinking_length_for_level(level, expected) -> None:
143
143
 
144
144
  def test_resolve_thinking_injection_levels() -> None:
145
145
  assert resolve_thinking_injection({"thinking_level": "none"}) is None
146
- assert resolve_thinking_injection({"thinking_level": "low"}) == ("on", 6554)
147
- assert resolve_thinking_injection({"thinking_level": "high"}) == ("on", 32768)
146
+ assert resolve_thinking_injection({"thinking_level": "low"}) == ("low", 12800)
147
+ assert resolve_thinking_injection({"thinking_level": "high"}) == ("high", 64000)
148
148
  assert resolve_thinking_injection({"thinking_level": "auto"}) == ("auto", None)
149
149
  assert resolve_thinking_injection({
150
150
  "thinking_level": "max",
151
151
  "max_thinking_length": 1000,
152
- }) == ("on", 1000)
152
+ }) == ("max", 1000)
153
153
 
154
154
 
155
155
  def test_thinking_prompt_off() -> None:
@@ -163,18 +163,24 @@ def test_thinking_prompt_off() -> None:
163
163
  def test_thinking_prompt_on_without_max_length() -> None:
164
164
  section = build_entml_thinking_section({"thinking_mode": "on"})
165
165
  assert "<entml:thinking_mode>on</entml:thinking_mode>" in section
166
- assert "<entml:max_thinking_length>13108</entml:max_thinking_length>" in section
166
+ assert "<entml:max_thinking_length>25600</entml:max_thinking_length>" in section
167
167
  assert "<thinking_behavior>" in section
168
168
 
169
169
 
170
170
  def test_thinking_prompt_on_by_level() -> None:
171
171
  section = build_entml_thinking_section({"thinking_level": "low"})
172
- assert "<entml:thinking_mode>on</entml:thinking_mode>" in section
173
- assert "<entml:max_thinking_length>6554</entml:max_thinking_length>" in section
172
+ assert "<entml:thinking_mode>low</entml:thinking_mode>" in section
173
+ assert "<entml:max_thinking_length>12800</entml:max_thinking_length>" in section
174
174
  assert "Never skip the thinking block" in section
175
175
  assert "Your default is to think before it answers" in section
176
176
 
177
177
 
178
+ def test_thinking_prompt_medium_by_level() -> None:
179
+ section = build_entml_thinking_section({"thinking_level": "medium"})
180
+ assert "<entml:thinking_mode>medium</entml:thinking_mode>" in section
181
+ assert "<entml:max_thinking_length>25600</entml:max_thinking_length>" in section
182
+
183
+
178
184
  def test_thinking_prompt_on() -> None:
179
185
  section = build_entml_thinking_section({"thinking_mode": "on"})
180
186
  assert "<entml:thinking_mode>on</entml:thinking_mode>" in section
File without changes
File without changes
File without changes