Spaces:
Runtime error
Runtime error
Update rag.py
Browse files
rag.py
CHANGED
@@ -37,7 +37,8 @@ class TicketResolver:
|
|
37 |
def generate_resolution(self,query, retrieved_resolutions):
|
38 |
combined_resolutions = " ".join([str(resolution) for resolution in retrieved_resolutions if pd.notna(resolution)])
|
39 |
# prompt = f"Based on these resolutions: {combined_resolutions}. Check if the query {query} has any related queries in combined_resolutions ,if found relatable queries Generate a generic resolution combining all matched ones : . If no matches or relatable issues are found in combing resolutions return a generic solution combining all :"
|
40 |
-
prompt = f"The query {query} might have resolution in combined_resolutions : {combined_resolutions}. Return final resolution if similar issue is present in combined_resolutions or return a generic one . The returned final resolution should be advice POV."
|
|
|
41 |
completion = self.genai_model.generate_content(prompt)
|
42 |
generated_answer = completion.text
|
43 |
return generated_answer
|
|
|
37 |
def generate_resolution(self,query, retrieved_resolutions):
|
38 |
combined_resolutions = " ".join([str(resolution) for resolution in retrieved_resolutions if pd.notna(resolution)])
|
39 |
# prompt = f"Based on these resolutions: {combined_resolutions}. Check if the query {query} has any related queries in combined_resolutions ,if found relatable queries Generate a generic resolution combining all matched ones : . If no matches or relatable issues are found in combing resolutions return a generic solution combining all :"
|
40 |
+
# prompt = f"The query {query} might have resolution in combined_resolutions : {combined_resolutions}. Return final resolution if similar issue is present in combined_resolutions or return a generic one . The returned final resolution should be advice POV."
|
41 |
+
prompt=f"Here is the current user query{query}, need a resolution for same. These are some example query and resolution {example_resolutions}, you may use them if relevant."
|
42 |
completion = self.genai_model.generate_content(prompt)
|
43 |
generated_answer = completion.text
|
44 |
return generated_answer
|