full_streamを使います。
Rubyの項目値は汎用ハッシュであり、型付き項目の閉じたユニオンではありません。UIで使用するフィールドを検証し、未知の項目や将来追加されるプロバイダーイベントに備えたフォールバックを用意します。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Rubyエージェントの実行から、テキスト、推論、ツール、プロバイダー項目のイベントを取得します。
stream = agent.stream(input: prompt, client: client)
stream.item_stream.each do |item|
render_item(item)
end
result = stream.result
full_streamを使います。