mirror of
https://github.com/open-webui/open-webui
synced 2025-06-03 19:27:12 +00:00
refac
This commit is contained in:
parent
4371d2c5a5
commit
59768e34f4
@ -83,7 +83,7 @@ Want to learn more about Open WebUI's features? Check out our [Open WebUI docume
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
Warp • The intelligent terminal for developers
|
||||
<a href="https://warp.dev/open-webui">Warp</a> • The intelligent terminal for developers
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -842,7 +842,7 @@ export const removeAllDetails = (content) => {
|
||||
export const processDetails = (content) => {
|
||||
content = removeDetails(content, ['reasoning', 'code_interpreter']);
|
||||
|
||||
// This regex matches <details> tags with type="tool_calls" and captures their attributes to convert them to <tool_calls> tags
|
||||
// This regex matches <details> tags with type="tool_calls" and captures their attributes to convert them to a string
|
||||
const detailsRegex = /<details\s+type="tool_calls"([^>]*)>([\s\S]*?)<\/details>/gis;
|
||||
const matches = content.match(detailsRegex);
|
||||
if (matches) {
|
||||
@ -854,10 +854,7 @@ export const processDetails = (content) => {
|
||||
attributes[attributeMatch[1]] = attributeMatch[2];
|
||||
}
|
||||
|
||||
content = content.replace(
|
||||
match,
|
||||
`<tool_calls name="${attributes.name}" result="${attributes.result}"/>`
|
||||
);
|
||||
content = content.replace(match, `"${attributes.result}"`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user