MCPcopy
hub / github.com/docker/genai-stack / configure_llm_only_chain

Function configure_llm_only_chain

chains.py:101–114  ·  view source on GitHub ↗
(llm)

Source from the content-addressed store, hash-verified

99
100
101def configure_llm_only_chain(llm):
102 # LLM only response
103 template = """
104 You are a helpful assistant that helps a support agent with answering programming questions.
105 If you don't know the answer, just say that you don't know, you must not make up an answer.
106 """
107 system_message_prompt = SystemMessagePromptTemplate.from_template(template)
108 human_template = "{question}"
109 human_message_prompt = HumanMessagePromptTemplate.from_template(human_template)
110 chat_prompt = ChatPromptTemplate.from_messages(
111 [system_message_prompt, human_message_prompt]
112 )
113 chain = chat_prompt | llm | StrOutputParser()
114 return chain
115
116
117def configure_qa_rag_chain(llm, embeddings, embeddings_store_url, username, password):

Callers 2

api.pyFile · 0.90
bot.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected