Skip to content

Commit

Permalink
parsing error fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje committed Sep 13, 2024
1 parent 8aaba85 commit b315571
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions fastagency/runtime/autogen/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"^\\x1b\\[32m\\*\\*\\*\\*\\* Suggested tool call \\((call_[a-zA-Z0-9]+)\\): ([a-zA-Z0-9_]+) \\*\\*\\*\\*\\*\\x1b\\[0m\\n$",
"^\\*\\*\\*\\*\\* Suggested tool call \\((call_[a-zA-Z0-9]+)\\): ([a-zA-Z0-9_]+) \\*\\*\\*\\*\\*\\n$",
),
"stars": ("^\\x1b\\[32m(\\*{80}\\*+)\\x1b\\[0m\n$", "^(\\*{80}\\*+)\\n$"),
"stars": ("^\\x1b\\[32m(\\*{69}\\*+)\\x1b\\[0m\n$", "^(\\*{69}\\*+)\\n$"),
"function_call_execution": (
"^\\x1b\\[35m\\n>>>>>>>> EXECUTING FUNCTION ([a-zA-Z_]+)...\\x1b\\[0m\\n$",
"^\\n>>>>>>>> EXECUTING FUNCTION ([a-zA-Z_]+)...\\n$",
Expand Down Expand Up @@ -124,9 +124,14 @@ def process_chunk(self, chunk: str) -> bool: # noqa: C901
pass
else:
if self.type == "suggested_function_call":
# logger.info("CurrentMessage.process_chunk(): parsing arguments")
arguments_json: str = _findall("arguments", chunk) # type: ignore[assignment]
self.arguments = json.loads(arguments_json)
if _match("arguments", chunk):
# logger.info("CurrentMessage.process_chunk(): parsing arguments")
arguments_json: str = _findall("arguments", chunk) # type: ignore[assignment]
self.arguments = json.loads(arguments_json)
else:
logger.warning(
f"CurrentMessage.process_chunk(): unexpected chunk: {chunk=}, {self=}"
)
elif self.type == "function_call_execution":
# logger.info("CurrentMessage.process_chunk(): parsing retval")
self.retval = chunk
Expand Down

0 comments on commit b315571

Please sign in to comment.