Class: RailsAiContext::Tools::GetApi
- Defined in:
- lib/rails_ai_context/tools/get_api.rb
Constant Summary
Constants inherited from BaseTool
BaseTool::SESSION_CONTEXT, BaseTool::SHARED_CACHE
Class Method Summary collapse
Methods inherited from BaseTool
abstract!, abstract?, cache_key, cached_context, config, #dedupe_put_patch_routes, error_response, extract_method_source_from_file, extract_method_source_from_string, find_closest_match, fuzzy_find_key, inherited, introspection_warnings_note, not_found_response, paginate, rails_app, registered_tools, reset_all_caches!, reset_cache!, session_queries, session_record, session_reset!, set_call_params, text_response
Class Method Details
.call(detail: "standard", server_context: nil) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/rails_ai_context/tools/get_api.rb', line 28 def self.call(detail: "standard", server_context: nil) data = cached_context[:api] unless data.is_a?(Hash) && !data[:error] return text_response( "No API layer data available. Ensure the :api introspector is enabled in your " \ "rails_ai_context configuration.\n\n" \ "Example:\n```ruby\nRailsAiContext.configure do |config|\n config.introspectors << :api\nend\n```" ) end case detail when "summary" text_response(build_summary(data)) when "standard" text_response(build_standard(data)) when "full" text_response(build_full(data)) else text_response("Unknown detail level: #{detail}. Use summary, standard, or full.") end end |