Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0mza987 committed Mar 26, 2024
1 parent 2e8f20e commit ef04b15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def invoke(self):
chat_round = 0
chat_token = 0
chat_start_time = time.time()
self._conversation_history = []
while True:
chat_round += 1

Expand Down Expand Up @@ -160,6 +161,8 @@ def _get_role_input_values(self, role: ChatRole) -> Dict[str, Any]:
# initializing the chat role.
if value == "${parent.conversation_history}":
value = self._conversation_history
elif isinstance(value, str) and value.startswith("${"):
raise ChatGroupError(f"Unresolved input value {value!r} for role {role.role!r}.")
input_values[key] = value
logger.debug(f"Input values for role {role.role!r}: {input_values!r}")
return input_values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def _update_inputs_from_data_and_inputs(self, data: Dict, inputs: Dict):
if value.startswith(data_prefix):
stripped_value = value.replace(data_prefix, "").replace("}", "")
data_name, col_name = stripped_value.split(".")
if data_name in data:
if data_name in data and col_name in data[data_name]:
current_input["value"] = data[data_name][col_name]
elif value.startswith(inputs_prefix):
input_name = value.replace(inputs_prefix, "").replace("}", "")
if input_name in inputs:
if input_name in inputs and input_name in inputs:
current_input["value"] = inputs[input_name]

def invoke(self, *args, **kwargs):
Expand Down

0 comments on commit ef04b15

Please sign in to comment.