mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +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>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
Warp • The intelligent terminal for developers
|
<a href="https://warp.dev/open-webui">Warp</a> • The intelligent terminal for developers
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -842,7 +842,7 @@ export const removeAllDetails = (content) => {
|
|||||||
export const processDetails = (content) => {
|
export const processDetails = (content) => {
|
||||||
content = removeDetails(content, ['reasoning', 'code_interpreter']);
|
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 detailsRegex = /<details\s+type="tool_calls"([^>]*)>([\s\S]*?)<\/details>/gis;
|
||||||
const matches = content.match(detailsRegex);
|
const matches = content.match(detailsRegex);
|
||||||
if (matches) {
|
if (matches) {
|
||||||
@ -854,10 +854,7 @@ export const processDetails = (content) => {
|
|||||||
attributes[attributeMatch[1]] = attributeMatch[2];
|
attributes[attributeMatch[1]] = attributeMatch[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
content = content.replace(
|
content = content.replace(match, `"${attributes.result}"`);
|
||||||
match,
|
|
||||||
`<tool_calls name="${attributes.name}" result="${attributes.result}"/>`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user