File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11configured_endpoints : 8
22openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-573d364768ac1902ee5ed8b2485d3b293bda0ea8ff7898aef1a3fd6be79b594a.yml
33openapi_spec_hash : 107ec840f4330885dd2232a05a66fed7
4- config_hash : 0209737a4ab2a71afececb0ff7459998
4+ config_hash : ab1c1122e862f9bdb6db4df36d489701
Original file line number Diff line number Diff line change @@ -16,16 +16,14 @@ class Stream
1616 # @return [Enumerable<generic<Elem>>]
1717 private def iterator
1818 # rubocop:disable Metrics/BlockLength
19+ # rubocop:disable Lint/DuplicateBranch
1920 @iterator ||= Stagehand ::Internal ::Util . chain_fused ( @stream ) do |y |
20- consume = false
21-
2221 @stream . each do |msg |
23- next if consume
24-
2522 case msg
2623 in { data : String => data } if data . start_with? ( "{\" data\" :{\" status\" :\" finished\" " )
27- consume = true
28- next
24+ decoded = JSON . parse ( data , symbolize_names : true )
25+ unwrapped = Stagehand ::Internal ::Util . dig ( decoded , @unwrap )
26+ y << Stagehand ::Internal ::Type ::Converter . coerce ( @model , unwrapped )
2927 in { data : String => data } if data . start_with? ( "error" )
3028 decoded = Kernel . then do
3129 JSON . parse ( data , symbolize_names : true )
@@ -49,6 +47,7 @@ class Stream
4947 end
5048 end
5149 end
50+ # rubocop:enable Lint/DuplicateBranch
5251 # rubocop:enable Metrics/BlockLength
5352 end
5453 end
You can’t perform that action at this time.
0 commit comments