mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
refac
This commit is contained in:
parent
5d4505c685
commit
35bc831077
3 changed files with 8 additions and 0 deletions
|
|
@ -429,6 +429,9 @@ async def execute_code(
|
|||
"session_id": (
|
||||
__metadata__.get("session_id") if __metadata__ else None
|
||||
),
|
||||
"files": (
|
||||
__metadata__.get("files", []) if __metadata__ else []
|
||||
),
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4510,6 +4510,7 @@ async def streaming_chat_response_handler(response, ctx):
|
|||
"session_id": metadata.get(
|
||||
"session_id", None
|
||||
),
|
||||
"files": metadata.get("files", []),
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1679,6 +1679,10 @@ export const renderVegaVisualization = async (spec: string, i18n?: any) => {
|
|||
};
|
||||
|
||||
export const getCodeBlockContents = (content: string): object => {
|
||||
// Strip thinking/reasoning and other detail blocks before extracting code
|
||||
// to prevent code inside <details type="reasoning"> from being treated as artifacts
|
||||
content = removeAllDetails(content);
|
||||
|
||||
const codeBlockContents = content.match(/```[\s\S]*?```/g);
|
||||
|
||||
let codeBlocks = [];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue