Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAiPrompt: Ensure no empty content #824

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

arthurscchan
Copy link
Collaborator

OpenAI prompt are generally a list of prompts with role and content. Sometimes, prompt with empty content will confuse the OpenAI API and cause unexpected responses. This PR fixes the functions that handle prompt content addition to avoid adding new prompt if the content is empty.

@arthurscchan
Copy link
Collaborator Author

/gcbrun exp -n ascc-pr-824-1 -m vertex_ai_gemini-1-5 -i -b comparison

@arthurscchan arthurscchan marked this pull request as ready for review February 28, 2025 10:57
@arthurscchan
Copy link
Collaborator Author

/gcbrun exp -n ascc-pr-824-2 -m vertex_ai_gemini-1-5 -i -b comparison

Copy link
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we call any of these methods with an empty string, isn't there a problem already? I.e. a fix to silent return doesn't seem a smart choice here? In what contexts do we end up with empty strings?

We should at least log the cases IMO

@arthurscchan
Copy link
Collaborator Author

/gcbrun exp -n ascc-pr-824-3 -m vertex_ai_gemini-1-5 -i -b comparison

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants