Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Created December 23, 2024 00:45
Show Gist options
  • Save elijahbenizzy/1426ef5cba174395e0c6c6629a163490 to your computer and use it in GitHub Desktop.
Save elijahbenizzy/1426ef5cba174395e0c6c6629a163490 to your computer and use it in GitHub Desktop.
from burr.integrations.ray import RayExecutor
persister = SQLitePersister(db_path="./db")
persister.initialize()
app = (
ApplicationBuilder()
.with_actions(user_input, final_results, generate_all_poems=GenerateAllPoems())
.with_transitions(
("user_input", "generate_all_poems"),
("generate_all_poems", "final_results"),
)
.with_tracker(project="demo:parallel_agents_fault_tolerance")
.with_parallel_executor(RayExecutor)
.with_state_persister(persister)
.initialize_from(
persister,
resume_at_next_action=True,
default_state={},
default_entrypoint="user_input"
)
.with_identifiers(app_id=app_id)
.build()
)
return app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment