summaryrefslogtreecommitdiffhomepage
path: root/lib/dispatch/adapter/response.rb
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-03-31 20:22:45 +0900
committerAdam Malczewski <[email protected]>2026-03-31 20:22:45 +0900
commit3e32dec579fbdedec8c7ddb881207b25bb342e60 (patch)
tree9db02b8f744fa2c1203b78e6c84a62f770bc1e73 /lib/dispatch/adapter/response.rb
parenta1eed75083df6afd4895a4438309319d2a9e5523 (diff)
downloaddispatch-adapter-copilot-3e32dec579fbdedec8c7ddb881207b25bb342e60.tar.gz
dispatch-adapter-copilot-3e32dec579fbdedec8c7ddb881207b25bb342e60.zip
imp
Diffstat (limited to 'lib/dispatch/adapter/response.rb')
-rw-r--r--lib/dispatch/adapter/response.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/dispatch/adapter/response.rb b/lib/dispatch/adapter/response.rb
new file mode 100644
index 0000000..d3e4789
--- /dev/null
+++ b/lib/dispatch/adapter/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(content: nil, tool_calls: [], model:, stop_reason:, usage:)
+ super(content:, tool_calls:, model:, stop_reason:, usage:)
+ 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(input_tokens:, output_tokens:, cache_read_tokens:, cache_creation_tokens:)
+ 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(type:, text:, tool_call_id:, tool_name:, argument_delta:)
+ end
+ end
+ end
+end