Spaces:
Sleeping
Sleeping
Update client.py
Browse files
client.py
CHANGED
|
@@ -13,18 +13,20 @@ def create_client():
|
|
| 13 |
|
| 14 |
def get_completion(ticket:model.Ticket):
|
| 15 |
print("In get completion")
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
return result
|
| 29 |
|
| 30 |
def create_prompt(subject:str, desc:str):
|
|
|
|
| 13 |
|
| 14 |
def get_completion(ticket:model.Ticket):
|
| 15 |
print("In get completion")
|
| 16 |
+
# hardcoding response for testing
|
| 17 |
+
result = "intent= Complaint\nsuggested_response= Issue Refund\nsummary= The customer is making a complaint. Suggested resolution is to issue a refund.\nmail=\nDear Customer,\n\nWe are sorry to hear that you have a complaint regarding your booking. We understand the inconvenience this has caused you and we would like to make things right. Our records show that you have requested a refund.\n\nWe have processed your refund request and you should receive the refund within 3-5 business days. We apologize"
|
| 18 |
+
# client = create_client()
|
| 19 |
+
# prompt = create_prompt(ticket.subject, ticket.description)
|
| 20 |
+
# response = client.completions.create(
|
| 21 |
+
# model=os.environ.get('MODEL_NAME'),
|
| 22 |
+
# prompt=prompt,
|
| 23 |
+
# max_tokens=100,
|
| 24 |
+
# n=1,
|
| 25 |
+
# stop=None,
|
| 26 |
+
# temperature=0.7
|
| 27 |
+
# )
|
| 28 |
+
# result = response.choices[0].text.strip()
|
| 29 |
+
# print(result)
|
| 30 |
return result
|
| 31 |
|
| 32 |
def create_prompt(subject:str, desc:str):
|