Tensorlake
- Introduction
- Quickstart
- Playground
- Auth and Access
Document Ingestion
- Overview
- File Management
- Parsing Documents
Workflows
- Overview
- Programming Guide
- Dependencies
- Secrets
Webhooks
- Overview
- Configuration
- Document Ingestion
- Workflows
- Testing Webhooks
FAQ
Open Source
Programming Guide
Dynamic routing
Dynamic Routing
Functions can route data to different nodes based on custom logic, enabling dynamic branching.
Copy
Ask AI
@tensorlake_function()
def handle_error(text: str):
# Logic to handle error messages
pass
@tensorlake_function()
def handle_normal(text: str):
# Logic to process normal text
pass
# The function routes data into the handle_error and handle_normal based on the
# logic of the function.
@tensorlake_router()
def analyze_text(text: str) -> List[Union[handle_error, handle_normal]]:
if 'error' in text.lower():
return [handle_error]
else:
return [handle_normal]
Was this page helpful?
On this page
Assistant
Responses are generated using AI and may contain mistakes.