mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 03:23:50 +08:00
23 lines
505 B
Ruby
Vendored
23 lines
505 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module Completions
|
|
class ToolResult
|
|
attr_reader :content, :tool_call
|
|
|
|
def initialize(content:, tool_call:)
|
|
@content = content
|
|
@tool_call = tool_call
|
|
end
|
|
|
|
def to_s
|
|
"ToolResult for #{tool_call.name} (#{tool_call.id}): #{content}"
|
|
end
|
|
|
|
def ==(other)
|
|
return false if !other.is_a?(ToolResult)
|
|
content == other.content && tool_call == other.tool_call
|
|
end
|
|
end
|
|
end
|
|
end
|