This commit is contained in:
Timothy Jaeryang Baek 2025-05-30 00:04:13 +04:00
parent 4371d2c5a5
commit 59768e34f4
2 changed files with 3 additions and 6 deletions

View File

@ -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>

View File

@ -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}"/>`
);
} }
} }