Class: RubyLLM::MCP::Progress
- Inherits:
-
Object
- Object
- RubyLLM::MCP::Progress
- Defined in:
- lib/ruby_llm/mcp/progress.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
-
#progress_token ⇒ Object
readonly
Returns the value of attribute progress_token.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #execute_progress_handler ⇒ Object
-
#initialize(coordinator, progress_handler, progress_data) ⇒ Progress
constructor
A new instance of Progress.
- #to_h ⇒ Object (also: #to_json)
Constructor Details
#initialize(coordinator, progress_handler, progress_data) ⇒ Progress
Returns a new instance of Progress.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ruby_llm/mcp/progress.rb', line 8 def initialize(coordinator, progress_handler, progress_data) @coordinator = coordinator @client = coordinator.client @progress_handler = progress_handler @progress_token = progress_data["progressToken"] @progress = progress_data["progress"] @total = progress_data["total"] @message = progress_data["message"] end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/ruby_llm/mcp/progress.rb', line 6 def client @client end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/ruby_llm/mcp/progress.rb', line 6 def @message end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
6 7 8 |
# File 'lib/ruby_llm/mcp/progress.rb', line 6 def progress @progress end |
#progress_token ⇒ Object (readonly)
Returns the value of attribute progress_token.
6 7 8 |
# File 'lib/ruby_llm/mcp/progress.rb', line 6 def progress_token @progress_token end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
6 7 8 |
# File 'lib/ruby_llm/mcp/progress.rb', line 6 def total @total end |
Instance Method Details
#execute_progress_handler ⇒ Object
19 20 21 |
# File 'lib/ruby_llm/mcp/progress.rb', line 19 def execute_progress_handler @progress_handler.call(self) end |
#to_h ⇒ Object Also known as: to_json
23 24 25 26 27 28 29 30 |
# File 'lib/ruby_llm/mcp/progress.rb', line 23 def to_h { progress_token: @progress_token, progress: @progress, total: @total, message: @message } end |