Skip to content

Commit

Permalink
Merge pull request OpenNyAI#153 from kanak8278/abs_fsm_bug
Browse files Browse the repository at this point in the history
chore: Refactor credentials retrieval in abstract_fsm.py
  • Loading branch information
shreypandey authored Jul 18, 2024
2 parents b841e3e + f2f51d9 commit f0ba5b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/car_wash.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def __init__(self, send_message: callable, credentials: Dict[str, Any] = None):
self.plugins: Dict[str, AbstractFSM] = {}
self.variables = self.variable_names()
super().__init__(send_message=send_message)

def standard_ask_again(self, message=None):
self.status = Status.WAIT_FOR_ME
if message is None:
Expand Down Expand Up @@ -473,7 +473,7 @@ def on_enter_date_input(self):

def on_enter_date_logic(self):
self.status = Status.WAIT_FOR_ME
task = f"The user provides a date or day, convert it into a format of YYYY-MM-DD. Today's date is {datetime.now().strftime("%Y-%m-%d")} & Day is {datetime.now().strftime("%A")}. Format and modify the user input into the format required and if you could not be decide return None. Based on the user's input, return the output in json format: {{'result': <input>}}."
task = f"The user provides a date or day, convert it into a format of YYYY-MM-DD. Today's date is {datetime.now().strftime('%Y-%m-%d')} & Day is {datetime.now().strftime('%A')}. Format and modify the user input into the format required and if you could not be decide return None. Based on the user's input, return the output in json format: {{'result': <input>}}."

result = Parser.parse_user_input(
task,
Expand Down
10 changes: 5 additions & 5 deletions jb-manager-bot/jb_manager_bot/abstract_fsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,11 @@ def _on_enter_input_logic(
task,
options,
self.current_input,
azure_endpoint=self.credentials["AZURE_OPENAI_API_ENDPOINT"],
azure_openai_api_key=self.credentials["AZURE_OPENAI_API_KEY"],
azure_openai_api_version=self.credentials["AZURE_OPENAI_API_VERSION"],
openai_api_key=self.credentials["OPENAI_API_KEY"],
model=self.credentials["FAST_MODEL"],
azure_endpoint=self.credentials.get("AZURE_OPENAI_API_ENDPOINT"),
azure_openai_api_key=self.credentials.get("AZURE_OPENAI_API_KEY"),
azure_openai_api_version=self.credentials.get("AZURE_OPENAI_API_VERSION"),
openai_api_key=self.credentials.get("OPENAI_API_KEY"),
model=self.credentials.get("FAST_MODEL"),
)
if options:
result = result["id"]
Expand Down

0 comments on commit f0ba5b0

Please sign in to comment.