Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 9cda4b6

Browse files
committed
all specs working at last
1 parent b0204df commit 9cda4b6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/completions/llm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def initialize(dialect_klass, gateway_klass, llm_model, gateway: nil)
307307
# @param response_format { Hash - Optional } - JSON schema passed to the API as the desired structured output.
308308
# @param [Experimental] extra_model_params { Hash - Optional } - Other params that are not available accross models. e.g. response_format JSON schema.
309309
#
310-
# @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response alongside a cancel function.
310+
# @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response.
311311
#
312312
# @returns String | ToolCall - Completion result.
313313
# if multiple tools or a tool and a message come back, the result will be an array of ToolCall / String objects.

lib/discord/bot/persona_replier.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def handle_interaction!
2424
full_reply =
2525
@bot.reply(
2626
{ conversation_context: [{ type: :user, content: @query }], skip_tool_details: true },
27-
) do |partial, _cancel, _something|
27+
) do |partial, _something|
2828
reply << partial
2929
next if reply.blank?
3030

lib/summarization/fold_content.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)