Documentation
¶
Index ¶
- func ChunkTextMaxRows(ctrlTools *ToolsFactory, progress x_commons.ProgressCallback, text string, ...) (response *tool2.ToolsResponse)
- func ConvertFileToText(ctrlTools *ToolsFactory, progress x_commons.ProgressCallback, filename string) (response *tool2.ToolsResponse)
- func ConvertToText(ctrlTools *ToolsFactory, progress x_commons.ProgressCallback, ext string, ...) (response *tool2.ToolsResponse)
- type ToolsFactory
- func (instance *ToolsFactory) Add(name string, constructor tool.ToolsCtr) *ToolsFactory
- func (instance *ToolsFactory) Contains(name string) (response bool)
- func (instance *ToolsFactory) Get(name string) (response tool.ITool, err error)
- func (instance *ToolsFactory) GetUseCache() bool
- func (instance *ToolsFactory) Prefetch(name string) (err error)
- func (instance *ToolsFactory) PrefetchAll() (response []string)
- func (instance *ToolsFactory) SetUseCache(useCache bool) *ToolsFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkTextMaxRows ¶
func ChunkTextMaxRows(ctrlTools *ToolsFactory, progress x_commons.ProgressCallback, text string, maxRows int) (response *tool2.ToolsResponse)
func ConvertFileToText ¶
func ConvertFileToText(ctrlTools *ToolsFactory, progress x_commons.ProgressCallback, filename string) (response *tool2.ToolsResponse)
ConvertFileToText converts the specified file to text using the provided ToolsFactory and returns the result or an error.
func ConvertToText ¶
func ConvertToText(ctrlTools *ToolsFactory, progress x_commons.ProgressCallback, ext string, data []byte) (response *tool2.ToolsResponse)
Types ¶
type ToolsFactory ¶
type ToolsFactory struct {
// contains filtered or unexported fields
}
ToolsFactory is a struct for managing tool creation logic with optional caching of tool constructors.
func NewToolsFactory ¶
func NewToolsFactory(root string, logger gg_.ILogger) (instance *ToolsFactory)
func (*ToolsFactory) Add ¶
func (instance *ToolsFactory) Add(name string, constructor tool.ToolsCtr) *ToolsFactory
func (*ToolsFactory) Contains ¶
func (instance *ToolsFactory) Contains(name string) (response bool)
func (*ToolsFactory) Get ¶
func (instance *ToolsFactory) Get(name string) (response tool.ITool, err error)
func (*ToolsFactory) GetUseCache ¶
func (instance *ToolsFactory) GetUseCache() bool
func (*ToolsFactory) Prefetch ¶
func (instance *ToolsFactory) Prefetch(name string) (err error)
Prefetch ensures that the specified tool is initialized and optionally cached by the ToolsFactory.
func (*ToolsFactory) PrefetchAll ¶
func (instance *ToolsFactory) PrefetchAll() (response []string)
PrefetchAll initializes and populates a cache of tools by invoking all registered constructor functions.
func (*ToolsFactory) SetUseCache ¶
func (instance *ToolsFactory) SetUseCache(useCache bool) *ToolsFactory
Click to show internal directories.
Click to hide internal directories.