@@ -18,7 +18,7 @@ def initialize(bot, strategy, persist_summaries: true)
1818 attr_reader :bot , :strategy
1919
2020 # @param user { User } - User object used for auditing usage.
21- # @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response alongside a cancel function .
21+ # @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response.
2222 # Note: The block is only called with results of the final summary, not intermediate summaries.
2323 #
2424 # This method doesn't care if we already have an up to date summary. It always regenerate.
@@ -77,7 +77,7 @@ def latest_sha
7777
7878 # @param items { Array<Hash> } - Content to summarize. Structure will be: { poster: who wrote the content, id: a way to order content, text: content }
7979 # @param user { User } - User object used for auditing usage.
80- # @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response alongside a cancel function .
80+ # @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response.
8181 # Note: The block is only called with results of the final summary, not intermediate summaries.
8282 #
8383 # The summarization algorithm.
@@ -112,20 +112,20 @@ def fold(items, user, &on_partial_blk)
112112 summary = +""
113113
114114 buffer_blk =
115- Proc . new do |partial , cancel , _ , type |
115+ Proc . new do |partial , _ , type |
116116 if type == :structured_output
117117 json_summary_schema_key = bot . persona . response_format &.first . to_h
118118 partial_summary =
119119 partial . read_latest_buffered_chunk [ json_summary_schema_key [ :key ] . to_sym ]
120120
121121 if partial_summary . present?
122122 summary << partial_summary
123- on_partial_blk . call ( partial_summary , cancel ) if on_partial_blk
123+ on_partial_blk . call ( partial_summary ) if on_partial_blk
124124 end
125125 elsif type . blank?
126126 # Assume response is a regular completion.
127127 summary << partial
128- on_partial_blk . call ( partial , cancel ) if on_partial_blk
128+ on_partial_blk . call ( partial ) if on_partial_blk
129129 end
130130 end
131131
0 commit comments