Spaces:
Runtime error
Runtime error
Rohan Kataria
commited on
Commit
·
bda58ae
1
Parent(s):
3b75bce
added del code
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ agent = ChatWrapper('openai', '') # default agnet_state
|
|
| 5 |
|
| 6 |
def update_agent(api_key: str, selection: str):
|
| 7 |
global agent
|
|
|
|
| 8 |
agent = ChatWrapper(chain_type=selection, api_key=api_key)
|
| 9 |
return agent # This is agent state
|
| 10 |
|
|
|
|
| 5 |
|
| 6 |
def update_agent(api_key: str, selection: str):
|
| 7 |
global agent
|
| 8 |
+
del agent # delete the old ChatWrapper instance
|
| 9 |
agent = ChatWrapper(chain_type=selection, api_key=api_key)
|
| 10 |
return agent # This is agent state
|
| 11 |
|