Skip to content

chore(dspy): remove unused to_openai_text_request mapper and helpers - #120

Open
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-dspy-remove-unused-to-openai-text-request-ma-9db6f5
Open

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-dspy-remove-unused-to-openai-text-request-ma-9db6f5

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 9, 2026

Copy link
Copy Markdown

Remove the to_openai_text_request function and its cascading dead code
(messages_to_text_prompt, text_config_kwargs, the section header, and the
corresponding docstring/__all__ entries). These symbols had no callers
anywhere in the codebase, tests, or docs. The actual text-completion path in
dspy/clients/lm.py (litellm_text_completion/alitellm_text_completion)
builds its prompt inline and does not use this mapper, so it never wired up
since the module was introduced.

📝 Changes Description

This MR/PR contains the following changes:

  • Removed to_openai_text_request (the only __all__ symbol with zero callers anywhere)
  • Removed messages_to_text_prompt and text_config_kwargs (their sole consumer was to_openai_text_request)
  • Removed the "DSPy request -> OpenAI text completions" section header
  • Updated the module docstring and __all__ to drop the references

✅ Contributor Checklist

  • Pre-Commit checks are passing (locally and remotely)
  • Title of your PR / MR corresponds to the required format
  • Commit message follows required format {label}(dspy): {message}

⚠️ Warnings

Detail: Dead Code

History


Dead Code PRs can be configured here.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown

Greptile Summary

Removes an unused OpenAI text-completion request mapper and its private helper functions.

  • Updates the module documentation and __all__ export list.
  • Leaves the active text-completion execution paths unchanged.

Confidence Score: 5/5

The PR appears safe to merge because the removed symbols are unused and the active text-completion paths remain intact.

No actionable failure remains; repository-wide reference checks found no consumers, and both synchronous and asynchronous text-completion functions independently construct their prompts.

Important Files Changed

Filename Overview
dspy/clients/openai_format.py Cleanly removes an unreferenced text-request mapper, its exclusively used helpers, and associated documentation/export entries.

Reviews (1): Last reviewed commit: "chore(dspy): remove unused to_openai_tex..." | Re-trigger Greptile

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.

1 participant