from foomstack.providers import OpenAIProviderprovider = OpenAIProvider(api_key="your-api-key",model="gpt-4",temperature=0.8)response = await provider.complete("Hello, world!")
API Reference
Complete API reference for Foomstack framework components and functions
from foomstack.providers import OpenAIProviderprovider = OpenAIProvider(api_key="your-api-key",model="gpt-4",temperature=0.8)response = await provider.complete("Hello, world!")
API Reference
This comprehensive API reference covers all the core components, decorators, and utilities available in the Foomstack framework.
Core Decorators
@workflow
Callable
The function to be decorated as a workflow
Callable
The decorated workflow function with enhanced execution capabilities
Defines a workflow that orchestrates multiple transformers. Workflows automatically handle dependency resolution, parallel execution, and error recovery.
from foomstack import workflow@workflowdef my_workflow(input_data: str) -> str: # Your workflow logic here pass
@transformer
Callable
The function to be decorated as a transformer
Callable
The decorated transformer function with caching and tracing
Transforms input data into output data with built-in caching, error handling, and observability.
from foomstack import transformer@transformerdef process_text(text: str) -> Dict[str, Any]: # Your transformation logic here pass
Core Classes
WorkflowResult
bool
Whether the workflow execution was successful
Any
The result data from the workflow execution
Optional[str]
Error message if the workflow failed
float
Total execution time in seconds
List[Dict]
Detailed execution trace for debugging
Container for workflow execution results with comprehensive metadata.
Provider Classes
OpenAIProvider
str
required
OpenAI API key for authentication
str
default:"gpt-4"
The OpenAI model to use for completions
float
default:"0.7"
Sampling temperature between 0 and 2
OpenAI
Configured OpenAI client instance
OpenAI provider implementation with automatic retry logic and error handling.
from foomstack.providers import OpenAIProviderprovider = OpenAIProvider(api_key="your-api-key",model="gpt-4",temperature=0.8)response = await provider.complete("Hello, world!")
AnthropicProvider
str
required
Anthropic API key for authentication
str
default:"claude-3-sonnet-20240229"
The Anthropic model to use for completions
float
default:"0.7"
Sampling temperature between 0 and 1
Anthropic
Configured Anthropic client instance
Anthropic provider implementation with streaming support and advanced features.
Utility Functions
cache_result
int
default:"3600"
Time to live in seconds for cached results
Optional[Callable]
default:"None"
Custom function to generate cache keys
Decorator for caching function results based on input parameters.
from foomstack.utils import cache_result@cache_result(ttl=1800) # Cache for 30 minutesdef expensive_computation(data: str) -> Dict: # Expensive operation here return result
parallel_map
Callable
Function to apply to each item
List[Any]
List of items to process
int
default:"4"
Maximum number of concurrent workers
List[Any]
List of results in the same order as input items
Apply a function to multiple items in parallel with automatic error handling.
Global configuration class for customizing Foomstack behavior.
Error Classes
WorkflowError
str
Human-readable error message
str
Name of the workflow that failed
str
Name of the step that failed
str
Full Python traceback for debugging
Custom exception class for workflow-related errors with detailed context.
ProviderError
str
Human-readable error message
str
Name of the provider that failed
Optional[int]
HTTP status code if applicable
Optional[int]
Seconds to wait before retrying
Custom exception class for provider-related errors with retry information.
Constants
DEFAULT_MODEL_TIMEOUT
DEFAULT_MODEL_TIMEOUT = 300 # 5 minutes
Default timeout for model API calls in seconds.
MAX_RETRY_ATTEMPTS
MAX_RETRY_ATTEMPTS = 3
Maximum number of retry attempts for failed operations.
CACHE_DEFAULT_TTL
CACHE_DEFAULT_TTL = 3600 # 1 hour
Default time-to-live for cached results in seconds.
Examples
See our examples section for complete working code samples demonstrating these APIs in action.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Foomstack","description":"Foomstack documentation site. Learn the basics and explore examples.","colors":{"primary":"#FF6A1A","light":"#F5F7FA","dark":"#1B1F2A"},"logo":{"light":"https://mintcdn.com/foomstack/JiNGaPY03V4JUf4O/images/full-logo-light.svg?fit=max\u0026auto=format\u0026n=JiNGaPY03V4JUf4O\u0026q=85\u0026s=dd27eb067ff120966f8a1407ad55affb","dark":"https://mintcdn.com/foomstack/mpGmLzLoN5BwuDw1/images/full-logo-dark.svg?fit=max\u0026auto=format\u0026n=mpGmLzLoN5BwuDw1\u0026q=85\u0026s=6e3f10adbdc8f1d5461c74dc8a04dbc2"},"favicon":"images/favicon.ico","api":{"playground":{"display":"interactive"}},"footer":{"socials":{"github":"https://github.com/foomstack"}},"seo":{},"integrations":{"ga4":{"measurementId":"GA_MEASUREMENT_ID"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode",{"title":"Edit on GitHub","description":"Suggest an edit to this page","icon":"github","href":"https://github.com/foomstack/foomstack_framework/edit/main/docs/{{page}}"}]},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"foomstack","hasAudioNarration":false,"actualSubdomain":"foomstack","customDomains":["foomstack.dev"],"gitSource":{"type":"github","owner":"foomstack-framework","repo":"foomstack-old","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae93eb26adaf11fe54f01a2:success","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"Docs","count":1},{"language":"default","tag":"Architecture","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".sidebar-group-header{font-size:1.2em}.sidebar-group-icon{font-size:1.2em}#sidebar-content a[href=\"/\"]{display:inline-flex!important;align-items:center!important;height:45px!important}#sidebar-content img.nav-logo{height:45px!important;width:auto!important;max-height:none!important;max-width:none!important}#navbar img.nav-logo.h-6{height:40px!important}#navbar img.nav-logo.max-w-48{max-width:none!important}#sidebar-content img.nav-logo.h-6{height:45px!important}#sidebar-content img.nav-logo.max-w-48{max-width:none!important}#sidebar-content #navigation-items{padding:20px!important}#sidebar-content details>summary,#sidebar-content [role=\"treeitem\"][aria-expanded],#sidebar-content .group-title{font-weight:700!important}#sidebar-content a[aria-current=\"page\"],#sidebar-content a[aria-current=\"true\"],#sidebar-content [data-active=\"true\"] a{background-color:rgba(255, 106, 26, 0.12)!important;color:#ff6a1a!important;border-left:3px solid #ff6a1a!important;border-radius:6px!important}#sidebar-content [data-active=\"true\"] a svg,#sidebar-content a[aria-current=\"page\"] svg,#sidebar-content a[aria-current=\"true\"] svg{color:#ff6a1a!important;stroke:#ff6a1a!important}#sidebar-content a:hover{background-color:rgba(255, 106, 26, 0.1)!important}#table-of-contents a[aria-current=\"true\"],#table-of-contents a[aria-current=\"page\"],#table-of-contents [data-active=\"true\"] a{color:#ff6a1a!important}#table-of-contents [aria-current]::before,#table-of-contents [data-active=\"true\"]::before{background-color:#ff6a1a!important}@media (min-width: 1024px){#navbar .lg\\:px-5,#navbar .lg\\:px-4{padding-left:10px!important;padding-right:10px!important}}#navbar .mx-4{margin-left:10px!important;margin-right:10px!important}"}]}
{"page":{"pagePath":"api","slug":"/api","pageMetadata":{"title":"API Reference","sidebarTitle":"API","icon":"square-code","description":"Complete API reference for Foomstack framework components and functions","href":"/api"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Complete API reference for Foomstack framework components and functions\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,ParamField,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`api-reference`,children:`API Reference`}),`\n`,_jsx(_components.p,{children:`This comprehensive API reference covers all the core components, decorators, and utilities available in the Foomstack framework.`}),`\n`,_jsx(Heading,{level:`2`,id:`core-decorators`,children:`Core Decorators`}),`\n`,_jsx(Heading,{level:`3`,id:`@workflow`,children:`@workflow`}),`\n`,_jsx(ParamField,{body:`func`,type:`Callable`,id:`param-func`,children:_jsx(_components.p,{children:`The function to be decorated as a workflow`})}),`\n`,_jsx(ResponseField,{name:`wrapped_function`,type:`Callable`,id:`param-wrapped-function`,children:_jsx(_components.p,{children:`The decorated workflow function with enhanced execution capabilities`})}),`\n`,_jsx(_components.p,{children:`Defines a workflow that orchestrates multiple transformers. Workflows automatically handle dependency resolution, parallel execution, and error recovery.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` workflow`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@workflow`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` my_workflow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`input_data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Your workflow logic here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`@transformer`,children:`@transformer`}),`\n`,_jsx(ParamField,{body:`func`,type:`Callable`,id:`param-func-1`,children:_jsx(_components.p,{children:`The function to be decorated as a transformer`})}),`\n`,_jsx(ResponseField,{name:`wrapped_function`,type:`Callable`,id:`param-wrapped-function-1`,children:_jsx(_components.p,{children:`The decorated transformer function with caching and tracing`})}),`\n`,_jsx(_components.p,{children:`Transforms input data into output data with built-in caching, error handling, and observability.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` transformer`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@transformer`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` process_text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> Dict[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, Any]:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Your transformation logic here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`core-classes`,children:`Core Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`workflowresult`,children:`WorkflowResult`}),`\n`,_jsx(ResponseField,{name:`success`,type:`bool`,id:`param-success`,children:_jsx(_components.p,{children:`Whether the workflow execution was successful`})}),`\n`,_jsx(ResponseField,{name:`data`,type:`Any`,id:`param-data`,children:_jsx(_components.p,{children:`The result data from the workflow execution`})}),`\n`,_jsx(ResponseField,{name:`error`,type:`Optional[str]`,id:`param-error`,children:_jsx(_components.p,{children:`Error message if the workflow failed`})}),`\n`,_jsx(ResponseField,{name:`execution_time`,type:`float`,id:`param-execution-time`,children:_jsx(_components.p,{children:`Total execution time in seconds`})}),`\n`,_jsx(ResponseField,{name:`trace`,type:`List[Dict]`,id:`param-trace`,children:_jsx(_components.p,{children:`Detailed execution trace for debugging`})}),`\n`,_jsx(_components.p,{children:`Container for workflow execution results with comprehensive metadata.`}),`\n`,_jsx(Heading,{level:`2`,id:`provider-classes`,children:`Provider Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`openaiprovider`,children:`OpenAIProvider`}),`\n`,_jsx(ParamField,{body:`api_key`,type:`str`,required:true,id:`param-api-key`,children:_jsx(_components.p,{children:`OpenAI API key for authentication`})}),`\n`,_jsx(ParamField,{body:`model`,type:`str`,default:`gpt-4`,id:`param-model`,children:_jsx(_components.p,{children:`The OpenAI model to use for completions`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`float`,default:`0.7`,id:`param-temperature`,children:_jsx(_components.p,{children:`Sampling temperature between 0 and 2`})}),`\n`,_jsx(ResponseField,{name:`client`,type:`OpenAI`,id:`param-client`,children:_jsx(_components.p,{children:`Configured OpenAI client instance`})}),`\n`,_jsx(_components.p,{children:`OpenAI provider implementation with automatic retry logic and error handling.`}),`\n`,`\n`,_jsx(Heading,{level:`3`,id:`anthropicprovider`,children:`AnthropicProvider`}),`\n`,_jsx(ParamField,{body:`api_key`,type:`str`,required:true,id:`param-api-key-1`,children:_jsx(_components.p,{children:`Anthropic API key for authentication`})}),`\n`,_jsx(ParamField,{body:`model`,type:`str`,default:`claude-3-sonnet-20240229`,id:`param-model-1`,children:_jsx(_components.p,{children:`The Anthropic model to use for completions`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`float`,default:`0.7`,id:`param-temperature-1`,children:_jsx(_components.p,{children:`Sampling temperature between 0 and 1`})}),`\n`,_jsx(ResponseField,{name:`client`,type:`Anthropic`,id:`param-client-1`,children:_jsx(_components.p,{children:`Configured Anthropic client instance`})}),`\n`,_jsx(_components.p,{children:`Anthropic provider implementation with streaming support and advanced features.`}),`\n`,_jsx(Heading,{level:`2`,id:`utility-functions`,children:`Utility Functions`}),`\n`,_jsx(Heading,{level:`3`,id:`cache_result`,children:`cache_result`}),`\n`,_jsx(ParamField,{body:`ttl`,type:`int`,default:`3600`,id:`param-ttl`,children:_jsx(_components.p,{children:`Time to live in seconds for cached results`})}),`\n`,_jsx(ParamField,{body:`key_func`,type:`Optional[Callable]`,default:`None`,id:`param-key-func`,children:_jsx(_components.p,{children:`Custom function to generate cache keys`})}),`\n`,_jsx(_components.p,{children:`Decorator for caching function results based on input parameters.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack.utils `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cache_result`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@cache_result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`ttl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Cache for 30 minutes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` expensive_computation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> Dict:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Expensive operation here`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`parallel_map`,children:`parallel_map`}),`\n`,_jsx(ParamField,{body:`func`,type:`Callable`,id:`param-func-2`,children:_jsx(_components.p,{children:`Function to apply to each item`})}),`\n`,_jsx(ParamField,{body:`items`,type:`List[Any]`,id:`param-items`,children:_jsx(_components.p,{children:`List of items to process`})}),`\n`,_jsx(ParamField,{body:`max_workers`,type:`int`,default:`4`,id:`param-max-workers`,children:_jsx(_components.p,{children:`Maximum number of concurrent workers`})}),`\n`,_jsx(ResponseField,{name:`results`,type:`List[Any]`,id:`param-results`,children:_jsx(_components.p,{children:`List of results in the same order as input items`})}),`\n`,_jsx(_components.p,{children:`Apply a function to multiple items in parallel with automatic error handling.`}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack.utils `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` parallel_map`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` process_item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(item)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`items `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"world\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"parallel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`results `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` parallel_map(process_item, items)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Results: [5, 5, 8, 10]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuration-classes`,children:`Configuration Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`foomstackconfig`,children:`FoomstackConfig`}),`\n`,_jsx(ResponseField,{name:`providers`,type:`Dict[str, Provider]`,id:`param-providers`,children:_jsx(_components.p,{children:`Dictionary of configured providers by name`})}),`\n`,_jsx(ResponseField,{name:`cache_backend`,type:`CacheBackend`,id:`param-cache-backend`,children:_jsx(_components.p,{children:`Configured caching backend`})}),`\n`,_jsx(ResponseField,{name:`tracing_enabled`,type:`bool`,id:`param-tracing-enabled`,children:_jsx(_components.p,{children:`Whether tracing is enabled`})}),`\n`,_jsx(ResponseField,{name:`max_retries`,type:`int`,id:`param-max-retries`,children:_jsx(_components.p,{children:`Maximum number of retries for failed operations`})}),`\n`,_jsx(ResponseField,{name:`timeout`,type:`float`,id:`param-timeout`,children:_jsx(_components.p,{children:`Global timeout for operations in seconds`})}),`\n`,_jsx(_components.p,{children:`Global configuration class for customizing Foomstack behavior.`}),`\n`,_jsx(Heading,{level:`2`,id:`error-classes`,children:`Error Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`workflowerror`,children:`WorkflowError`}),`\n`,_jsx(ResponseField,{name:`message`,type:`str`,id:`param-message`,children:_jsx(_components.p,{children:`Human-readable error message`})}),`\n`,_jsx(ResponseField,{name:`workflow_name`,type:`str`,id:`param-workflow-name`,children:_jsx(_components.p,{children:`Name of the workflow that failed`})}),`\n`,_jsx(ResponseField,{name:`step_name`,type:`str`,id:`param-step-name`,children:_jsx(_components.p,{children:`Name of the step that failed`})}),`\n`,_jsx(ResponseField,{name:`traceback`,type:`str`,id:`param-traceback`,children:_jsx(_components.p,{children:`Full Python traceback for debugging`})}),`\n`,_jsx(_components.p,{children:`Custom exception class for workflow-related errors with detailed context.`}),`\n`,_jsx(Heading,{level:`3`,id:`providererror`,children:`ProviderError`}),`\n`,_jsx(ResponseField,{name:`message`,type:`str`,id:`param-message-1`,children:_jsx(_components.p,{children:`Human-readable error message`})}),`\n`,_jsx(ResponseField,{name:`provider_name`,type:`str`,id:`param-provider-name`,children:_jsx(_components.p,{children:`Name of the provider that failed`})}),`\n`,_jsx(ResponseField,{name:`status_code`,type:`Optional[int]`,id:`param-status-code`,children:_jsx(_components.p,{children:`HTTP status code if applicable`})}),`\n`,_jsx(ResponseField,{name:`retry_after`,type:`Optional[int]`,id:`param-retry-after`,children:_jsx(_components.p,{children:`Seconds to wait before retrying`})}),`\n`,_jsx(_components.p,{children:`Custom exception class for provider-related errors with retry information.`}),`\n`,_jsx(Heading,{level:`2`,id:`constants`,children:`Constants`}),`\n`,_jsx(Heading,{level:`3`,id:`default_model_timeout`,children:`DEFAULT_MODEL_TIMEOUT`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`DEFAULT_MODEL_TIMEOUT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 300`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 5 minutes`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Default timeout for model API calls in seconds.`}),`\n`,_jsx(Heading,{level:`3`,id:`max_retry_attempts`,children:`MAX_RETRY_ATTEMPTS`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`MAX_RETRY_ATTEMPTS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Maximum number of retry attempts for failed operations.`}),`\n`,_jsx(Heading,{level:`3`,id:`cache_default_ttl`,children:`CACHE_DEFAULT_TTL`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`CACHE_DEFAULT_TTL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3600`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 1 hour`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Default time-to-live for cached results in seconds.`}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(_components.p,{children:[`See our `,_jsx(_components.a,{href:`/examples`,children:`examples section`}),` for complete working code samples demonstrating these APIs in action.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"API Reference","sidebarTitle":"API","icon":"square-code","description":"Complete API reference for Foomstack framework components and functions","href":"/api"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,ParamField,RequestExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`api-reference`,children:`API Reference`}),`\n`,_jsx(_components.p,{children:`This comprehensive API reference covers all the core components, decorators, and utilities available in the Foomstack framework.`}),`\n`,_jsx(Heading,{level:`2`,id:`core-decorators`,children:`Core Decorators`}),`\n`,_jsx(Heading,{level:`3`,id:`@workflow`,children:`@workflow`}),`\n`,_jsx(ParamField,{body:`func`,type:`Callable`,id:`param-func`,children:_jsx(_components.p,{children:`The function to be decorated as a workflow`})}),`\n`,_jsx(ResponseField,{name:`wrapped_function`,type:`Callable`,id:`param-wrapped-function`,children:_jsx(_components.p,{children:`The decorated workflow function with enhanced execution capabilities`})}),`\n`,_jsx(_components.p,{children:`Defines a workflow that orchestrates multiple transformers. Workflows automatically handle dependency resolution, parallel execution, and error recovery.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` workflow`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@workflow`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` my_workflow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`input_data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Your workflow logic here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`@transformer`,children:`@transformer`}),`\n`,_jsx(ParamField,{body:`func`,type:`Callable`,id:`param-func-1`,children:_jsx(_components.p,{children:`The function to be decorated as a transformer`})}),`\n`,_jsx(ResponseField,{name:`wrapped_function`,type:`Callable`,id:`param-wrapped-function-1`,children:_jsx(_components.p,{children:`The decorated transformer function with caching and tracing`})}),`\n`,_jsx(_components.p,{children:`Transforms input data into output data with built-in caching, error handling, and observability.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` transformer`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@transformer`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` process_text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> Dict[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, Any]:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Your transformation logic here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`core-classes`,children:`Core Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`workflowresult`,children:`WorkflowResult`}),`\n`,_jsx(ResponseField,{name:`success`,type:`bool`,id:`param-success`,children:_jsx(_components.p,{children:`Whether the workflow execution was successful`})}),`\n`,_jsx(ResponseField,{name:`data`,type:`Any`,id:`param-data`,children:_jsx(_components.p,{children:`The result data from the workflow execution`})}),`\n`,_jsx(ResponseField,{name:`error`,type:`Optional[str]`,id:`param-error`,children:_jsx(_components.p,{children:`Error message if the workflow failed`})}),`\n`,_jsx(ResponseField,{name:`execution_time`,type:`float`,id:`param-execution-time`,children:_jsx(_components.p,{children:`Total execution time in seconds`})}),`\n`,_jsx(ResponseField,{name:`trace`,type:`List[Dict]`,id:`param-trace`,children:_jsx(_components.p,{children:`Detailed execution trace for debugging`})}),`\n`,_jsx(_components.p,{children:`Container for workflow execution results with comprehensive metadata.`}),`\n`,_jsx(Heading,{level:`2`,id:`provider-classes`,children:`Provider Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`openaiprovider`,children:`OpenAIProvider`}),`\n`,_jsx(ParamField,{body:`api_key`,type:`str`,required:true,id:`param-api-key`,children:_jsx(_components.p,{children:`OpenAI API key for authentication`})}),`\n`,_jsx(ParamField,{body:`model`,type:`str`,default:`gpt-4`,id:`param-model`,children:_jsx(_components.p,{children:`The OpenAI model to use for completions`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`float`,default:`0.7`,id:`param-temperature`,children:_jsx(_components.p,{children:`Sampling temperature between 0 and 2`})}),`\n`,_jsx(ResponseField,{name:`client`,type:`OpenAI`,id:`param-client`,children:_jsx(_components.p,{children:`Configured OpenAI client instance`})}),`\n`,_jsx(_components.p,{children:`OpenAI provider implementation with automatic retry logic and error handling.`}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`Request`,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack.providers `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAIProvider`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`provider `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAIProvider(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`temperature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.8`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` provider.complete(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, world!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`3`,id:`anthropicprovider`,children:`AnthropicProvider`}),`\n`,_jsx(ParamField,{body:`api_key`,type:`str`,required:true,id:`param-api-key-1`,children:_jsx(_components.p,{children:`Anthropic API key for authentication`})}),`\n`,_jsx(ParamField,{body:`model`,type:`str`,default:`claude-3-sonnet-20240229`,id:`param-model-1`,children:_jsx(_components.p,{children:`The Anthropic model to use for completions`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`float`,default:`0.7`,id:`param-temperature-1`,children:_jsx(_components.p,{children:`Sampling temperature between 0 and 1`})}),`\n`,_jsx(ResponseField,{name:`client`,type:`Anthropic`,id:`param-client-1`,children:_jsx(_components.p,{children:`Configured Anthropic client instance`})}),`\n`,_jsx(_components.p,{children:`Anthropic provider implementation with streaming support and advanced features.`}),`\n`,_jsx(Heading,{level:`2`,id:`utility-functions`,children:`Utility Functions`}),`\n`,_jsx(Heading,{level:`3`,id:`cache_result`,children:`cache_result`}),`\n`,_jsx(ParamField,{body:`ttl`,type:`int`,default:`3600`,id:`param-ttl`,children:_jsx(_components.p,{children:`Time to live in seconds for cached results`})}),`\n`,_jsx(ParamField,{body:`key_func`,type:`Optional[Callable]`,default:`None`,id:`param-key-func`,children:_jsx(_components.p,{children:`Custom function to generate cache keys`})}),`\n`,_jsx(_components.p,{children:`Decorator for caching function results based on input parameters.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack.utils `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cache_result`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@cache_result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`ttl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Cache for 30 minutes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` expensive_computation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> Dict:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Expensive operation here`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`parallel_map`,children:`parallel_map`}),`\n`,_jsx(ParamField,{body:`func`,type:`Callable`,id:`param-func-2`,children:_jsx(_components.p,{children:`Function to apply to each item`})}),`\n`,_jsx(ParamField,{body:`items`,type:`List[Any]`,id:`param-items`,children:_jsx(_components.p,{children:`List of items to process`})}),`\n`,_jsx(ParamField,{body:`max_workers`,type:`int`,default:`4`,id:`param-max-workers`,children:_jsx(_components.p,{children:`Maximum number of concurrent workers`})}),`\n`,_jsx(ResponseField,{name:`results`,type:`List[Any]`,id:`param-results`,children:_jsx(_components.p,{children:`List of results in the same order as input items`})}),`\n`,_jsx(_components.p,{children:`Apply a function to multiple items in parallel with automatic error handling.`}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` foomstack.utils `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` parallel_map`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` process_item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(item)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`items `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"world\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"parallel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`results `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` parallel_map(process_item, items)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Results: [5, 5, 8, 10]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuration-classes`,children:`Configuration Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`foomstackconfig`,children:`FoomstackConfig`}),`\n`,_jsx(ResponseField,{name:`providers`,type:`Dict[str, Provider]`,id:`param-providers`,children:_jsx(_components.p,{children:`Dictionary of configured providers by name`})}),`\n`,_jsx(ResponseField,{name:`cache_backend`,type:`CacheBackend`,id:`param-cache-backend`,children:_jsx(_components.p,{children:`Configured caching backend`})}),`\n`,_jsx(ResponseField,{name:`tracing_enabled`,type:`bool`,id:`param-tracing-enabled`,children:_jsx(_components.p,{children:`Whether tracing is enabled`})}),`\n`,_jsx(ResponseField,{name:`max_retries`,type:`int`,id:`param-max-retries`,children:_jsx(_components.p,{children:`Maximum number of retries for failed operations`})}),`\n`,_jsx(ResponseField,{name:`timeout`,type:`float`,id:`param-timeout`,children:_jsx(_components.p,{children:`Global timeout for operations in seconds`})}),`\n`,_jsx(_components.p,{children:`Global configuration class for customizing Foomstack behavior.`}),`\n`,_jsx(Heading,{level:`2`,id:`error-classes`,children:`Error Classes`}),`\n`,_jsx(Heading,{level:`3`,id:`workflowerror`,children:`WorkflowError`}),`\n`,_jsx(ResponseField,{name:`message`,type:`str`,id:`param-message`,children:_jsx(_components.p,{children:`Human-readable error message`})}),`\n`,_jsx(ResponseField,{name:`workflow_name`,type:`str`,id:`param-workflow-name`,children:_jsx(_components.p,{children:`Name of the workflow that failed`})}),`\n`,_jsx(ResponseField,{name:`step_name`,type:`str`,id:`param-step-name`,children:_jsx(_components.p,{children:`Name of the step that failed`})}),`\n`,_jsx(ResponseField,{name:`traceback`,type:`str`,id:`param-traceback`,children:_jsx(_components.p,{children:`Full Python traceback for debugging`})}),`\n`,_jsx(_components.p,{children:`Custom exception class for workflow-related errors with detailed context.`}),`\n`,_jsx(Heading,{level:`3`,id:`providererror`,children:`ProviderError`}),`\n`,_jsx(ResponseField,{name:`message`,type:`str`,id:`param-message-1`,children:_jsx(_components.p,{children:`Human-readable error message`})}),`\n`,_jsx(ResponseField,{name:`provider_name`,type:`str`,id:`param-provider-name`,children:_jsx(_components.p,{children:`Name of the provider that failed`})}),`\n`,_jsx(ResponseField,{name:`status_code`,type:`Optional[int]`,id:`param-status-code`,children:_jsx(_components.p,{children:`HTTP status code if applicable`})}),`\n`,_jsx(ResponseField,{name:`retry_after`,type:`Optional[int]`,id:`param-retry-after`,children:_jsx(_components.p,{children:`Seconds to wait before retrying`})}),`\n`,_jsx(_components.p,{children:`Custom exception class for provider-related errors with retry information.`}),`\n`,_jsx(Heading,{level:`2`,id:`constants`,children:`Constants`}),`\n`,_jsx(Heading,{level:`3`,id:`default_model_timeout`,children:`DEFAULT_MODEL_TIMEOUT`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`DEFAULT_MODEL_TIMEOUT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 300`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 5 minutes`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Default timeout for model API calls in seconds.`}),`\n`,_jsx(Heading,{level:`3`,id:`max_retry_attempts`,children:`MAX_RETRY_ATTEMPTS`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`MAX_RETRY_ATTEMPTS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Maximum number of retry attempts for failed operations.`}),`\n`,_jsx(Heading,{level:`3`,id:`cache_default_ttl`,children:`CACHE_DEFAULT_TTL`}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`CACHE_DEFAULT_TTL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 3600`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 1 hour`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Default time-to-live for cached results in seconds.`}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(_components.p,{children:[`See our `,_jsx(_components.a,{href:`/examples`,children:`examples section`}),` for complete working code samples demonstrating these APIs in action.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"API Reference","sidebarTitle":"API","icon":"square-code","description":"Complete API reference for Foomstack framework components and functions","href":"/api"}}}},"mdxExtracts":{"tableOfContents":[{"title":"API Reference","slug":"api-reference","depth":1,"children":[]},{"title":"Core Decorators","slug":"core-decorators","depth":2,"children":[{"title":"@workflow","slug":"@workflow","depth":3,"children":[]},{"title":"@transformer","slug":"@transformer","depth":3,"children":[]}]},{"title":"Core Classes","slug":"core-classes","depth":2,"children":[{"title":"WorkflowResult","slug":"workflowresult","depth":3,"children":[]}]},{"title":"Provider Classes","slug":"provider-classes","depth":2,"children":[{"title":"OpenAIProvider","slug":"openaiprovider","depth":3,"children":[]},{"title":"AnthropicProvider","slug":"anthropicprovider","depth":3,"children":[]}]},{"title":"Utility Functions","slug":"utility-functions","depth":2,"children":[{"title":"cache_result","slug":"cache_result","depth":3,"children":[]},{"title":"parallel_map","slug":"parallel_map","depth":3,"children":[]}]},{"title":"Configuration Classes","slug":"configuration-classes","depth":2,"children":[{"title":"FoomstackConfig","slug":"foomstackconfig","depth":3,"children":[]}]},{"title":"Error Classes","slug":"error-classes","depth":2,"children":[{"title":"WorkflowError","slug":"workflowerror","depth":3,"children":[]},{"title":"ProviderError","slug":"providererror","depth":3,"children":[]}]},{"title":"Constants","slug":"constants","depth":2,"children":[{"title":"DEFAULT_MODEL_TIMEOUT","slug":"default_model_timeout","depth":3,"children":[]},{"title":"MAX_RETRY_ATTEMPTS","slug":"max_retry_attempts","depth":3,"children":[]},{"title":"CACHE_DEFAULT_TTL","slug":"cache_default_ttl","depth":3,"children":[]}]},{"title":"Examples","slug":"examples","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Request","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">from\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> foomstack.providers \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> OpenAIProvider\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">provider \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> OpenAIProvider(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">api_key\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"your-api-key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">model\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"gpt-4\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">temperature\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.8\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> provider.complete(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Hello, world!\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":[],"subdomain":"foomstack","siteName":"Foomstack","title":"API Reference - Foomstack","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-09-09T18:17:50.373Z","originalFileLocation":"api.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Complete API reference for Foomstack framework components and functions\">\u003cmeta data-mint-head name=\"application-name\" content=\"Foomstack\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"API Reference - Foomstack\">\u003cmeta data-mint-head property=\"og:description\" content=\"Complete API reference for Foomstack framework components and functions\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Foomstack\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://foomstack.dev/api\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://foomstack.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=API+Reference\u0026amp;description=Complete+API+reference+for+Foomstack+framework+components+and+functions\u0026amp;theme=3778473e6f3cb15224de76bf\u0026amp;signature=0edac02e43deacde444bfbdc00c0742ba7e1bf6810a2ab7a8188139b69c6b2b5\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"API Reference - Foomstack\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Complete API reference for Foomstack framework components and functions\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://foomstack.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=API+Reference\u0026amp;description=Complete+API+reference+for+Foomstack+framework+components+and+functions\u0026amp;theme=3778473e6f3cb15224de76bf\u0026amp;signature=0edac02e43deacde444bfbdc00c0742ba7e1bf6810a2ab7a8188139b69c6b2b5\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/foomstack/j59mHKLmo6tYQCEC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Foomstack\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF6A1A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://foomstack.dev/api\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Foomstack\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Foomstack\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api.md","siteName":"Foomstack","nav":{"global":null,"tabs":[{"tab":"Docs","icon":"book-open","groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"Overview","href":"/get-started/overview"},{"title":"Quickstart","href":"/get-started/quickstart"},{"title":"Installation","href":"/get-started/installation"},{"title":"Hello foomstack","href":"/get-started/hello-foomstack"},{"title":"Examples","href":"/get-started/examples"}]},{"group":"Architecture","icon":"sitemap","pages":[{"title":"Foomstack Philosophy","sidebarTitle":"The Foomstack Philosophy","href":"/architecture/foomstack-philosophy"},{"title":"Workflow graphs","href":"/architecture/workflow-graphs"},{"title":"Components","href":"/architecture/components"},{"title":"Context engineering","href":"/architecture/context-engineering"},{"title":"Events","href":"/architecture/events"},{"title":"Agents","href":"/architecture/agents"}]},{"group":"Execution","icon":"square-terminal","pages":[{"title":"Components API","href":"/execution/components-API"},{"title":"Cognitive components","href":"/execution/cognitive-components"},{"title":"Prompt composition","href":"/execution/prompt-composition"},{"title":"Structured outputs","href":"/execution/structured-outputs"},{"title":"Hooks","href":"/execution/hooks"},{"title":"Tools","href":"/execution/tools"},{"title":"RAG","href":"/execution/RAG"}]},{"group":"Operations","icon":"chart-network","pages":[{"title":"Observability replay","href":"/operations/observability-replay"},{"title":"Testing","href":"/operations/testing"},{"title":"Security","href":"/operations/security"},{"title":"Performance cost","href":"/operations/performance-cost"},{"title":"Caching","href":"/operations/caching"},{"title":"Deployment","href":"/operations/deployment"},{"title":"Troubleshooting error codes","href":"/operations/troubleshooting-error-codes"},{"title":"Configuration environment","href":"/operations/configuration-environment"},{"title":"Node ids and data model","href":"/architecture/node-ids-and-data-model"}]},{"group":"Reference","icon":"book-open","pages":[{"title":"Roadmap","href":"/reference/roadmap"},{"title":"Comparison","href":"/reference/comparison"},{"title":"Appendix","href":"/reference/appendix"},{"title":"Cli","href":"/reference/cli"},{"title":"Glossary","href":"/reference/glossary"},{"title":"Changelog","href":"/reference/changelog"}]}]},{"tab":"API reference","icon":"square-terminal","groups":[{"group":"Overview","icon":"book-open","pages":[{"title":"Overview","href":"/api-reference/overview"}]},{"group":"Decorators \u0026 hooks","icon":"code-2","pages":[{"title":"App","href":"/api-reference/decorators/app"},{"title":"Flow","href":"/api-reference/decorators/flow"},{"title":"Component","href":"/api-reference/decorators/component"},{"title":"Step","href":"/api-reference/decorators/step"},{"title":"Primitives","href":"/api-reference/decorators/primitives"},{"title":"Hooks","href":"/api-reference/decorators/hooks"}]}]}]},"basePath":"","title":"API Reference - Foomstack","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":["2b790eda92"],"chunks":["ApiExamples-4Sf3CFhl.js","usePlaygroundInputsStore-Ck91l6q0.js","shallow-DapBSR9G.js","utils-Dym31Pnf.js","utils-CddEzDcs.js","isEqual-Clu_sGzx.js","_Uint8Array-BcNtDki0.js","isObject-FP1Yky1u.js","CodeSnippets-DAVHdSX2.js","CodeSnippet-Be6AcO_D.js","snippetPresets-Dl5ZrD9W.js","style-to-object-BY3JEAdk.js","use-playground-group-access-CteWws2O.js","cloneDeep-D3fPbylz.js","v4-DIgz8zy6.js"]}