mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-10 08:13:47 +00:00
Added a prompt injection detection (#857)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
d3163badd9
commit
902a01a4d0
55 files changed
+5598
-70
No files matched your search
@@ -73,6 +73,14 @@ public static class ContentStreamSseHandler
|
||||
case ContentStreamErrorMetadata errorMetadata:
|
||||
return ContentStreamProcessedEvent.FromError(errorMetadata.Error);
|
||||
|
||||
//
|
||||
// The runtime filtered suspected prompt injections out of the content. The
|
||||
// content itself already arrived through the events before this one, so this
|
||||
// only reports what was removed.
|
||||
//
|
||||
case ContentStreamPromptInjectionMetadata promptInjectionMetadata:
|
||||
return ContentStreamProcessedEvent.FromPromptInjection(promptInjectionMetadata.PromptInjection);
|
||||
|
||||
default:
|
||||
return ContentStreamProcessedEvent.FromContent(sseEvent.Content);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user