API Reference
This comprehensive API reference covers all the core components, decorators, and utilities available in the Foomstack framework.Core Decorators
@workflow
The function to be decorated as a workflow
The decorated workflow function with enhanced execution capabilities
@transformer
The function to be decorated as a transformer
The decorated transformer function with caching and tracing
Core Classes
WorkflowResult
Whether the workflow execution was successful
The result data from the workflow execution
Error message if the workflow failed
Total execution time in seconds
Detailed execution trace for debugging
Provider Classes
OpenAIProvider
OpenAI API key for authentication
The OpenAI model to use for completions
Sampling temperature between 0 and 2
Configured OpenAI client instance
AnthropicProvider
Anthropic API key for authentication
The Anthropic model to use for completions
Sampling temperature between 0 and 1
Configured Anthropic client instance
Utility Functions
cache_result
Time to live in seconds for cached results
Custom function to generate cache keys
parallel_map
Function to apply to each item
List of items to process
Maximum number of concurrent workers
List of results in the same order as input items
Configuration Classes
FoomstackConfig
Dictionary of configured providers by name
Configured caching backend
Whether tracing is enabled
Maximum number of retries for failed operations
Global timeout for operations in seconds
Error Classes
WorkflowError
Human-readable error message
Name of the workflow that failed
Name of the step that failed
Full Python traceback for debugging
ProviderError
Human-readable error message
Name of the provider that failed
HTTP status code if applicable
Seconds to wait before retrying