Module: LangExtract
- Defined in:
- lib/langextract.rb,
lib/langextract/io.rb,
lib/langextract/config.rb,
lib/langextract/errors.rb,
lib/langextract/factory.rb,
lib/langextract/version.rb,
lib/langextract/core/data.rb,
lib/langextract/extractor.rb,
lib/langextract/core/types.rb,
lib/langextract/core/errors.rb,
lib/langextract/core/chunking.rb,
lib/langextract/core/resolver.rb,
lib/langextract/visualization.rb,
lib/langextract/core/prompting.rb,
lib/langextract/core/tokenizer.rb,
lib/langextract/providers/base.rb,
lib/langextract/core/annotation.rb,
lib/langextract/providers/router.rb,
lib/langextract/providers/ruby_llm.rb,
lib/langextract/core/format_handler.rb,
lib/langextract/core/prompt_validation.rb
Defined Under Namespace
Modules: Core, Factory, IO, Providers
Classes: Config, Extractor, ModelConfig, Visualization
Constant Summary
collapse
- CharInterval =
Core::CharInterval
- TokenInterval =
Core::TokenInterval
Core::Extraction
- Document =
Core::Document
- AnnotatedDocument =
Core::AnnotatedDocument
- ExampleData =
Core::ExampleData
- AlignmentStatus =
Core::AlignmentStatus
- Error =
Core::Error
- InvalidModelConfigError =
Core::InvalidModelConfigError
- ProviderConfigError =
Core::ProviderConfigError
- FormatParsingError =
Core::FormatParsingError
- PromptValidationError =
Core::PromptValidationError
- AlignmentError =
Core::AlignmentError
- IOFailure =
Core::IOFailure
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
30
31
32
|
# File 'lib/langextract.rb', line 30
def config
@config ||= Config.new
end
|
34
35
36
|
# File 'lib/langextract.rb', line 34
def configure
yield(config)
end
|
43
44
45
46
47
|
# File 'lib/langextract.rb', line 43
def (**kwargs)
text = kwargs.delete(:text)
documents = kwargs.delete(:documents)
Extractor.new(**kwargs).(text: text, documents: documents)
end
|
.reset_configuration! ⇒ Object
38
39
40
41
|
# File 'lib/langextract.rb', line 38
def reset_configuration!
@config = nil
Factory.reset_router!
end
|
.visualize(input) ⇒ Object
49
50
51
|
# File 'lib/langextract.rb', line 49
def visualize(input)
Visualization.new.render(input)
end
|