Class: AssistantStreamEvent
Constant Summary
collapse
- EventType =
Types::Coercible::Symbol.enum(:text_start, :text_delta, :text_end, :tool_start, :tool_delta, :tool_end, :tool_result_start, :tool_result_delta, :tool_result_end, :reasoning_start, :reasoning_delta, :reasoning_end)
Instance Method Summary
collapse
Instance Method Details
140
141
142
143
144
145
146
147
148
149
|
# File 'lib/llm_gateway/adapters/structs.rb', line 140
def content
case type
when :text_end
finalized_content_block&.text
when :reasoning_end
finalized_content_block&.reasoning
when :tool_end
finalized_content_block
end
end
|
#reasoning ⇒ Object
155
156
157
|
# File 'lib/llm_gateway/adapters/structs.rb', line 155
def reasoning
content if type == :reasoning_end
end
|
151
152
153
|
# File 'lib/llm_gateway/adapters/structs.rb', line 151
def text
content if type == :text_end
end
|
159
160
161
|
# File 'lib/llm_gateway/adapters/structs.rb', line 159
def tool_call
finalized_content_block if type == :tool_end
end
|