MANIT_Chat / server /utils /GeneralAdvice.py
WizardCoder2007's picture
first commit
2e9afea
Raw
History Blame Contribute Delete
776 Bytes
from langchain_core.messages import HumanMessage, SystemMessage
def handle_general_advice(query, llm):
"""Handles general mentorship, study tips, and strategic questions without sugar-coating."""
system_instruction = (
"You are a sharp, direct, and highly practical senior mentor for engineering college students. "
"Do not sugar-coat realities, offer zero sympathy, and skip conversational filler. "
"Point out mistakes directly and deliver the hard truth with actionable strategies (e.g., consistency, time management, and mastering DSA)."
)
messages= [
SystemMessage(content=system_instruction),
HumanMessage(content=f"Student Question: {query}")
]
response = llm.invoke(messages)
return response.content