refactor(llm): extract LLMService into quickquip/llm/service.py#2
Merged
refactor(llm): extract LLMService into quickquip/llm/service.py#2
Conversation
Move LLMService from plugins/llm_runtime.py to quickquip/llm/service.py so that the business logic lives inside the framework-agnostic layer. plugins/llm_runtime.py becomes a thin re-export shim. Also: use TYPE_CHECKING guards for framework-layer imports, add None guard on delete_message_from_context, remove dead _format_quoted_speaker, and bump tieba_random_post rate limit to (6, 3).
test_llm.py patched attributes on the plugins.llm_runtime module, but after the extraction the real code lives in quickquip.llm.service. Redirect the import so monkey-patches take effect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LLMServicefromplugins/llm_runtime.pytoquickquip/llm/service.py,使业务逻辑完全位于框架无关层plugins/llm_runtime.py瘦身为 thin re-export shim,保持向后兼容quickquip/app/message_pipeline.pyimport 路径指向新位置tieba_random_post限流 从 (2, 1) 调整为 (6, 3)附带修复
delete_message_from_context: 增加recent_message_buffer的None守卫,修复 buffer 未绑定时的AttributeError_format_quoted_speaker(仅prompting.py内部使用,类上无调用方)TYPE_CHECKING守卫用于GroupStatsTracker、GroupRuleSwitch、RecentMessageBuffer,避免运行时循环依赖SWITCHABLE_RULES改为方法内延迟 importTest plan
python test_tz.py全部通过from plugins.llm_runtime import LLMService, llm_service, ResolvedGroupSettings正常from quickquip.llm.service import LLMService, llm_service正常from quickquip.app.message_pipeline import llm_service正常