MCPcopy Create free account
hub / github.com/Chainlit/cookbook / main

Function main

local-llm/llama-cpp.py:36–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35@cl.on_chat_start
36def main():
37 template = """### System Prompt
38The following is a friendly conversation between a human and an AI optimized to generate source-code. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know:
39
40### Current conversation:
41{history}
42
43### User Message
44{input}
45
46### Assistant"""
47
48 prompt = PromptTemplate(template=template, input_variables=["history", "input"])
49
50 conversation = ConversationChain(
51 prompt=prompt, llm=llm, memory=ConversationBufferWindowMemory(k=10)
52 )
53
54 cl.user_session.set("conv_chain", conversation)
55
56
57@cl.on_message

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected