Skip to content

Commit

Permalink
Use response inside try block in computer.ai fast_llm
Browse files Browse the repository at this point in the history
  • Loading branch information
liangjs committed Dec 12, 2024
1 parent 21babb1 commit d22c37c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interpreter/core/computer/ai/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def fast_llm(llm, system_message, user_message):
llm.interpreter.system_message = system_message
llm.interpreter.messages = []
response = llm.interpreter.chat(user_message)
return response[-1].get("content")
finally:
llm.interpreter.messages = old_messages
llm.interpreter.system_message = old_system_message
return response[-1].get("content")


def query_map_chunks(chunks, llm, query):
Expand Down

0 comments on commit d22c37c

Please sign in to comment.