Skip to content

fix: resolve AttributeError in BatchDocumentSummarizer.process_files#2271

Open
octo-patch wants to merge 1 commit into
binary-husky:masterfrom
octo-patch:fix/issue-2226-batch-document-summarizer-plugin-kwargs
Open

fix: resolve AttributeError in BatchDocumentSummarizer.process_files#2271
octo-patch wants to merge 1 commit into
binary-husky:masterfrom
octo-patch:fix/issue-2226-batch-document-summarizer-plugin-kwargs

Conversation

@octo-patch

Copy link
Copy Markdown

Fixes #2226

Problem

BatchDocumentSummarizer.__init__ does not accept or store plugin_kwargs, but process_files() and related methods reference self.plugin_kwargs at three locations, causing:

AttributeError: 'BatchDocumentSummarizer' object has no attribute 'plugin_kwargs'

Solution

The advanced_arg value is already extracted from plugin_kwargs before the BatchDocumentSummarizer is instantiated (line 505 of the same file), and stored as self.query. Replace all three occurrences of self.plugin_kwargs.get("advanced_arg") / self.plugin_kwargs["advanced_arg"] with self.query, which already holds the same value.

Testing

  • Reproduced the error by calling the 批量文件询问 plugin with multi-fragment files
  • After the fix, process_files no longer raises AttributeError and correctly falls back to the default summary prompt when no advanced_arg is provided

…ixes binary-husky#2226)

BatchDocumentSummarizer.__init__ never stored plugin_kwargs, so accessing
self.plugin_kwargs in process_files raised AttributeError. The advanced_arg
value is already extracted from plugin_kwargs before instantiation and stored
as self.query, so replace all self.plugin_kwargs references with self.query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 批量总结文件,生成总结时报错

1 participant