summaryrefslogtreecommitdiffhomepage
path: root/lib/dispatch/adapter/interface/response.rb
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-04-28 14:11:16 +0900
committerAdam Malczewski <[email protected]>2026-04-28 14:11:16 +0900
commit07277435c0688ad9f5fa682633b86b99ef5bb854 (patch)
tree3e650e97bcbd229f942330542a333dcad1844542 /lib/dispatch/adapter/interface/response.rb
downloaddispatch-adapter-interface-07277435c0688ad9f5fa682633b86b99ef5bb854.tar.gz
dispatch-adapter-interface-07277435c0688ad9f5fa682633b86b99ef5bb854.zip
update
Diffstat (limited to 'lib/dispatch/adapter/interface/response.rb')
-rw-r--r--lib/dispatch/adapter/interface/response.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/dispatch/adapter/interface/response.rb b/lib/dispatch/adapter/interface/response.rb
new file mode 100644
index 0000000..b4ba3eb
--- /dev/null
+++ b/lib/dispatch/adapter/interface/response.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Dispatch
+ module Adapter
+ Response = Struct.new(:content, :tool_calls, :model, :stop_reason, :usage, keyword_init: true) do
+ def initialize(model:, stop_reason:, usage:, content: nil, tool_calls: [])
+ super
+ end
+ end
+
+ Usage = Struct.new(:input_tokens, :output_tokens, :cache_read_tokens, :cache_creation_tokens, keyword_init: true) do
+ def initialize(input_tokens:, output_tokens:, cache_read_tokens: 0, cache_creation_tokens: 0)
+ super
+ end
+ end
+
+ StreamDelta = Struct.new(:type, :text, :tool_call_id, :tool_name, :argument_delta, keyword_init: true) do
+ def initialize(type:, text: nil, tool_call_id: nil, tool_name: nil, argument_delta: nil)
+ super
+ end
+ end
+ end
+end