增加dequeue_context_length的值的判断,只能在1到max_context_length之间

This commit is contained in:
Raila23
2025-04-09 22:28:33 +08:00
parent 3d22772d4e
commit 4d414a2994
@@ -38,9 +38,10 @@ class LLMRequestSubStage(Stage):
self.max_context_length = ctx.astrbot_config["provider_settings"][
"max_context_length"
] # int
self.dequeue_context_length = ctx.astrbot_config["provider_settings"][
"dequeue_context_length"
] # int
self.dequeue_context_length = min(
max(1,ctx.astrbot_config["provider_settings"]["dequeue_context_length"]),
self.max_context_length - 1
) # int
self.streaming_response = ctx.astrbot_config["provider_settings"][
"streaming_response"
] # bool