Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions core/agents/system_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def add_project_pages(ctx: RunContext) -> str:

return instruction
else:
return ""
# Some providers (e.g. Perplexity Sonar) reject empty system messages.
# Return an explicit no-op instruction instead of an empty string.
return "No internal project pages were provided for linking. Do not add internal links unless explicit URLs are provided in context."


def add_title_details(ctx: RunContext[BlogPostGenerationContext]) -> str:
Expand Down Expand Up @@ -150,7 +152,8 @@ def add_target_keywords(ctx: RunContext[BlogPostGenerationContext]) -> str:
Don't make them bold, just a regular part of the text.
""" # noqa: E501
else:
return ""
# Some providers reject empty system messages; keep this non-empty.
return "No specific SEO focus keywords were provided."


def add_webpage_content(ctx: RunContext[WebPageContent]) -> str:
Expand Down
3 changes: 2 additions & 1 deletion core/agents/title_suggestions_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def add_language_specification(ctx: RunContext[TitleSuggestionContext]) -> str:
@agent.system_prompt
def add_user_prompt(ctx: RunContext[TitleSuggestionContext]) -> str:
if not ctx.deps.user_prompt:
return ""
# Some providers reject empty system messages.
return "No additional user prompt was provided."

return f"""
IMPORTANT USER REQUEST: The user has specifically requested the following:
Expand Down