(
app_id: Optional[str] = None,
storage_dir: Optional[str] = "~/.burr",
hooks: Optional[List[LifecycleAdapter]] = None,
)
| 118 | |
| 119 | |
| 120 | def application( |
| 121 | app_id: Optional[str] = None, |
| 122 | storage_dir: Optional[str] = "~/.burr", |
| 123 | hooks: Optional[List[LifecycleAdapter]] = None, |
| 124 | ) -> Application: |
| 125 | # our initial knowledge base |
| 126 | |
| 127 | app = ( |
| 128 | ApplicationBuilder() |
| 129 | .with_state( |
| 130 | **{ |
| 131 | "question": "", |
| 132 | "chat_history": [], |
| 133 | } |
| 134 | ) |
| 135 | .with_graph(graph()) |
| 136 | .with_entrypoint("human_converse") |
| 137 | .with_tracker(project="demo_conversational-rag", params={"storage_dir": storage_dir}) |
| 138 | .with_identifiers(app_id=app_id, partition_key="sample_user") |
| 139 | .with_hooks(*hooks if hooks else []) |
| 140 | .build() |
| 141 | ) |
| 142 | return app |
| 143 | |
| 144 | |
| 145 | def main(): |
no test coverage detected