mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Fix AG MITM
This commit is contained in:
@@ -84,8 +84,10 @@ export function createSSEStream(options = {}) {
|
||||
|
||||
// Ensure OpenAI-required fields are present on streaming chunks (Letta compat)
|
||||
let fieldsInjected = false;
|
||||
if (!parsed.object) { parsed.object = "chat.completion.chunk"; fieldsInjected = true; }
|
||||
if (!parsed.created) { parsed.created = Math.floor(Date.now() / 1000); fieldsInjected = true; }
|
||||
if (parsed.choices !== undefined) {
|
||||
if (!parsed.object) { parsed.object = "chat.completion.chunk"; fieldsInjected = true; }
|
||||
if (!parsed.created) { parsed.created = Math.floor(Date.now() / 1000); fieldsInjected = true; }
|
||||
}
|
||||
|
||||
// Strip Azure-specific non-standard fields from streaming chunks
|
||||
if (parsed.prompt_filter_results !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user