Reorganize tools

This commit is contained in:
Stanko K.R.
2025-08-13 08:19:48 +02:00
parent f6279b87cf
commit d0734775c3
8 changed files with 11 additions and 11 deletions
@@ -1,4 +1,4 @@
class Ai::Tool::ListCards < Ai::Tool
class Ai::ListCardsTool < Ai::Tool
description <<-MD
Lists all cards accessible by the current user.
The response is paginated so you may need to iterate through multiple pages to get the full list.
@@ -1,4 +1,4 @@
class Ai::Tool::ListCards::Filter < Ai::Tool::Filter
class Ai::ListCardsTool::Filter < Ai::Tool::Filter
register_filters(
query: :apply_search,
ids: :apply_ids_filter,
@@ -1,4 +1,4 @@
class Ai::Tool::ListCollections < Ai::Tool
class Ai::ListCollectionsTool < Ai::Tool
description <<-MD
Lists all collections accessible by the current user.
The response is paginated so you may need to iterate through multiple pages to get the full list.
@@ -1,4 +1,4 @@
class Ai::Tool::ListComments < Ai::Tool
class Ai::ListCommentsTool < Ai::Tool
description <<-MD
Lists all comments accessible by the current user.
The response is paginated so you may need to iterate through multiple pages to get the full list.
@@ -1,4 +1,4 @@
class Ai::Tool::ListComments::Filter < Ai::Tool::Filter
class Ai::ListCommentsTool::Filter < Ai::Tool::Filter
register_filters(
query: :apply_search,
ids: :apply_ids_filter,
@@ -1,4 +1,4 @@
class Ai::Tool::ListUsers < Ai::Tool
class Ai::ListUsersTool < Ai::Tool
description <<-MD
Lists all users accessible by the current user.
The response is paginated so you may need to iterate through multiple pages to get the full list.
@@ -1,4 +1,4 @@
class Ai::Tool::ListUsers::Filter < Ai::Tool::Filter
class Ai::ListUsersTool::Filter < Ai::Tool::Filter
register_filter :ids, :apply_ids_filter
private
@@ -63,10 +63,10 @@ class Conversation::Message::ResponseGenerator
def llm
RubyLLM.chat(model: llm_model).tap do |chat|
chat.with_tool(Ai::Tool::ListCards.new(user: message.owner))
chat.with_tool(Ai::Tool::ListCollections.new(user: message.owner))
chat.with_tool(Ai::Tool::ListComments.new(user: message.owner))
chat.with_tool(Ai::Tool::ListUsers.new(user: message.owner))
chat.with_tool(Ai::ListCardsTool.new(user: message.owner))
chat.with_tool(Ai::ListCollectionsTool.new(user: message.owner))
chat.with_tool(Ai::ListCommentsTool.new(user: message.owner))
chat.with_tool(Ai::ListUsersTool.new(user: message.owner))
chat.reset_messages!