Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow turning reflection off #179

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/bia_bob/_machinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Context:
client = None
vision_client = None
plugins_enabled = True
use_reflection = True
seed = None # openai only
temperature = None # openai only
endpoint = None
Expand Down Expand Up @@ -154,7 +155,8 @@ def bob(line: str = None, cell: str = None):
if code is None:
output_text(text)
else:
code = refine_code(code)
if Context.use_reflection:
code = refine_code(code)

if code is not None:
p = get_ipython()
Expand Down Expand Up @@ -182,7 +184,7 @@ def combine_user_input(line, cell):


def init_assistant(model=None, auto_execute:bool = False, variables:dict=None, endpoint=None, api_key=None,
vision_model=None, keep_history:bool=False, silent:bool=False):
vision_model=None, keep_history:bool=False, silent:bool=False, use_reflection=True):
"""Initialises the assistant.

Parameters
Expand Down Expand Up @@ -251,6 +253,8 @@ def init_assistant(model=None, auto_execute:bool = False, variables:dict=None, e
Context.endpoint = endpoint
Context.api_key = api_key

Context.use_reflection = use_reflection

if Context.verbose:
print("Assistant initialised. You can now use it, e.g., copy and paste the"
"below two lines into the next cell and execute it."
Expand Down