Module: Smith

Extended by:
Dry::Configurable
Defined in:
lib/smith.rb,
lib/smith/cli.rb,
lib/smith/tool.rb,
lib/smith/agent.rb,
lib/smith/event.rb,
lib/smith/tools.rb,
lib/smith/trace.rb,
lib/smith/types.rb,
lib/smith/budget.rb,
lib/smith/doctor.rb,
lib/smith/errors.rb,
lib/smith/events.rb,
lib/smith/models.rb,
lib/smith/context.rb,
lib/smith/pricing.rb,
lib/smith/railtie.rb,
lib/smith/version.rb,
lib/smith/workflow.rb,
lib/smith/artifacts.rb,
lib/smith/events/bus.rb,
lib/smith/guardrails.rb,
lib/smith/tool/policy.rb,
lib/smith/tools/think.rb,
lib/smith/doctor/check.rb,
lib/smith/tool/capture.rb,
lib/smith/trace/logger.rb,
lib/smith/trace/memory.rb,
lib/smith/workflow/dsl.rb,
lib/smith/budget/ledger.rb,
lib/smith/doctor/report.rb,
lib/smith/agent/registry.rb,
lib/smith/artifacts/file.rb,
lib/smith/doctor/printer.rb,
lib/smith/models/profile.rb,
lib/smith/workflow/claim.rb,
lib/smith/agent/lifecycle.rb,
lib/smith/context/session.rb,
lib/smith/workflow/router.rb,
lib/smith/artifacts/memory.rb,
lib/smith/doctor/installer.rb,
lib/smith/models/inference.rb,
lib/smith/tools/web_search.rb,
lib/smith/guardrails/runner.rb,
lib/smith/models/normalizer.rb,
lib/smith/tools/url_fetcher.rb,
lib/smith/workflow/parallel.rb,
lib/smith/workflow/pipeline.rb,
lib/smith/doctor/checks/live.rb,
lib/smith/tool/compatibility.rb,
lib/smith/workflow/execution.rb,
lib/smith/doctor/checks/rails.rb,
lib/smith/events/subscription.rb,
lib/smith/workflow/durability.rb,
lib/smith/workflow/transition.rb,
lib/smith/persistence_adapters.rb,
lib/smith/trace/open_telemetry.rb,
lib/smith/workflow/persistence.rb,
lib/smith/events/step_completed.rb,
lib/smith/artifacts/scoped_store.rb,
lib/smith/doctor/checks/baseline.rb,
lib/smith/context/state_injection.rb,
lib/smith/guardrails/url_verifier.rb,
lib/smith/tool/budget_enforcement.rb,
lib/smith/tool/capability_builder.rb,
lib/smith/doctor/checks/durability.rb,
lib/smith/providers/openai/routing.rb,
lib/smith/workflow/execution_frame.rb,
lib/smith/doctor/checks/persistence.rb,
lib/smith/workflow/nested_execution.rb,
lib/smith/persistence_adapters/retry.rb,
lib/smith/providers/openai/responses.rb,
lib/smith/workflow/event_integration.rb,
lib/smith/context/observation_masking.rb,
lib/smith/doctor/checks/configuration.rb,
lib/smith/doctor/checks/serialization.rb,
lib/smith/persistence_adapters/memory.rb,
lib/smith/workflow/budget_integration.rb,
lib/smith/workflow/data_volume_policy.rb,
lib/smith/workflow/deterministic_step.rb,
lib/smith/workflow/parallel_execution.rb,
lib/smith/workflow/evaluator_optimizer.rb,
lib/smith/workflow/orchestrator_worker.rb,
lib/smith/doctor/checks/models_registry.rb,
lib/smith/doctor/checks/openai_api_mode.rb,
lib/smith/workflow/artifact_integration.rb,
lib/smith/workflow/deadline_enforcement.rb,
lib/smith/workflow/guardrail_integration.rb,
lib/smith/persistence_adapters/cache_store.rb,
lib/smith/persistence_adapters/rails_cache.rb,
lib/smith/persistence_adapters/redis_store.rb,
lib/smith/workflow/deterministic_execution.rb,
lib/smith/providers/openai/tools_extensions.rb,
lib/smith/doctor/checks/persistence_registry.rb,
lib/generators/smith/install/install_generator.rb,
lib/smith/doctor/checks/persistence_capabilities.rb,
lib/smith/persistence_adapters/active_record_store.rb

Defined Under Namespace

Modules: Artifacts, Budget, Doctor, Errors, Events, Models, PersistenceAdapters, Pricing, Providers, Tools, Trace, Types Classes: Agent, AgentError, AgentRegistryError, BlankAgentOutputError, BudgetExceeded, CLI, Context, DeadlineExceeded, DeterministicStepFailure, Error, Event, GuardrailFailed, Guardrails, InstallGenerator, MaxTransitionsExceeded, PersistenceIOError, PersistenceSchemaMismatch, PersistenceVersionConflict, Railtie, SeedMismatch, SerializationError, StepInProgressOnRestore, Tool, ToolGuardrailFailed, ToolPolicyDenied, UnresolvedTransitionError, Workflow, WorkflowError

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.artifactsObject



84
85
86
# File 'lib/smith.rb', line 84

def self.artifacts
  scoped_artifacts || config.artifact_store || (@_default_artifacts ||= Artifacts::Memory.new)
end

.artifacts=(store) ⇒ Object



88
89
90
# File 'lib/smith.rb', line 88

def self.artifacts=(store)
  config.artifact_store = store
end

.persistence_adapterObject



100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/smith.rb', line 100

def self.persistence_adapter
  raw_adapter = config.persistence_adapter
  raw_options = config.persistence_options || {}
  signature = persistence_signature(raw_adapter, raw_options, config.test_mode)

  if defined?(@_persistence_adapter_signature) && @_persistence_adapter_signature == signature
    return @_persistence_adapter
  end

  @_persistence_adapter_signature = signature
  @_persistence_adapter = resolve_persistence_adapter(raw_adapter, raw_options)
end

.scoped_artifactsObject



92
93
94
# File 'lib/smith.rb', line 92

def self.scoped_artifacts
  Thread.current[:smith_scoped_artifacts]
end

.scoped_artifacts=(store) ⇒ Object



96
97
98
# File 'lib/smith.rb', line 96

def self.scoped_artifacts=(store)
  Thread.current[:smith_scoped_artifacts] = store
end