Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1119,18 +1119,15 @@ def rag_response(query):
|
|
| 1119 |
# Generate AI response with the retrieved context
|
| 1120 |
prompt = f"""
|
| 1121 |
Context:
|
| 1122 |
-
|
| 1123 |
-
|
| 1124 |
-
1. Use only the provided context to generate your answer.
|
| 1125 |
-
2. Match headings and content exactly as they appear in the knowledge base. Do not add, modify, or generalize content.
|
| 1126 |
-
|
| 1127 |
-
3. Maintain clarity and accuracy.
|
| 1128 |
-
|
| 1129 |
Question:
|
| 1130 |
{query}
|
| 1131 |
-
|
| 1132 |
Answer:
|
|
|
|
| 1133 |
"""
|
|
|
|
| 1134 |
llm = ChatOpenAI(model="gpt-4", temperature=0.2, api_key=openai_api_key)
|
| 1135 |
response = llm.invoke(prompt)
|
| 1136 |
|
|
|
|
| 1119 |
# Generate AI response with the retrieved context
|
| 1120 |
prompt = f"""
|
| 1121 |
Context:
|
| 1122 |
+
{context}
|
| 1123 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1124 |
Question:
|
| 1125 |
{query}
|
| 1126 |
+
|
| 1127 |
Answer:
|
| 1128 |
+
Please provide an exact and concise response based only on the context above.
|
| 1129 |
"""
|
| 1130 |
+
|
| 1131 |
llm = ChatOpenAI(model="gpt-4", temperature=0.2, api_key=openai_api_key)
|
| 1132 |
response = llm.invoke(prompt)
|
| 1133 |
|