[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
e451d2dae4
commit
92d22fd69c
1 changed files with 8 additions and 4 deletions
|
|
@ -1205,12 +1205,16 @@ async def openai_chat_completions(
|
|||
# Only strip closed pairs here (not open-ended)
|
||||
# so legitimate text after a tool block is kept.
|
||||
cumulative = _re.sub(
|
||||
r"<tool_call>.*?</tool_call>", "",
|
||||
cumulative, flags = _re.DOTALL,
|
||||
r"<tool_call>.*?</tool_call>",
|
||||
"",
|
||||
cumulative,
|
||||
flags = _re.DOTALL,
|
||||
)
|
||||
cumulative = _re.sub(
|
||||
r"<function=\w+>.*?</function>", "",
|
||||
cumulative, flags = _re.DOTALL,
|
||||
r"<function=\w+>.*?</function>",
|
||||
"",
|
||||
cumulative,
|
||||
flags = _re.DOTALL,
|
||||
)
|
||||
new_text = cumulative[len(prev_text) :]
|
||||
prev_text = cumulative
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue