Spaces:
Runtime error
Runtime error
Download server/utils/GeneralAdvice.py from WizardCoder2007/MANIT_Chat: direct link, hf CLI and curl.
- Browser
- Download file 776 Bytes
-
https://huggingface.co/spaces/WizardCoder2007/MANIT_Chat/resolve/main/server/utils/GeneralAdvice.py
- Command line
-
hf download hf://spaces/WizardCoder2007/MANIT_Chat/server/utils/GeneralAdvice.py
-
curl -L -o GeneralAdvice.py https://huggingface.co/spaces/WizardCoder2007/MANIT_Chat/resolve/main/server/utils/GeneralAdvice.py
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 |