ahensd commited on
Commit
b8d9e07
·
verified ·
1 Parent(s): 5b90a2e

Update client.py

Browse files
Files changed (1) hide show
  1. client.py +14 -12
client.py CHANGED
@@ -13,18 +13,20 @@ def create_client():
13
 
14
  def get_completion(ticket:model.Ticket):
15
  print("In get completion")
16
- client = create_client()
17
- prompt = create_prompt(ticket.subject, ticket.description)
18
- response = client.completions.create(
19
- model=os.environ.get('MODEL_NAME'),
20
- prompt=prompt,
21
- max_tokens=100,
22
- n=1,
23
- stop=None,
24
- temperature=0.7
25
- )
26
- result = response.choices[0].text.strip()
27
- print(result)
 
 
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):