Skip to content

Refine paraphrase prompt; forward media modalities and support JSON mode - #11

Merged
hemanth-asirvatham merged 1 commit into
mainfrom
enhance-gabriel.paraphrase-for-multiple-formats
Feb 6, 2026
Merged

Refine paraphrase prompt; forward media modalities and support JSON mode#11
hemanth-asirvatham merged 1 commit into
mainfrom
enhance-gabriel.paraphrase-for-multiple-formats

Conversation

@hemanth-asirvatham

Copy link
Copy Markdown
Collaborator

Motivation

  • Improve paraphrase prompt clarity and fidelity to instructions while removing example blocks that confused guidance.
  • Support multimodal paraphrasing by forwarding image/audio/pdf attachments and clarifying behavior per modality.
  • Ensure callers can request JSON-only outputs when json_mode is enabled and surface modality/search settings through the API.

Description

  • Tighten and rework src/gabriel/prompts/paraphrase_prompt.jinja2 to remove examples, emphasize instruction fidelity, add concise modality guidance, and conditionally require JSON-only output when json_mode is set, with the final output wording changed to the requested phrasing.
  • Pass json_mode into prompt rendering and propagate modality/search options from the API by updating src/gabriel/tasks/paraphrase.py to forward prompt_images, prompt_audio, and prompt_pdfs to the underlying helper, call warn_if_modality_mismatch, and use load_image_inputs/load_audio_inputs/load_pdf_inputs when appropriate.
  • Expose modality and search_context_size on the paraphrase API in src/gabriel/api.py and wire defaults so web_search and search_context_size behave sensibly when modality == "web".
  • Update recursive generation to accept original values for media forwarding and pass search_context_size into get_all_responses.
  • Update tests in tests/test_basic.py to add test_paraphrase_modalities_forward_media and adapt existing paraphrase tests to the new signatures and behavior.

Testing

  • Added unit test test_paraphrase_modalities_forward_media and updated existing paraphrase tests in tests/test_basic.py to reflect the new API and media-forwarding behavior.
  • No automated test suite was executed as part of this rollout (prompt/template and code changes were prepared and committed but not run under pytest).

Codex Task

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@hemanth-asirvatham
hemanth-asirvatham merged commit d9483a5 into main Feb 6, 2026
1 check failed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant