MCPcopy Create free account
hub / github.com/Azure-Samples/llama-index-python / get_chat_engine

Function get_chat_engine

backend/app/engine/__init__.py:6–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def get_chat_engine():
7 system_prompt = os.getenv("SYSTEM_PROMPT")
8 top_k = os.getenv("TOP_K", 3)
9
10 index = get_index()
11 if index is None:
12 raise HTTPException(
13 status_code=500,
14 detail=str(
15 "StorageContext is empty - call 'poetry run generate' to generate the storage first"
16 ),
17 )
18
19 return index.as_chat_engine(
20 similarity_top_k=int(top_k),
21 system_prompt=system_prompt,
22 chat_mode="condense_plus_context",
23 )

Callers

nothing calls this directly

Calls 1

get_indexFunction · 0.90

Tested by

no test coverage detected