Skip to content

Commit

Permalink
add argto construoctor to off logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchlak committed Oct 9, 2024
1 parent c2334d1 commit 21dc4d0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plotai/plotai.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def __init__(self, *args, **kwargs):
self.model_version = "gpt-3.5-turbo"
# DataFrame to plot
self.df, self.x, self.y, self.z = None, None, None, None
self.verbose = True

for expected_k in ["x", "y", "z", "df", "model_version"]:
for expected_k in ["x", "y", "z", "df", "model_version", "verbose"]:
if expected_k in kwargs:
setattr(self, expected_k, kwargs[expected_k])

Expand All @@ -25,12 +26,14 @@ def __init__(self, *args, **kwargs):

def make(self, prompt):
p = Prompt(prompt, self.df, self.x, self.y, self.z)

Logger().log({"title": "Prompt", "details": p.value})

if(self.verbose):
Logger().log({"title": "Prompt", "details": p.value})

response = ChatGPT(model=self.model_version).chat(p.value)

Logger().log({"title": "Response", "details": response})

if(self.verbose):
Logger().log({"title": "Response", "details": response})

executor = Executor()
error = executor.run(response, globals(), {"df":self.df, "x": self.x, "y": self.y, "z": self.z})
Expand Down

0 comments on commit 21dc4d0

Please sign in to comment.