Rohan Kataria commited on
Commit
3b75bce
·
1 Parent(s): df3e40f

new change

Browse files
Files changed (1) hide show
  1. src/main.py +1 -7
src/main.py CHANGED
@@ -36,10 +36,6 @@ class ChatWrapper:
36
  raise ValueError(f'Invalid chain_type: {chain_type}')
37
  else:
38
  self.chain = None
39
-
40
- def clear_api_key(self):
41
- if hasattr(self, 'api_key'):
42
- del self.api_key
43
 
44
  def __call__(self, inp: str):
45
  self.lock.acquire()
@@ -52,8 +48,6 @@ class ChatWrapper:
52
  self.history.append((inp, output))
53
  except Exception as e:
54
  self.history.append((inp, f"An error occurred: {e}"))
55
- finally:
56
- self.clear_api_key() # API key is cleared after running each chain in the class
57
- self.lock.release()
58
 
59
  return self.history
 
36
  raise ValueError(f'Invalid chain_type: {chain_type}')
37
  else:
38
  self.chain = None
 
 
 
 
39
 
40
  def __call__(self, inp: str):
41
  self.lock.acquire()
 
48
  self.history.append((inp, output))
49
  except Exception as e:
50
  self.history.append((inp, f"An error occurred: {e}"))
51
+ self.lock.release()
 
 
52
 
53
  return self.history