Commit graph

3 commits

Author SHA1 Message Date
Ishaan Samantray
cef7b3242b fix(openai-sdk): skip system prompt injection when no memories are found
add_system_prompt() modified the message list even when the memory
lookup returned nothing (memories == "").

- If an existing system prompt was present, " \n " (whitespace) was
  appended to its content.
- If no system prompt existed, a new {"role": "system", "content": ""}
  message was prepended.

Both cases pollute the conversation context with empty/whitespace tokens
that waste prompt budget and can confuse models sensitive to blank
system messages.

Fix: return messages unchanged when memories is falsy.
Adds a regression test covering both cases (with and without existing
system prompt).
2026-05-24 09:58:21 -04:00
sreedharsreeram
0104a2572c update open ai python sdk (#879) 2026-04-25 01:43:14 +00:00
nexxeln
ea9bf13d31 add openai middleware functionality for python sdk (#546)
add openai middleware functionality

fix critical type errors and linting issues

update readme with middleware documentation
2025-11-11 02:16:34 +00:00