Module: RubyLLM::Providers::Gemini::Streaming
- Included in:
- RubyLLM::Providers::Gemini
- Defined in:
- lib/ruby_llm/providers/gemini/streaming.rb
Overview
Streaming methods for the Gemini API implementation
Instance Method Summary collapse
Instance Method Details
#build_chunk(data) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ruby_llm/providers/gemini/streaming.rb', line 12 def build_chunk(data) Chunk.new( role: :assistant, model_id: extract_model_id(data), content: extract_content(data), input_tokens: extract_input_tokens(data), output_tokens: extract_output_tokens(data), tool_calls: extract_tool_calls(data) ) end |
#stream_url ⇒ Object
8 9 10 |
# File 'lib/ruby_llm/providers/gemini/streaming.rb', line 8 def stream_url "models/#{@model}:streamGenerateContent?alt=sse" end |