Skip to content

Commit

Permalink
Merge pull request #131 from haesleinhuepf/reset-history
Browse files Browse the repository at this point in the history
delete chat history when initializing
  • Loading branch information
haesleinhuepf authored May 17, 2024
2 parents dbab8e5 + 4877dd2 commit c4c79dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bia_bob/_machinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def combine_user_input(line, cell):


def init_assistant(model=DEFAULT_MODEL, auto_execute:bool = False, variables:dict=None, endpoint=None, api_key=None,
vision_model=DEFAULT_VISION_MODEL):
vision_model=DEFAULT_VISION_MODEL, keep_history:bool=False):
"""Initialises the assistant.
Parameters
Expand All @@ -142,6 +142,9 @@ def init_assistant(model=DEFAULT_MODEL, auto_execute:bool = False, variables:dic
else:
Context.variables = variables

if not keep_history:
Context.chat = []

endpoint, api_key = correct_endpoint(endpoint, api_key)

Context.endpoint = endpoint
Expand Down

0 comments on commit c4c79dc

Please sign in to comment.