Module: OxAiWorkers
- Defined in:
- lib/oxaiworkers/tool_definition.rb,
lib/ox-ai-workers.rb,
lib/oxaiworkers/engine.rb,
lib/oxaiworkers/request.rb,
lib/oxaiworkers/version.rb,
lib/oxaiworkers/iterator.rb,
lib/oxaiworkers/load_i18n.rb,
lib/oxaiworkers/tool/eval.rb,
lib/oxaiworkers/state_batch.rb,
lib/oxaiworkers/state_tools.rb,
lib/oxaiworkers/tool/pixels.rb,
lib/oxaiworkers/state_helper.rb,
lib/oxaiworkers/tool/wolfram.rb,
lib/oxaiworkers/tool/database.rb,
lib/oxaiworkers/tool/pipeline.rb,
lib/oxaiworkers/image_iterator.rb,
lib/oxaiworkers/module_request.rb,
lib/oxaiworkers/present_compat.rb,
lib/oxaiworkers/assistant/coder.rb,
lib/oxaiworkers/assistant/sysop.rb,
lib/oxaiworkers/delayed_request.rb,
lib/oxaiworkers/models/llm_base.rb,
lib/oxaiworkers/assistant/expert.rb,
lib/oxaiworkers/tool/file_system.rb,
lib/oxaiworkers/assistant/painter.rb,
lib/oxaiworkers/contextual_logger.rb,
lib/oxaiworkers/dependency_helper.rb,
lib/oxaiworkers/models/gemini_pro.rb,
lib/oxaiworkers/models/openai_max.rb,
lib/oxaiworkers/models/images_base.rb,
lib/oxaiworkers/models/openai_mini.rb,
lib/oxaiworkers/models/openai_nano.rb,
lib/oxaiworkers/assistant/localizer.rb,
lib/oxaiworkers/models/deepseek_max.rb,
lib/oxaiworkers/models/anthropic_max.rb,
lib/oxaiworkers/models/openai_dalle3.rb,
lib/oxaiworkers/assistant/module_base.rb,
lib/oxaiworkers/models/openai_whisper.rb,
lib/oxaiworkers/assistant/orchestrator.rb,
lib/oxaiworkers/models/openai_gpt_image.rb,
lib/oxaiworkers/models/stability_images.rb
Overview
Extends a class to be used as a tool in the assistant. A tool is a collection of functions (methods) used to perform specific tasks.
Usage
- Extend your class with ToolDefinition
- Use #define_function to define each function of the tool
Key Concepts
- #define_function: Defines a new function (method) for the tool
- ParameterBuilder#property: Defines properties for the function parameters
- ParameterBuilder#item: Alias for ParameterBuilder#property, used for array items
These methods support various data types and nested structures, allowing for flexible and expressive tool definitions.
Defined Under Namespace
Modules: Assistant, CamelizeCompat, DependencyHelper, LoadI18n, Models, PresentCompat, StateHelper, Tool, ToolDefinition Classes: Configuration, ConfigurationError, ContextualLogger, DelayedRequest, Engine, Error, ImageIterator, Iterator, ModuleRequest, Request, StateBatch, StateTools
Constant Summary collapse
- DEFAULT_MAX_TOKEN =
4096- VERSION =
'1.1.6'
Class Attribute Summary collapse
- .configuration ⇒ Object
-
.default_model ⇒ Object
Returns the value of attribute default_model.
-
.logger ⇒ Object
Returns the value of attribute logger.
Class Method Summary collapse
Class Attribute Details
.configuration ⇒ Object
98 99 100 |
# File 'lib/ox-ai-workers.rb', line 98 def self.configuration @configuration ||= OxAiWorkers::Configuration.new end |
.default_model ⇒ Object
Returns the value of attribute default_model.
87 88 89 |
# File 'lib/ox-ai-workers.rb', line 87 def default_model @default_model end |
.logger ⇒ Object
Returns the value of attribute logger.
86 87 88 |
# File 'lib/ox-ai-workers.rb', line 86 def logger @logger end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
102 103 104 |
# File 'lib/ox-ai-workers.rb', line 102 def self.configure yield(configuration) end |