Skip to content

Commit 9e93084

Browse files
Enhance code comments (#846)
1 parent 630428f commit 9e93084

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

lib/langchain/assistant/messages/anthropic_message.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ class AnthropicMessage < Base
1212

1313
TOOL_ROLE = "tool_result"
1414

15+
# Initialize a new Anthropic message
16+
#
17+
# @param role [String] The role of the message
18+
# @param content [String] The content of the message
19+
# @param tool_calls [Array<Hash>] The tool calls made in the message
20+
# @param tool_call_id [String] The ID of the tool call
1521
def initialize(role:, content: nil, tool_calls: [], tool_call_id: nil)
1622
raise ArgumentError, "Role must be one of #{ROLES.join(", ")}" unless ROLES.include?(role)
1723
raise ArgumentError, "Tool calls must be an array of hashes" unless tool_calls.is_a?(Array) && tool_calls.all? { |tool_call| tool_call.is_a?(Hash) }

lib/langchain/assistant/messages/google_gemini_message.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class GoogleGeminiMessage < Base
1515

1616
# Initialize a new Google Gemini message
1717
#
18-
# @param [String] The role of the message
19-
# @param [String] The content of the message
20-
# @param [Array<Hash>] The tool calls made in the message
21-
# @param [String] The ID of the tool call
18+
# @param role [String] The role of the message
19+
# @param content [String] The content of the message
20+
# @param tool_calls [Array<Hash>] The tool calls made in the message
21+
# @param tool_call_id [String] The ID of the tool call
2222
def initialize(role:, content: nil, tool_calls: [], tool_call_id: nil)
2323
raise ArgumentError, "Role must be one of #{ROLES.join(", ")}" unless ROLES.include?(role)
2424
raise ArgumentError, "Tool calls must be an array of hashes" unless tool_calls.is_a?(Array) && tool_calls.all? { |tool_call| tool_call.is_a?(Hash) }

lib/langchain/assistant/messages/ollama_message.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class OllamaMessage < Base
1616

1717
# Initialize a new OpenAI message
1818
#
19-
# @param [String] The role of the message
20-
# @param [String] The content of the message
21-
# @param [Array<Hash>] The tool calls made in the message
22-
# @param [String] The ID of the tool call
19+
# @param role [String] The role of the message
20+
# @param content [String] The content of the message
21+
# @param tool_calls [Array<Hash>] The tool calls made in the message
22+
# @param tool_call_id [String] The ID of the tool call
2323
def initialize(role:, content: nil, tool_calls: [], tool_call_id: nil)
2424
raise ArgumentError, "Role must be one of #{ROLES.join(", ")}" unless ROLES.include?(role)
2525
raise ArgumentError, "Tool calls must be an array of hashes" unless tool_calls.is_a?(Array) && tool_calls.all? { |tool_call| tool_call.is_a?(Hash) }

0 commit comments

Comments
 (0)