Module: Phronomy
- Defined in:
- lib/phronomy.rb,
lib/phronomy/eval.rb,
lib/phronomy/task.rb,
lib/phronomy/tool.rb,
lib/phronomy/agent.rb,
lib/phronomy/event.rb,
lib/phronomy/loader.rb,
lib/phronomy/context.rb,
lib/phronomy/metrics.rb,
lib/phronomy/runtime.rb,
lib/phronomy/testing.rb,
lib/phronomy/version.rb,
lib/phronomy/deadline.rb,
lib/phronomy/runnable.rb,
lib/phronomy/splitter.rb,
lib/phronomy/workflow.rb,
lib/phronomy/agent/fsm.rb,
lib/phronomy/tool/base.rb,
lib/phronomy/agent/base.rb,
lib/phronomy/embeddings.rb,
lib/phronomy/event_loop.rb,
lib/phronomy/task_group.rb,
lib/phronomy/async_queue.rb,
lib/phronomy/diagnostics.rb,
lib/phronomy/eval/runner.rb,
lib/phronomy/eval/scorer.rb,
lib/phronomy/fsm_session.rb,
lib/phronomy/llm_adapter.rb,
lib/phronomy/loader/base.rb,
lib/phronomy/token_usage.rb,
lib/phronomy/agent/runner.rb,
lib/phronomy/eval/dataset.rb,
lib/phronomy/eval/metrics.rb,
lib/phronomy/task/backend.rb,
lib/phronomy/tracing/base.rb,
lib/phronomy/vector_store.rb,
lib/phronomy/agent/handoff.rb,
lib/phronomy/configuration.rb,
lib/phronomy/output_parser.rb,
lib/phronomy/splitter/base.rb,
lib/phronomy/tool/mcp_tool.rb,
lib/phronomy/tool_executor.rb,
lib/phronomy/eval/eval_case.rb,
lib/phronomy/guardrail/base.rb,
lib/phronomy/embeddings/base.rb,
lib/phronomy/eval/comparison.rb,
lib/phronomy/prompt_template.rb,
lib/phronomy/tool/agent_tool.rb,
lib/phronomy/workflow_runner.rb,
lib/phronomy/agent/checkpoint.rb,
lib/phronomy/concurrency_gate.rb,
lib/phronomy/eval/eval_result.rb,
lib/phronomy/eval/scorer/base.rb,
lib/phronomy/knowledge_source.rb,
lib/phronomy/llm_adapter/base.rb,
lib/phronomy/state_store/base.rb,
lib/phronomy/workflow_context.rb,
lib/phronomy/agent/react_agent.rb,
lib/phronomy/context/assembler.rb,
lib/phronomy/loader/csv_loader.rb,
lib/phronomy/runtime/scheduler.rb,
lib/phronomy/tool/scope_policy.rb,
lib/phronomy/vector_store/base.rb,
lib/phronomy/agent/orchestrator.rb,
lib/phronomy/agent/shared_state.rb,
lib/phronomy/cancellation_scope.rb,
lib/phronomy/cancellation_token.rb,
lib/phronomy/generator_verifier.rb,
lib/phronomy/invocation_context.rb,
lib/phronomy/output_parser/base.rb,
lib/phronomy/task/fiber_backend.rb,
lib/phronomy/testing/fake_clock.rb,
lib/phronomy/runtime/timer_queue.rb,
lib/phronomy/task/thread_backend.rb,
lib/phronomy/tracing/null_tracer.rb,
lib/phronomy/agent/suspend_signal.rb,
lib/phronomy/context/token_budget.rb,
lib/phronomy/context/trim_context.rb,
lib/phronomy/llm_adapter/ruby_llm.rb,
lib/phronomy/blocking_adapter_pool.rb,
lib/phronomy/eval/scorer/llm_judge.rb,
lib/phronomy/knowledge_source/base.rb,
lib/phronomy/runtime/gate_registry.rb,
lib/phronomy/runtime/pool_registry.rb,
lib/phronomy/runtime/task_registry.rb,
lib/phronomy/runtime/timer_service.rb,
lib/phronomy/state_store/in_memory.rb,
lib/phronomy/vector_store/pgvector.rb,
lib/phronomy/agent/team_coordinator.rb,
lib/phronomy/loader/markdown_loader.rb,
lib/phronomy/runtime/fake_scheduler.rb,
lib/phronomy/task/immediate_backend.rb,
lib/phronomy/testing/fake_scheduler.rb,
lib/phronomy/vector_store/in_memory.rb,
lib/phronomy/context/token_estimator.rb,
lib/phronomy/context/trigger_context.rb,
lib/phronomy/eval/scorer/exact_match.rb,
lib/phronomy/runtime/runtime_metrics.rb,
lib/phronomy/tracing/langfuse_tracer.rb,
lib/phronomy/agent/concerns/retryable.rb,
lib/phronomy/agent/parallel_tool_chat.rb,
lib/phronomy/loader/plain_text_loader.rb,
lib/phronomy/runtime/thread_scheduler.rb,
lib/phronomy/guardrail/input_guardrail.rb,
lib/phronomy/output_parser/json_parser.rb,
lib/phronomy/testing/scheduler_helpers.rb,
lib/phronomy/vector_store/redis_search.rb,
lib/phronomy/agent/concerns/suspendable.rb,
lib/phronomy/context/compaction_context.rb,
lib/phronomy/guardrail/output_guardrail.rb,
lib/phronomy/vector_store/async_backend.rb,
lib/phronomy/eval/scorer/includes_scorer.rb,
lib/phronomy/splitter/recursive_splitter.rb,
lib/phronomy/agent/concerns/guardrailable.rb,
lib/phronomy/splitter/fixed_size_splitter.rb,
lib/phronomy/context/context_version_cache.rb,
lib/phronomy/tracing/open_telemetry_tracer.rb,
lib/phronomy/embeddings/ruby_llm_embeddings.rb,
lib/phronomy/knowledge_source/rag_knowledge.rb,
lib/phronomy/agent/before_completion_context.rb,
lib/phronomy/output_parser/structured_parser.rb,
lib/phronomy/runtime/deterministic_scheduler.rb,
lib/phronomy/runtime/scheduler_timer_adapter.rb,
lib/phronomy/agent/concerns/before_completion.rb,
lib/phronomy/agent/concerns/error_translation.rb,
lib/phronomy/knowledge_source/entity_knowledge.rb,
lib/phronomy/knowledge_source/static_knowledge.rb,
lib/phronomy/guardrail/prompt_injection_guardrail.rb
Defined Under Namespace
Modules: Agent, Context, Diagnostics, Embeddings, Eval, Guardrail, KnowledgeSource, LLMAdapter, Loader, Metrics, OutputParser, Runnable, Splitter, StateStore, Testing, Tool, ToolExecutor, Tracing, VectorStore, WorkflowContext Classes: ActionTimeoutError, AsyncQueue, AuthenticationError, BackpressureError, BlockingAdapterPool, CancellationError, CancellationScope, CancellationToken, ConcurrencyGate, Configuration, ConfigurationError, ContextLengthError, Deadline, Error, Event, EventLoop, FSMSession, GeneratorVerifier, GuardrailError, HandoffError, InvocationContext, LowConfidenceError, ParseError, PoolShutdownError, PromptTemplate, RateLimitError, RecursionLimitError, Runtime, SchedulerReentrancyError, ScopeTimeoutError, Task, TaskGroup, TimeoutError, TokenUsage, ToolError, TransportError, Workflow, WorkflowContextOwnershipError, WorkflowRunner
Constant Summary collapse
- VERSION =
"0.7.1"
Class Method Summary collapse
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
-
.reset_configuration! ⇒ Object
Resets the global Phronomy configuration to defaults.
-
.reset_runtime! ⇒ Object
Resets all Phronomy runtime state: configuration and the EventLoop singleton (if running).
-
.with_configuration {|config| ... } ⇒ Object
Yields the current Configuration object, then restores the original configuration on exit (even if the block raises).
Class Method Details
.configuration ⇒ Object
122 123 124 |
# File 'lib/phronomy.rb', line 122 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
126 127 128 |
# File 'lib/phronomy.rb', line 126 def configure yield configuration end |
.reset_configuration! ⇒ Object
Resets the global Phronomy configuration to defaults.
Intended for test suites only. Calling this in a production process will drop all runtime configuration (tracer, model, tokenizer, etc.) globally and immediately affect all subsequent agent and workflow calls.
Parallel test suites warning: When tests run in parallel (e.g.
parallel_tests or parallel_rspec), +reset_configuration!+ in one
worker will clear configuration shared with other workers in the same
process. Prefer process-isolation strategies (forked workers) over
thread-based parallelism when using this method.
Typical usage in a sequential test suite: after { Phronomy.reset_configuration! }
144 145 146 |
# File 'lib/phronomy.rb', line 144 def reset_configuration! @configuration = Configuration.new end |
.reset_runtime! ⇒ Object
Resets all Phronomy runtime state: configuration and the EventLoop singleton (if running).
Intended for test suites only. Stops any running EventLoop thread, clears the EventLoop singleton, and resets configuration to defaults. Call once before/after each example to ensure test isolation.
177 178 179 180 |
# File 'lib/phronomy.rb', line 177 def reset_runtime! Phronomy::EventLoop.reset! @configuration = Configuration.new end |
.with_configuration {|config| ... } ⇒ Object
Yields the current Configuration object, then restores the original configuration on exit (even if the block raises).
Intended for test helpers that need to temporarily override settings without permanently mutating the global configuration.
160 161 162 163 164 165 |
# File 'lib/phronomy.rb', line 160 def with_configuration original = @configuration&.dup yield configuration ensure @configuration = original end |