Module: Nukitori
- Defined in:
- lib/nukitori.rb,
lib/nukitori/version.rb,
lib/nukitori/chat_factory.rb,
lib/nukitori/llm_extractor.rb,
lib/nukitori/response_parser.rb,
lib/nukitori/schema_extractor.rb,
lib/nukitori/schema_generator.rb,
lib/nukitori/html_preprocessor.rb
Defined Under Namespace
Classes: ChatFactory, HtmlPreprocessor, LlmExtractor, ResponseParser, SchemaExtractor, SchemaGenerator
Constant Summary collapse
- VERSION =
'0.1.1'
Class Method Summary collapse
-
.call(html, schema_path = nil, model: nil, prefix: nil, &block) ⇒ Hash
Main entry point - callable as Nukitori(html, 'schema.json') { schema }.
-
.configure ⇒ Object
Configure RubyLLM through Nukitori.
Class Method Details
.call(html, schema_path = nil, model: nil, prefix: nil, &block) ⇒ Hash
Main entry point - callable as Nukitori(html, 'schema.json') { schema }
69 70 71 72 73 74 75 76 77 |
# File 'lib/nukitori.rb', line 69 def call(html, schema_path = nil, model: nil, prefix: nil, &block) raise ArgumentError, 'Block required for schema definition' unless block_given? if schema_path extract_with_schema(html, schema_path, model:, prefix:, &block) else LlmExtractor.extract(html, model:, &block) end end |
.configure ⇒ Object
Configure RubyLLM through Nukitori
25 26 27 28 29 |
# File 'lib/nukitori.rb', line 25 def configure RubyLLM.configure do |config| yield config if block_given? end end |