Class: Assistant::TechnicalArticleToolBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/services/assistant/technical_article_tool_builder.rb

Overview

Employee-only Sunny tools for finding and reading approved internal Article
knowledge. Technical Articles and Procedures share the same freshness,
corpus, state, and citation guarantees while retaining focused tool names.

Defined Under Namespace

Classes: ProcedureReaderTool, ProcedureSearchTool, ReaderTool, SearchTool

Constant Summary collapse

ALLOWED_STATES =

Article states that may be exposed to the assistant.

%w[published internal].freeze
MAX_SEARCH_RESULTS =

Hard cap on how many search results a single tool call may return.

20
MAX_READER_RESULT_CHARS =

Hard cap on how many characters the reader tool may return.

60_000

Class Method Summary collapse

Class Method Details

.tools(account:) ⇒ Array<RubyLLM::Tool>

Returns the Technical Article tools the account is authorized to use.

Parameters:

  • account (Account, nil)

    current Sunny account.

Returns:

  • (Array<RubyLLM::Tool>)

    empty unless the account may read CRM articles.



430
431
432
433
434
# File 'app/services/assistant/technical_article_tool_builder.rb', line 430

def tools(account:)
  return [] unless EmployeeToolAuthorization.allowed?(, :read, Article)

  [search_tool, reader_tool, procedure_search_tool, procedure_reader_tool]
end