MCPcopy Create free account
hub / github.com/apache/burr / application

Function application

examples/conversational-rag/simple_example/application.py:120–142  ·  view source on GitHub ↗
(
    app_id: Optional[str] = None,
    storage_dir: Optional[str] = "~/.burr",
    hooks: Optional[List[LifecycleAdapter]] = None,
)

Source from the content-addressed store, hash-verified

118
119
120def 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
145def main():

Callers 1

mainFunction · 0.70

Calls 9

ApplicationBuilderClass · 0.90
with_hooksMethod · 0.80
with_identifiersMethod · 0.80
with_trackerMethod · 0.80
with_entrypointMethod · 0.80
with_stateMethod · 0.80
graphFunction · 0.70
buildMethod · 0.45
with_graphMethod · 0.45

Tested by

no test coverage detected