DSPy: The framework for programming—not prompting—language models
This report summarizes scanner evidence for stanfordnlp/dspy, a Python project with 38,585 GitHub stars. SynthScan examined 144,796 lines of code across 632 source files, recording 3736 pattern matches distributed across 25 syntactic categories. The legacy adjusted pattern signal is 33.8 (High pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 2481 finding(s).
Are imports declared and package/API names verified? 623 finding(s).
Are wrappers, guards, and repeated structures necessary? 2651 finding(s).
Which changes need focused human review? 3736 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 3736 distinct pattern matches across 25 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/propose/dataset_summary_generator.py | 30 | def order_input_keys_in_string(unordered_repr): | CODE |
| LOW | dspy/propose/propose_base.py | 9 | def propose_instructions_for_program(self): | CODE |
| LOW | dspy/propose/propose_base.py | 12 | def propose_instruction_for_predictor(self): | CODE |
| LOW | dspy/propose/utils.py | 22 | def create_instruction_set_history_string(base_program, trial_logs, top_n): | CODE |
| LOW | dspy/propose/utils.py | 58 | def parse_list_of_instructions(instruction_string): | CODE |
| LOW | dspy/propose/utils.py | 70 | def get_program_instruction_set_string(program): | CODE |
| LOW | dspy/propose/utils.py | 78 | def create_predictor_level_history_string(base_program, predictor_i, trial_logs, top_n): | CODE |
| LOW | dspy/propose/grounded_proposer.py | 64 | def generate_instruction_class( | CODE |
| LOW | dspy/propose/grounded_proposer.py | 155 | def gather_examples_from_sets(candidate_sets, max_examples): | CODE |
| LOW⚡ | dspy/propose/grounded_proposer.py | 306 | def propose_instructions_for_program( | CODE |
| LOW⚡ | dspy/propose/grounded_proposer.py | 366 | def propose_instruction_for_predictor( | CODE |
| LOW | dspy/clients/base_lm.py | 124 | def supports_function_calling(self) -> bool: | CODE |
| LOW | dspy/clients/base_lm.py | 372 | def _extract_citations_from_response(self, choice): | CODE |
| LOW | dspy/clients/embedding.py | 169 | def _cached_compute_embeddings(model, batch_inputs, caching=True, **kwargs): | CODE |
| LOW | dspy/clients/embedding.py | 185 | async def _cached_acompute_embeddings(model, batch_inputs, caching=True, **kwargs): | CODE |
| LOW | dspy/clients/__init__.py | 86 | def configure_litellm_logging(level: str = "ERROR"): | CODE |
| LOW | dspy/clients/utils_finetune.py | 131 | def find_data_errors_completion(data_dict: dict[str, str]) -> str | None: | CODE |
| LOW | dspy/clients/utils_finetune.py | 164 | def find_data_error_chat_message(message: dict[str, Any]) -> str | None: | CODE |
| LOW⚡ | dspy/clients/openai.py | 124 | def is_terminal_training_status(status: TrainingStatus) -> bool: | CODE |
| LOW | dspy/clients/_litellm.py | 12 | def _configure_litellm_defaults(litellm: types.ModuleType) -> None: | CODE |
| LOW | dspy/clients/_litellm.py | 38 | def is_litellm_context_window_error(error: Exception) -> bool: | CODE |
| LOW | dspy/clients/lm.py | 37 | def _is_openai_reasoning_model(model: str) -> bool: | CODE |
| LOW | dspy/clients/lm.py | 327 | def supports_function_calling(self) -> bool: | CODE |
| LOW | dspy/clients/lm.py | 358 | def _get_cached_completion_fn(self, completion_fn, cache): | CODE |
| LOW | dspy/clients/lm.py | 645 | def _get_stream_completion_fn( | CODE |
| LOW | dspy/clients/lm.py | 790 | def litellm_responses_completion(request: dict[str, Any], num_retries: int, cache: dict[str, Any] | None = None): | CODE |
| LOW | dspy/clients/lm.py | 806 | async def alitellm_responses_completion(request: dict[str, Any], num_retries: int, cache: dict[str, Any] | None = None): | CODE |
| LOW | dspy/clients/lm.py | 822 | def _convert_chat_request_to_responses_request(request: dict[str, Any]): | CODE |
| LOW | dspy/clients/lm.py | 831 | def _add_dspy_identifier_to_headers(headers: dict[str, Any] | None = None): | CODE |
| LOW | dspy/clients/databricks.py | 273 | def _create_directory_in_databricks_unity_catalog(w: "WorkspaceClient", databricks_unity_catalog_path: str): | CODE |
| LOW | dspy/clients/databricks.py | 346 | def _validate_completion_data(data: dict[str, Any]): | CODE |
| LOW | dspy/retrievers/databricks_rm.py | 326 | def _query_via_databricks_sdk( | CODE |
| LOW⚡ | dspy/_vendor/lm15/auth.py | 187 | def extract_chatgpt_account_id(token: str) -> str | None: | CODE |
| LOW⚡ | dspy/_vendor/lm15/auth.py | 362 | def load_codex_cli_credential( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 233 | def load_claude_code_credential( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 262 | def read_claude_code_credential( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 272 | def refresh_claude_code_credential(refresh_token: str) -> LocalOAuthCredential: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 293 | def _write_claude_code_credential_unlocked(credential: LocalOAuthCredential, path: Path) -> None: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 306 | def write_claude_code_credential( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 315 | def get_claude_code_access_token( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 392 | def read_codex_cli_credential( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 402 | def refresh_codex_cli_credential(refresh_token: str) -> LocalOAuthCredential: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 424 | def write_codex_cli_credential( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 435 | def _write_codex_cli_credential_unlocked( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 457 | def get_codex_cli_access_token( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 613 | def _xai_credential_from_token_response( | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 746 | def _parse_xai_device_authorization(payload: dict[str, Any]) -> XaiDeviceAuthorization: | CODE |
| LOW | dspy/_vendor/lm15/_authlock.py | 298 | def write_private_json_atomic(path: Path, data: dict[str, Any]) -> None: | CODE |
| LOW | dspy/_vendor/lm15/compat.py | 33 | def _check_json_object_or_none(value: object, field_name: str) -> None: | CODE |
| LOW | dspy/_vendor/lm15/compat.py | 932 | def resolve_openai_chat_compat(partial: OpenAIChatCompat) -> ResolvedOpenAIChatCompat: | CODE |
| LOW | dspy/_vendor/lm15/compat.py | 1171 | def merge_openai_responses_compat( | CODE |
| LOW | dspy/_vendor/lm15/compat.py | 1192 | def resolve_openai_responses_compat(partial: OpenAIResponsesCompat) -> ResolvedOpenAIResponsesCompat: | CODE |
| LOW | dspy/_vendor/lm15/models.py | 34 | def _check_non_negative_or_none(value: float | None, field_name: str) -> None: | CODE |
| LOW | dspy/_vendor/lm15/models.py | 62 | def _check_json_object_or_none(value: object, field_name: str) -> None: | CODE |
| LOW⚡ | dspy/_vendor/lm15/serde.py | 1001 | def image_generation_request_to_dict(r: ImageGenerationRequest) -> dict[str, Any]: | CODE |
| LOW⚡ | dspy/_vendor/lm15/serde.py | 1011 | def image_generation_request_from_dict(d: dict[str, Any]) -> ImageGenerationRequest: | CODE |
| LOW⚡ | dspy/_vendor/lm15/serde.py | 1021 | def image_generation_response_to_dict(r: ImageGenerationResponse) -> dict[str, Any]: | CODE |
| LOW⚡ | dspy/_vendor/lm15/serde.py | 1043 | def speech_generation_request_to_dict(r: SpeechGenerationRequest) -> dict[str, Any]: | CODE |
| LOW⚡ | dspy/_vendor/lm15/serde.py | 1053 | def speech_generation_request_from_dict(d: dict[str, Any]) -> SpeechGenerationRequest: | CODE |
| LOW⚡ | dspy/_vendor/lm15/serde.py | 1063 | def speech_generation_response_to_dict(r: SpeechGenerationResponse) -> dict[str, Any]: | CODE |
| 1930 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | dspy/_vendor/lm15/auth.py | 359 | # ─── OpenAI Codex CLI (~/.codex/auth.json) ─────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/auth.py | 230 | # ─── Claude Code (~/.claude/.credentials.json) ─────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/auth.py | 507 | # ─── xAI Grok (device-code OAuth; lm15 store or Pi agent store) ────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/auth.py | 718 | # ─── xAI device-code login (RFC 8628) ──────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/auth.py | 864 | # ─── Uniform login entry point ─────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/authkit.py | 59 | # ─── PKCE (RFC 7636, S256) ─────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/authkit.py | 81 | # ─── Device-code polling (RFC 8628 §3.5) ───────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/authkit.py | 163 | # ─── Loopback callback listener ────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/authkit.py | 277 | # ─── lm15-owned credential store ───────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/compat.py | 25 | # ─── Shared helpers ────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/compat.py | 48 | # ─── OpenAI Responses API compatibility ────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/compat.py | 332 | # ─── OpenAI Chat Completions compatibility ─────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/compat.py | 946 | # ─── Anthropic Messages compatibility ─────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/compat.py | 1168 | # ─── Merge helpers ────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/models.py | 21 | # ─── Validation helpers ────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/models.py | 69 | # ─── Pricing ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/models.py | 122 | # ─── Endpoint-specific model capabilities ──────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/models.py | 192 | # ─── Registry ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/registry.py | 249 | # ─── declaring a provider (RouterConfig(providers=...)) ───────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/tools.py | 152 | # ─── JSON-value check (for defaults and enum/Literal members) ──────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/tools.py | 176 | # ─── Hint → schema mapping ─────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/tools.py | 533 | # ─── Public API ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/batch.py | 41 | # ─── Snapshot access ───────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/batch.py | 76 | # ─── Verbs (update the snapshot in place, return self) ─────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/serde.py | 999 | # ─── Media generation ──────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/serde.py | 1083 | # ─── Video generation ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 100 | # ─── Helpers ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 126 | # ─── Continuation state ────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 163 | # ─── Parts ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 298 | # ─── Messages ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 328 | # ─── Tools ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 361 | # ─── Config ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 447 | # ─── Cache resources ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 566 | # ─── Logprobs ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 616 | # ─── ErrorDetail ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 636 | # ─── Delta ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 735 | # ─── Usage ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 763 | # ─── StreamEvent ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 805 | # ─── Request / Response ───────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 868 | # ─── Batch ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 926 | # ─── Files ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 1127 | # ─── ModelInfo ─────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 1222 | # ─── AudioFormat ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 1240 | # ─── LiveConfig ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/serde.py | 1277 | # ─── LiveClientEvent / LiveServerEvent ─────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/access.py | 69 | # ─── The table ─────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/access.py | 177 | # ─── Responses servers reached through OpenAILM ──────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/access.py | 205 | # ─── Chat Completions servers reached through OpenAIChatLM ─────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/access.py | 303 | # ─── Anthropic Messages servers reached through AnthropicLM ───────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/access.py | 627 | # ─── Credential loading, keyed by provider ─────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 196 | # ── Stream assembly ────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 205 | # ── Model metadata (catalog hydration) ────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 208 | # ── Router (lm15.router) ───────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 219 | # ── Connection budget (lm15.transports) ─────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 222 | # ── MAP-13 adaptations (lm15.adaptation) ────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 225 | # ── Tool derivation (lm15.tools) ───────────────────────────────────── | COMMENT |
| MEDIUM⚡ | dspy/_vendor/lm15/__init__.py | 235 | # ── Judgments (changes/2026-09-17-judgments.md) ───────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/__init__.py | 63 | # ── Canonical types ────────────────────────────────────────────────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/__init__.py | 145 | # ── Access policies (auth by composition; spec/auth.md AUTH-10) ────── | COMMENT |
| MEDIUM | dspy/_vendor/lm15/__init__.py | 148 | # ── Errors ─────────────────────────────────────────────────────────── | COMMENT |
| 214 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/__init__.py | 3 | CODE | |
| LOW | dspy/__init__.py | 4 | CODE | |
| LOW | dspy/__init__.py | 5 | CODE | |
| LOW | dspy/__init__.py | 6 | CODE | |
| LOW | dspy/__init__.py | 7 | CODE | |
| LOW | dspy/__init__.py | 8 | CODE | |
| LOW | dspy/__init__.py | 9 | CODE | |
| LOW | dspy/__init__.py | 11 | CODE | |
| LOW | dspy/__init__.py | 12 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 13 | CODE | |
| LOW | dspy/__init__.py | 14 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 15 | CODE | |
| LOW | dspy/__init__.py | 38 | CODE | |
| LOW | dspy/__init__.py | 38 | CODE | |
| LOW | dspy/__init__.py | 39 | CODE | |
| LOW | dspy/__init__.py | 40 | CODE | |
| LOW | dspy/__init__.py | 42 | CODE | |
| LOW | dspy/__init__.py | 43 | CODE | |
| LOW | dspy/__init__.py | 46 | CODE | |
| LOW | dspy/__init__.py | 47 | CODE | |
| LOW | dspy/__init__.py | 47 | CODE | |
| LOW | dspy/__init__.py | 47 | CODE | |
| LOW | dspy/__init__.py | 47 | CODE | |
| LOW | dspy/__init__.py | 47 | CODE | |
| LOW | dspy/lm15.py | 27 | CODE | |
| LOW | dspy/lm15.py | 29 | CODE | |
| 515 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | dspy/propose/utils.py | 63 | except json.JSONDecodeError: | CODE |
| HIGH | dspy/clients/execution.py | 566 | except Exception: | CODE |
| HIGH | dspy/clients/lm_local.py | 222 | except Exception: | CODE |
| HIGH | dspy/clients/engines/lifecycle.py | 18 | except Exception: | CODE |
| HIGH | dspy/retrievers/embeddings.py | 152 | except ImportError: | CODE |
| HIGH | dspy/_vendor/lm15/_authlock.py | 322 | except OSError: # pragma: no cover - permission oddities are best-effort | CODE |
| HIGH | dspy/_vendor/lm15/_authlock.py | 331 | except OSError: # pragma: no cover - fsync of dir is best-effort | CODE |
| HIGH | dspy/_vendor/lm15/_authlock.py | 242 | except OSError: | CODE |
| HIGH | dspy/_vendor/lm15/_authlock.py | 317 | except OSError: | CODE |
| HIGH | dspy/_vendor/lm15/compat.py | 532 | except KeyError: | CODE |
| HIGH | dspy/_vendor/lm15/vet.py | 203 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/result.py | 652 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/result.py | 1180 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/providers/gemini.py | 1162 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/providers/openai.py | 1392 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/providers/xai.py | 266 | except ValueError: | CODE |
| HIGH | dspy/_vendor/lm15/providers/base.py | 117 | except (TypeError, ValueError, OverflowError): | CODE |
| HIGH | dspy/_vendor/lm15/transports/_ssl.py | 30 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_types.py | 107 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_types.py | 199 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_proxy.py | 72 | except Exception: # pragma: no cover — platform lookup quirks bypass nothing | CODE |
| HIGH | dspy/_vendor/lm15/transports/_fetch.py | 173 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_fetch.py | 165 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_async.py | 126 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_async.py | 137 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_async.py | 141 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_async.py | 490 | except OSError: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_async.py | 520 | except OSError: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_sync.py | 114 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_sync.py | 419 | except OSError: | CODE |
| HIGH | dspy/_vendor/lm15/transports/_sync.py | 428 | except Exception: | CODE |
| HIGH | dspy/_vendor/lm15/cloud/chains.py | 538 | except ValueError: | CODE |
| HIGH | dspy/signatures/signature.py | 735 | except ImportError: | CODE |
| HIGH | dspy/datasets/alfworld/alfworld.py | 75 | except RuntimeError: | CODE |
| HIGH | dspy/utils/parallelizer.py | 196 | except Exception: | CODE |
| HIGH | dspy/utils/pickle_by_value.py | 56 | except ValueError: | CODE |
| HIGH | dspy/streaming/streaming_listener.py | 288 | except ValueError: | CODE |
| HIGH | dspy/streaming/streaming_listener.py | 265 | except ValueError: | CODE |
| HIGH | dspy/primitives/python_interpreter.py | 364 | except ProcessLookupError: | CODE |
| HIGH | dspy/primitives/base_module.py | 121 | except Exception: | CODE |
| HIGH | dspy/adapters/types/base_type.py | 56 | except TypeError: | CODE |
| HIGH | dspy/adapters/types/citation.py | 203 | except Exception: | CODE |
| HIGH | dspy/predict/refine.py | 205 | except TypeError: | CODE |
| HIGH | dspy/teleprompt/simba_utils.py | 239 | except (TypeError, orjson.JSONEncodeError): | CODE |
| HIGH | dspy/teleprompt/gepa/gepa_flex_utils.py | 45 | except Exception: | CODE |
| HIGH | tests/clients/test_lm_async_execution.py | 69 | except (BrokenPipeError, ConnectionResetError): | CODE |
| HIGH | tests/signatures/test_adapter_image.py | 447 | except Exception: | CODE |
| HIGH | tests/signatures/test_adapter_file.py | 20 | except Exception: | CODE |
| HIGH | tests/utils/test_usage_tracker.py | 513 | except RuntimeError: | CODE |
| HIGH | tests/adapters/conftest.py | 59 | except StopAdapterCallCapture: | CODE |
| HIGH | tests/adapters/test_baml_adapter.py | 336 | except Exception: | CODE |
| HIGH | tests/adapters/test_resource_loading.py | 44 | except (ValueError, TypeError): | CODE |
| HIGH | tests/adapters/test_resource_loading.py | 55 | except (ValueError, TypeError, ValidationError): | CODE |
| HIGH | tests/flex/test_flex_interpreter.py | 456 | except Exception: | CODE |
| HIGH | tests/flex/test_flex_interpreter.py | 476 | except Exception: | CODE |
| HIGH | docs/hooks/fetch_stats.py | 65 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/propose/dataset_summary_generator.py | 82 | except Exception as e: | CODE |
| LOW | dspy/propose/grounded_proposer.py | 222 | except Exception as e: | CODE |
| MEDIUM | dspy/propose/grounded_proposer.py | 224 | print(f"Error getting program description. Running without program aware proposer. Error: {e}") | CODE |
| LOW | dspy/propose/grounded_proposer.py | 289 | except Exception as e: | CODE |
| MEDIUM | dspy/propose/grounded_proposer.py | 290 | print(f"Error getting source code: {e}.\n\nRunning without program aware proposer.") | CODE |
| LOW⚡ | dspy/propose/grounded_proposer.py | 301 | except Exception as e: | CODE |
| MEDIUM⚡ | dspy/propose/grounded_proposer.py | 302 | print(f"Error getting data summary: {e}.\n\nRunning without data aware proposer.") | CODE |
| LOW | dspy/clients/base_lm.py | 390 | except Exception: | CODE |
| LOW | dspy/clients/disk_serialization.py | 64 | except Exception as e: | CODE |
| LOW | dspy/clients/execution.py | 430 | except Exception: | CODE |
| LOW | dspy/clients/execution.py | 459 | except Exception: | CODE |
| LOW | dspy/clients/execution.py | 507 | except Exception: | CODE |
| LOW | dspy/clients/execution.py | 523 | except Exception: | CODE |
| LOW | dspy/clients/execution.py | 560 | except Exception as secondary: | CODE |
| LOW | dspy/clients/execution.py | 566 | except Exception: | CODE |
| LOW | dspy/clients/execution.py | 636 | except Exception as exc: | CODE |
| LOW | dspy/clients/execution.py | 711 | except Exception as exc: | CODE |
| MEDIUM | dspy/clients/execution.py | 499 | def _partial(accumulator): | CODE |
| LOW | dspy/clients/lm_local.py | 222 | except Exception: | CODE |
| MEDIUM | dspy/clients/lm_local.py | 200 | def train_sft_locally(model_name, train_data, train_kwargs): | CODE |
| LOW | dspy/clients/cache.py | 121 | except Exception: | CODE |
| LOW | dspy/clients/cache.py | 177 | except Exception: | CODE |
| LOW | dspy/clients/cache.py | 188 | except Exception as e: | CODE |
| LOW | dspy/clients/__init__.py | 73 | except Exception as e: | CODE |
| LOW⚡ | dspy/clients/openai.py | 110 | except Exception: | CODE |
| LOW⚡ | dspy/clients/openai.py | 120 | except Exception: | CODE |
| LOW | dspy/clients/costs.py | 24 | except Exception: | CODE |
| LOW | dspy/clients/lm.py | 557 | except Exception as err: | CODE |
| LOW | dspy/clients/databricks.py | 159 | except Exception: | CODE |
| LOW | dspy/clients/databricks.py | 259 | except Exception as e: | CODE |
| LOW⚡ | dspy/clients/databricks.py | 289 | except Exception: | CODE |
| LOW⚡ | dspy/clients/databricks.py | 298 | except Exception: | CODE |
| MEDIUM | dspy/clients/databricks.py | 263 | def _get_workspace_client() -> "WorkspaceClient": | CODE |
| LOW | dspy/clients/errors.py | 117 | except Exception as exc: | CODE |
| LOW | dspy/clients/model_metadata/__init__.py | 72 | except Exception as exc: | CODE |
| LOW | dspy/clients/engines/legacy_engine.py | 81 | except Exception as exc: | CODE |
| LOW | dspy/clients/engines/legacy_engine.py | 112 | except Exception as exc: | CODE |
| LOW | dspy/clients/engines/lifecycle.py | 18 | except Exception: | CODE |
| LOW | dspy/clients/engines/lifecycle.py | 37 | except Exception as cleanup: | CODE |
| LOW | dspy/clients/engines/lifecycle.py | 60 | except Exception as cleanup: | CODE |
| LOW | dspy/clients/engines/litellm_errors.py | 121 | except Exception as exc: | CODE |
| MEDIUM | dspy/clients/engines/litellm_errors.py | 118 | def litellm_errors(*, model=None, provider=None): | CODE |
| LOW⚡ | dspy/_vendor/lm15/auth.py | 180 | except Exception: | CODE |
| LOW⚡ | dspy/_vendor/lm15/auth.py | 190 | except Exception: | CODE |
| LOW⚡ | dspy/_vendor/lm15/auth.py | 349 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 154 | except Exception: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 490 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 705 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 782 | except Exception: | CODE |
| LOW | dspy/_vendor/lm15/models.py | 291 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/tools.py | 333 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/tools.py | 359 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/tools.py | 585 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/vet.py | 203 | except Exception: | CODE |
| LOW | dspy/_vendor/lm15/vet.py | 854 | except Exception as exc: | CODE |
| LOW | dspy/_vendor/lm15/vet.py | 867 | except Exception as exc: | CODE |
| MEDIUM | dspy/_vendor/lm15/result.py | 585 | def _incomplete(accumulator): | CODE |
| MEDIUM | dspy/_vendor/lm15/result.py | 656 | def _close_events(source, primary=None, response=None, record=None): | CODE |
| MEDIUM | dspy/_vendor/lm15/result.py | 665 | def _aclose_events(source, primary=None, response=None, record=None): | CODE |
| LOW⚡ | dspy/_vendor/lm15/result.py | 652 | except Exception: | CODE |
| 147 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | dspy/clients/base_lm.py | 240 | Reconstruct an LM from `dump_state` output. Legacy states without a class marker load as `dspy.LM`. Custom LM | STRING |
| HIGH | dspy/clients/provider.py | 13 | A future representing an asynchronous model fine-tuning job. This class extends `concurrent.futures.Future` to repr | STRING |
| HIGH | dspy/clients/provider.py | 82 | A job for reinforcement learning-based fine-tuning. This class represents a reinforcement learning fine-tuning job | STRING |
| HIGH | dspy/retrievers/embeddings.py | 158 | Load the embeddings index from disk into the current instance. Args: path: Directory path | STRING |
| HIGH | dspy/retrievers/embeddings.py | 218 | Create an Embeddings instance from a saved index. This is the recommended way to load saved embeddings | STRING |
| HIGH | dspy/signatures/signature.py | 279 | Return a new Signature class with identical fields and new instructions. This method does not mutate `cls`. It | STRING |
| HIGH | dspy/signatures/signature.py | 308 | Return a new Signature class with identical fields and `instructions` appended to the existing instructions. Th | STRING |
| HIGH | dspy/signatures/signature.py | 363 | Insert a field at index 0 of the `inputs` or `outputs` section. Args: name (str): Field name to add | STRING |
| HIGH | dspy/signatures/signature.py | 390 | Insert a field at the end of the `inputs` or `outputs` section. Args: name (str): Field name to add | STRING |
| HIGH | dspy/signatures/signature.py | 417 | Return a new Signature class without the given field. If `name` is not present, the fields are unchanged (no er | STRING |
| HIGH | dspy/signatures/signature.py | 452 | Insert a field at a specific position among inputs or outputs. Negative indices are supported (e.g., `-1` appen | STRING |
| HIGH | dspy/signatures/signature.py | 564 | Create a new Signature subclass with the specified fields and instructions. Args: signature: Either a strin | STRING |
| HIGH | dspy/signatures/signature.py | 686 | Recursively parse an AST node representing a type annotation. This function converts Python's Abstract Syntax Tree | STRING |
| HIGH | dspy/streaming/streamify.py | 63 | Wrap a DSPy program so that it streams its outputs incrementally, rather than returning them all at once. It al | STRING |
| HIGH | dspy/primitives/code_interpreter.py | 127 | Execute Python code and return the result. Args: code: Python code to execute variables | STRING |
| HIGH | dspy/primitives/example.py | 230 | Mark which fields are inputs and return a new `Example`. Fields not listed here are treated as labels (expected | STRING |
| HIGH | dspy/primitives/module.py | 41 | Base class for all DSPy modules (programs). A Module is a building block for DSPy programs that can contain predict | STRING |
| HIGH | dspy/primitives/module.py | 227 | Apply a function to all named predictors in this module. This method iterates through all Predict instances in | STRING |
| HIGH | dspy/primitives/module.py | 281 | Processes a list of dspy.Example instances in parallel using the Parallel module. Args: ex | STRING |
| HIGH | dspy/adapters/types/citation.py | 95 | Convert a list of dictionaries to a Citations instance. Args: citations_dicts: A list of dictionari | STRING |
| HIGH | dspy/adapters/types/tool.py | 239 | Build a DSPy tool from a LangChain tool. Args: tool: The LangChain tool to convert. | STRING |
| HIGH | dspy/adapters/types/tool.py | 304 | Execute this individual tool call and return its result. Args: functions: Functions to sear | STRING |
| HIGH | dspy/adapters/types/tool.py | 365 | Convert a list of dictionaries to a ToolCalls instance. Args: tool_calls_dicts: A list of dictionar | STRING |
| HIGH | dspy/adapters/types/image.py | 185 | Normalize an in-memory image or preserve a remote image reference. Args: image: A PIL Image, bytes, UR | STRING |
| HIGH | dspy/evaluate/metrics.py | 12 | Compute the Exact Match (EM) metric between a prediction and reference answers. Returns True if any reference exact | STRING |
| HIGH | dspy/evaluate/metrics.py | 40 | Compute the maximum token-level F1 score against reference answers. Strings are normalized (same as in `EM`) and wh | STRING |
| HIGH | dspy/evaluate/metrics.py | 64 | Compute the maximum HotPotQA-style F1 score against reference answers. Like `F1`, but if either normalized side is | STRING |
| HIGH | dspy/evaluate/metrics.py | 88 | Normalize text for string and token comparisons. Steps: 1) Unicode NFD normalization 2) lowercasing | STRING |
| HIGH | dspy/evaluate/metrics.py | 127 | Compute boolean exact match after normalization. Args: prediction (str): Predicted answer. ground_t | STRING |
| HIGH | dspy/evaluate/metrics.py | 145 | Compute token-level F1 between prediction and reference (after normalization). Strings are normalized (see `normali | STRING |
| HIGH | dspy/evaluate/metrics.py | 184 | Compute HotPotQA-style token F1 with special labels. If either normalized string is in {"yes", "no", "noanswer"} an | STRING |
| HIGH | dspy/evaluate/metrics.py | 222 | Compute token-level precision of prediction against reference (after normalization). Precision is (# overlapping to | STRING |
| HIGH | dspy/evaluate/metrics.py | 286 | Evaluate exact match or F1-thresholded match for an example/prediction pair. If `example.answer` is a string, compa | STRING |
| HIGH | dspy/evaluate/metrics.py | 321 | Return True if any passage in `pred.context` contains the answer(s). Strings are normalized (and passages also use | STRING |
| HIGH | dspy/evaluate/evaluate.py | 129 | Args: program (dspy.Module): The DSPy program to evaluate. metric (Callable): The metri | STRING |
| HIGH | dspy/predict/rlm.py | 821 | Execute RLM to produce outputs from the given inputs. Args: interpreter_factory: Optional zero-argu | STRING |
| HIGH | dspy/predict/rlm.py | 919 | Async version of forward(). Execute RLM to produce outputs. Args: interpreter_factory: Optional zer | STRING |
| HIGH | dspy/predict/refine.py | 50 | Refines a module by running it up to N times with different rollout IDs at `temperature=1.0` and return | STRING |
| HIGH | dspy/teleprompt/bettertogether.py | 212 | Compile and optimize a student program using a sequence of optimization strategies. Executes the optimizers spe | STRING |
| HIGH | dspy/teleprompt/gepa/gepa.py | 237 | ... ``` GEPA can also be used as a batch inference-time search strategy, by passing `valset=trainset, | STRING |
| HIGH | tests/mock_interpreter.py | 83 | Execute code and return the next scripted response. Args: code: The code that would be executed (re | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | dspy/propose/grounded_proposer.py | 314 | """This method is responsible for returning the full set of new instructions for our program, given the specifie | STRING |
| MEDIUM | dspy/propose/grounded_proposer.py | 334 | # Create an instruction for each predictor | COMMENT |
| MEDIUM⚡ | dspy/propose/grounded_proposer.py | 376 | """This method is responsible for returning a single instruction for a given predictor, using the specified crit | STRING |
| MEDIUM⚡ | dspy/propose/grounded_proposer.py | 378 | # Create an instruction history string for our predictor | COMMENT |
| MEDIUM | dspy/clients/cache.py | 253 | # Create a modified request that includes the function identifier so that it's incorporated into the cache | COMMENT |
| MEDIUM⚡ | dspy/clients/databricks.py | 299 | # Create the directory if it doesn't exist, we don't raise an error because this is a common case. | COMMENT |
| MEDIUM | dspy/retrievers/embeddings.py | 241 | # Create a minimal instance without triggering embedding computation | COMMENT |
| MEDIUM | dspy/retrievers/databricks_rm.py | 44 | # Create a Databricks Vector Search Endpoint | STRING |
| MEDIUM | dspy/retrievers/databricks_rm.py | 51 | # Create a Databricks Direct Access Vector Search Index | STRING |
| MEDIUM | dspy/retrievers/databricks_rm.py | 66 | # Create a DatabricksRM retriever module to query the Databricks Direct Access Vector | STRING |
| MEDIUM | dspy/streaming/streamify.py | 96 | # Create the program and wrap it with streaming functionality | STRING |
| MEDIUM | dspy/streaming/streamify.py | 128 | # Create the program and wrap it with streaming functionality | STRING |
| MEDIUM | dspy/streaming/streamify.py | 154 | # Create the program and wrap it with streaming functionality | STRING |
| MEDIUM⚡ | dspy/primitives/base_module.py | 124 | # Create an empty instance. | COMMENT |
| MEDIUM | dspy/primitives/base_module.py | 212 | # Create the directory (and any parent directories) | COMMENT |
| MEDIUM | dspy/primitives/module.py | 22 | # Create the instance without invoking ``__init__`` so we can inject | COMMENT |
| MEDIUM | dspy/primitives/module.py | 298 | # Create a list of execution pairs (self, example) | COMMENT |
| MEDIUM | dspy/primitives/module.py | 301 | # Create an instance of Parallel | COMMENT |
| MEDIUM | dspy/adapters/two_step_adapter.py | 68 | # Create a task description for the main LM | COMMENT |
| MEDIUM | dspy/adapters/types/tool.py | 144 | # Create a pydantic model wrapper with a dummy field `value` to parse the arg to the correct type. | COMMENT |
| MEDIUM⚡ | dspy/predict/refine.py | 72 | # Define a QA module with chain of thought | STRING |
| MEDIUM⚡ | dspy/predict/refine.py | 75 | # Define a reward function that checks for one-word answers | STRING |
| MEDIUM⚡ | dspy/predict/refine.py | 79 | # Create a refined module that tries up to 3 times | STRING |
| MEDIUM | dspy/predict/code_act.py | 128 | # Define the tool functions in the interpreter | COMMENT |
| MEDIUM | dspy/predict/knn.py | 23 | # Create a training dataset with examples | STRING |
| MEDIUM⚡ | dspy/teleprompt/knn_fewshot.py | 29 | # Define a QA module with chain of thought | STRING |
| MEDIUM⚡ | dspy/teleprompt/knn_fewshot.py | 32 | # Create a training dataset with examples | STRING |
| MEDIUM | dspy/teleprompt/utils.py | 39 | # Create the mini-batch using the sampled indices | COMMENT |
| MEDIUM | dspy/teleprompt/utils.py | 220 | # Define the save path for the program | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/utils.py | 248 | # Create a logger | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/utils.py | 252 | # Create a file handler that logs debug and higher level messages | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/utils.py | 259 | # Create a console handler with a higher log level | COMMENT |
| MEDIUM | dspy/teleprompt/mipro_optimizer_v2.py | 548 | # Initialize optimization variables | COMMENT |
| MEDIUM | dspy/teleprompt/mipro_optimizer_v2.py | 556 | # Define the objective function | COMMENT |
| MEDIUM | dspy/teleprompt/mipro_optimizer_v2.py | 568 | # Create a new candidate program | COMMENT |
| MEDIUM | dspy/teleprompt/gepa/instruction_proposal.py | 522 | # Create a rich multimodal examples_with_feedback that includes both text and images | COMMENT |
| MEDIUM⚡ | tests/clients/test_cache.py | 246 | # Define a test function | COMMENT |
| MEDIUM⚡ | tests/clients/test_cache.py | 303 | # Define a test function | COMMENT |
| MEDIUM⚡ | tests/clients/test_cache.py | 330 | # Define a test function | COMMENT |
| MEDIUM | tests/clients/test_cache.py | 217 | # Create a new cache instance with disk cache disabled | COMMENT |
| MEDIUM | tests/clients/test_cache.py | 273 | # Define a test function | COMMENT |
| MEDIUM | tests/test_utils/server/__init__.py | 33 | # Create a server log file used to store request logs | COMMENT |
| MEDIUM | tests/signatures/test_adapter_image.py | 426 | # Create a dspy.Image from the file | COMMENT |
| MEDIUM | tests/utils/test_saving.py | 96 | # Create a custom handler to capture log messages | COMMENT |
| MEDIUM | tests/utils/test_settings.py | 127 | # Define the coroutines to be run | COMMENT |
| MEDIUM | tests/utils/test_settings.py | 229 | # Create a temporary Python file with our custom module | COMMENT |
| MEDIUM⚡ | tests/primitives/test_python_interpreter.py | 1397 | # Create a string just over the threshold | COMMENT |
| MEDIUM⚡ | tests/primitives/test_python_interpreter.py | 1407 | # Create a string with recognizable pattern just over threshold | COMMENT |
| MEDIUM | tests/primitives/test_base_module.py | 135 | # Create a temporary Python file with our custom module | COMMENT |
| MEDIUM | tests/primitives/test_base_module.py | 202 | # Create a custom handler to capture log messages | STRING |
| MEDIUM⚡ | tests/predict/test_rlm.py | 824 | # Create a field with description and constraints | COMMENT |
| MEDIUM | tests/predict/test_predict.py | 607 | # Define a model for datetime inputs and outputs | COMMENT |
| MEDIUM | tests/predict/test_predict.py | 1764 | # Create an instance of the Query model | COMMENT |
| MEDIUM | tests/predict/test_react.py | 215 | # Create a simple tool for testing | COMMENT |
| MEDIUM | tests/reliability/generate/utils.py | 297 | # Create a GeneratedTestCase object and add it to the list | COMMENT |
| MEDIUM | tests/teleprompt/test_copro_optimizer.py | 7 | # Define a simple metric function for testing | COMMENT |
| MEDIUM | tests/teleprompt/test_bootstrap_finetune.py | 10 | # Define a simple metric function for testing | COMMENT |
| MEDIUM | tests/teleprompt/test_bootstrap.py | 10 | # Define a simple metric function for testing | COMMENT |
| MEDIUM | tests/teleprompt/test_bettertogether.py | 18 | # Define a simple metric function for testing | COMMENT |
| MEDIUM | tests/teleprompt/test_bettertogether.py | 179 | # Create a mock Teleprompter that returns the student | COMMENT |
| 2 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/propose/dataset_summary_generator.py | 48 | CODE | |
| LOW | dspy/propose/utils.py | 146 | CODE | |
| LOW | dspy/propose/grounded_proposer.py | 144 | CODE | |
| LOW | dspy/propose/grounded_proposer.py | 306 | CODE | |
| LOW | dspy/propose/grounded_proposer.py | 155 | CODE | |
| LOW | dspy/clients/execution.py | 73 | CODE | |
| LOW | dspy/clients/execution.py | 264 | CODE | |
| LOW | dspy/clients/execution.py | 555 | CODE | |
| LOW | dspy/clients/execution.py | 574 | CODE | |
| LOW | dspy/clients/execution.py | 613 | CODE | |
| LOW | dspy/clients/execution.py | 653 | CODE | |
| LOW | dspy/clients/execution.py | 692 | CODE | |
| LOW | dspy/clients/cache.py | 17 | CODE | |
| LOW | dspy/clients/cache.py | 41 | CODE | |
| LOW | dspy/clients/legacy_outputs.py | 24 | CODE | |
| LOW | dspy/clients/capabilities.py | 121 | CODE | |
| LOW | dspy/clients/databricks.py | 305 | CODE | |
| LOW | dspy/clients/databricks.py | 51 | CODE | |
| LOW | dspy/clients/legacy_requests.py | 80 | CODE | |
| LOW | dspy/clients/legacy_requests.py | 104 | CODE | |
| LOW | dspy/clients/model_metadata/__init__.py | 44 | CODE | |
| LOW | dspy/clients/model_metadata/__init__.py | 108 | CODE | |
| LOW | dspy/clients/engines/litellm_engine.py | 203 | CODE | |
| LOW | dspy/clients/engines/lifecycle.py | 45 | CODE | |
| LOW | dspy/clients/engines/streaming.py | 22 | CODE | |
| LOW | dspy/retrievers/weaviate_rm.py | 73 | CODE | |
| LOW | dspy/retrievers/weaviate_rm.py | 113 | CODE | |
| LOW | dspy/_vendor/lm15/tools.py | 200 | CODE | |
| LOW | dspy/_vendor/lm15/tools.py | 454 | CODE | |
| LOW | dspy/_vendor/lm15/serde.py | 165 | CODE | |
| LOW | dspy/_vendor/lm15/serde.py | 638 | CODE | |
| LOW | dspy/_vendor/lm15/types.py | 154 | CODE | |
| LOW | dspy/_vendor/lm15/types.py | 1275 | CODE | |
| LOW | dspy/_vendor/lm15/types.py | 2631 | CODE | |
| LOW | dspy/_vendor/lm15/result.py | 522 | CODE | |
| LOW | dspy/_vendor/lm15/result.py | 676 | CODE | |
| LOW | dspy/_vendor/lm15/result.py | 108 | CODE | |
| LOW | dspy/_vendor/lm15/result.py | 388 | CODE | |
| LOW | dspy/_vendor/lm15/live.py | 148 | CODE | |
| LOW | dspy/_vendor/lm15/router.py | 303 | CODE | |
| LOW | dspy/_vendor/lm15/router.py | 905 | CODE | |
| LOW | dspy/_vendor/lm15/router.py | 1108 | CODE | |
| LOW | dspy/_vendor/lm15/router.py | 386 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 124 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 323 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 451 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 613 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 687 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 938 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 1190 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 1345 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 1679 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 699 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 881 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 991 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 1125 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 1194 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 1233 | CODE | |
| LOW | dspy/_vendor/lm15/providers/gemini.py | 1393 | CODE | |
| LOW | dspy/_vendor/lm15/providers/typesafe.py | 114 | CODE | |
| 122 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | dspy/adapters/base.py | 270 | # Begin few-shot examples | STRING |
| MEDIUM | dspy/adapters/base.py | 276 | # End few-shot examples | STRING |
| MEDIUM⚡ | dspy/predict/refine.py | 72 | # Define a QA module with chain of thought | STRING |
| MEDIUM⚡ | dspy/teleprompt/knn_fewshot.py | 29 | # Define a QA module with chain of thought | STRING |
| MEDIUM | dspy/teleprompt/knn_fewshot.py | 45 | # Compile the QA module with few-shot learning | STRING |
| MEDIUM | dspy/teleprompt/random_search.py | 82 | # zero-shot | COMMENT |
| MEDIUM | dspy/teleprompt/random_search.py | 91 | # unshuffled few-shot | COMMENT |
| MEDIUM | dspy/teleprompt/random_search.py | 165 | # Alternatively, we can keep track of the (zero-shot) number of tokens when we bootstrap. | COMMENT |
| MEDIUM | dspy/teleprompt/utils.py | 365 | # zero-shot | COMMENT |
| MEDIUM | dspy/teleprompt/utils.py | 378 | # unshuffled few-shot | COMMENT |
| MEDIUM | dspy/teleprompt/utils.py | 391 | # shuffled few-shot | COMMENT |
| MEDIUM | dspy/teleprompt/copro_optimizer.py | 150 | # Seed the prompt optimizer zero shot with just the instruction, generate BREADTH new prompts | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 230 | # Step 1: Bootstrap few-shot examples | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 256 | # If zero-shot, discard demos | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 309 | # Set num instruct candidates to 1/2 of N if optimizing with few-shot examples, otherwise set to N | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 310 | # This is because we've found that it's generally better to spend optimization budget on few-shot examples | COMMENT |
| MEDIUM⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 283 | num_vars *= 2 # Account for few-shot examples + instruction variables | CODE |
| MEDIUM | dspy/teleprompt/mipro_optimizer_v2.py | 448 | # logger.info(f"!!!!\n\n\n\n\nError generating few-shot examples: {e}") | COMMENT |
| MEDIUM | dspy/teleprompt/mipro_optimizer_v2.py | 449 | # logger.info("Running without few-shot examples.!!!!\n\n\n\n\n") | COMMENT |
| MEDIUM | tests/adapters/test_json_adapter.py | 985 | # 1 system message, 2 few shot examples (1 user and assistant message for each example), 1 user message | COMMENT |
| MEDIUM | tests/adapters/test_json_adapter.py | 1078 | # Image information in the few-shot example's user message | COMMENT |
| MEDIUM | tests/adapters/test_chat_adapter.py | 2210 | # 1 system message, 2 few shot examples (1 user and assistant message for each example), 1 user message | COMMENT |
| MEDIUM | tests/adapters/test_chat_adapter.py | 2275 | # Image information in the few-shot example's user message | COMMENT |
| MEDIUM | tests/adapters/test_xml_adapter.py | 390 | # Image information in the few-shot example's user message | STRING |
| MEDIUM | tests/predict/test_react.py | 237 | # The 3rd call raises context window exceeded error | COMMENT |
| MEDIUM⚡ | tests/examples/test_baleen.py | 62 | # Ask any question you like to this simple RAG program. | COMMENT |
| MEDIUM⚡ | tests/examples/test_baleen.py | 66 | uncompiled_baleen = SimplifiedBaleen() # uncompiled (i.e., zero-shot) program | CODE |
| MEDIUM | tests/examples/test_baleen.py | 103 | uncompiled_baleen = SimplifiedBaleen() # uncompiled (i.e., zero-shot) program | CODE |
| MEDIUM | tests/teleprompt/test_utils.py | 84 | # Find the call where seed == -1 (unshuffled few-shot) | COMMENT |
| MEDIUM | tests/teleprompt/test_random_search.py | 74 | # -3 (zero-shot) is a valid seed; a plain iterator is single-use. | COMMENT |
| MEDIUM | docs/overrides/home.html | 339 | <div class="line"><span class="tok-cm"># Baseline 62% (gpt-5.4-mini, zero-shot)</span></div> | CODE |
| MEDIUM | docs/docs/getting-started/react-and-tools.md | 72 | ## ReAct manages an agentic loop | COMMENT |
| MEDIUM | docs/docs/api/optimizers/GEPA/GEPA_Advanced.md | 153 | #### Advanced Example: RAG-Enhanced Instruction Proposer | COMMENT |
| MEDIUM⚡ | docs/docs/tutorials/build_ai_program/index.md | 16 | ## Retrieval-Augmented Generation (RAG) | COMMENT |
| MEDIUM⚡ | docs/docs/tutorials/build_ai_program/index.md | 18 | ### [Retrieval-Augmented Generation (RAG)](../rag/index.ipynb) | COMMENT |
| MEDIUM⚡ | docs/docs/tutorials/build_ai_program/index.md | 21 | ### [Building RAG as Agent](../agents/index.ipynb) | COMMENT |
| MEDIUM⚡ | docs/docs/tutorials/build_ai_program/index.md | 24 | ### [Multi-Hop RAG](../multihop_search/index.ipynb) | COMMENT |
| MEDIUM | docs/docs/community/community-resources.md | 23 | | **Building Self-improving Agents in Production with DSPy** | [Link](https://relevanceai.com/blog/building-self-improvi | CODE |
| MEDIUM | docs/docs/community/use-cases.md | 62 | | **[Moody's](https://www.moodys.com/)** | Leveraging DSPy to optimize RAG systems, LLM-as-a-Judge, and agentic systems | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | dspy/clients/execution.py | 600 | accumulator.push(event) | CODE |
| HIGH | dspy/clients/execution.py | 679 | accumulator.push(event) | CODE |
| HIGH | dspy/_vendor/lm15/compat.py | 264 | # null) and reasoning comes back as `summary` text with | COMMENT |
| HIGH | dspy/_vendor/lm15/tools.py | 717 | affects only value nullability (``anyOf`` with null), never | STRING |
| HIGH | dspy/_vendor/lm15/result.py | 394 | self._accumulator.push(event) | CODE |
| HIGH | dspy/_vendor/lm15/result.py | 496 | self._accumulator.push(event) | CODE |
| HIGH | dspy/_vendor/lm15/result.py | 531 | accumulator.push(event) | CODE |
| HIGH | dspy/_vendor/lm15/result.py | 557 | accumulator.push(event) | CODE |
| HIGH | dspy/_vendor/lm15/result.py | 79 | acc.push(event) | STRING |
| HIGH | dspy/_vendor/lm15/providers/openai_chat.py | 387 | """A dict whose every value is null/empty (litellm: {"refusal": null}).""" | STRING |
| HIGH | dspy/teleprompt/bootstrap.py | 121 | assert predictor1.signature.equals( | CODE |
| HIGH | dspy/teleprompt/gepa/gepa_utils.py | 375 | trace_instances = [t for t in trace if t[0].signature.equals(module.signature)] | CODE |
| HIGH⚡ | tests/signatures/test_signature.py | 146 | assert sig1.equals(sig2) | CODE |
| HIGH⚡ | tests/signatures/test_signature.py | 152 | assert not sig1.equals(sig2) | CODE |
| HIGH⚡ | tests/signatures/test_signature.py | 160 | assert TestSignature.equals(TestSignature) | CODE |
| HIGH | tests/signatures/test_signature.py | 515 | assert sig1.equals(sig2) | CODE |
| HIGH | tests/signatures/test_signature.py | 557 | assert Sig1.equals(Sig2) | CODE |
| HIGH | tests/adapters/test_baml_adapter.py | 211 | assert 'mode: "auto" or null,' in schema | CODE |
| HIGH | tests/adapters/test_chat_adapter.py | 803 | '{"type": "null"}], "default": null, "title": "Document Title"}, "end_char_index": ' | CODE |
| HIGH | tests/adapters/test_chat_adapter.py | 806 | '"string"}, {"type": "null"}], "default": null, "title": "Supported Text"}}, ' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/lm15.py | 33 | __all__ = [ | CODE |
| LOW | dspy/propose/__init__.py | 3 | __all__ = [ | CODE |
| LOW | dspy/clients/lm_local.py | 19 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/clients/cache.py | 14 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/clients/__init__.py | 13 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/clients/__init__.py | 112 | __all__ = [ | CODE |
| LOW | dspy/clients/lm.py | 30 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/clients/databricks.py | 16 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/clients/model_metadata/__init__.py | 20 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/clients/engines/__init__.py | 13 | __all__ = [ | CODE |
| LOW | dspy/experimental/__init__.py | 7 | __all__ = [ | CODE |
| LOW | dspy/retrievers/__init__.py | 4 | __all__ = ["Embeddings", "EmbeddingsWithScores", "Retrieve"] | CODE |
| LOW | dspy/_vendor/lm15/auth.py | 61 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/authkit.py | 42 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/credentials.py | 28 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/registry.py | 81 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/tools.py | 46 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/batch.py | 29 | __all__ = ["AsyncBatchJob", "BatchJob"] | CODE |
| LOW⚡ | dspy/_vendor/lm15/__init__.py | 239 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/result.py | 58 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/judgments.py | 307 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/router.py | 91 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/router.py | 878 | def _set_origin(lm: object, label: str) -> None: | CODE |
| LOW | dspy/_vendor/lm15/testing.py | 44 | __all__ = ["FakeLM", "FakeTransport", "FakeResponse"] | CODE |
| LOW | dspy/_vendor/lm15/model_registry.py | 9 | __all__ = ["ModelRegistry"] | CODE |
| LOW | dspy/_vendor/lm15/doctor.py | 48 | __all__ = ["AuthReport", "AuthStep", "explain_auth"] | CODE |
| LOW | dspy/_vendor/lm15/profiles.py | 49 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/video_jobs.py | 20 | __all__ = ["AsyncVideoJob", "VideoJob", "VideoWaitTimeout"] | CODE |
| LOW | dspy/_vendor/lm15/providers/__init__.py | 23 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/providers/typesafe.py | 341 | __all__ = ["TypeSafeLM"] | CODE |
| LOW | dspy/_vendor/lm15/providers/async_base.py | 1026 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/transports/__init__.py | 29 | __all__ = [ | CODE |
| LOW | dspy/_vendor/lm15/cloud/chains.py | 60 | __all__ = ["ChainContext", "Rung", "Step", "CredentialSource", "chain_for", "named_rungs", "explain", | CODE |
| LOW | dspy/_vendor/lm15/cloud/sigv4.py | 35 | __all__ = ["SigV4Signature", "sign", "canonicalize"] | CODE |
| LOW | dspy/_vendor/lm15/cloud/hosts.py | 39 | __all__ = ["resolve_settings", "render_base_url", "join_endpoint", "endpoint_from_env", "location_host", | CODE |
| LOW | dspy/_vendor/lm15/cloud/rs256.py | 42 | __all__ = ["RsaPrivateKey", "load_private_key", "certificate_der", "sign_pkcs1v15_sha256", "jwt_encode", "b64url"] | CODE |
| LOW | dspy/signatures/__init__.py | 10 | __all__ = [ | CODE |
| LOW | dspy/datasets/__init__.py | 8 | __all__ = [ | CODE |
| LOW | dspy/utils/callback.py | 12 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/utils/parallelizer.py | 16 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/utils/saving.py | 12 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/utils/__init__.py | 26 | __all__ = [ | CODE |
| LOW | dspy/streaming/__init__.py | 5 | __all__ = [ | CODE |
| LOW | dspy/streaming/streamify.py | 20 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/primitives/repl_types.py | 23 | __all__ = ["REPLVariable", "REPLEntry", "REPLHistory"] | CODE |
| LOW | dspy/primitives/__init__.py | 16 | __all__ = [ | CODE |
| LOW⚡ | dspy/primitives/python_interpreter.py | 32 | __all__ = ["PythonInterpreter", "FinalOutput", "CodeExecutionError", "CodeInterpreterError"] | CODE |
| LOW⚡ | dspy/primitives/python_interpreter.py | 34 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/primitives/base_module.py | 17 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/primitives/module.py | 15 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/primitives/sandbox_serializable.py | 38 | __all__ = ["SandboxSerializable", "build_repl_variable"] | CODE |
| LOW | dspy/adapters/__init__.py | 8 | __all__ = [ | CODE |
| LOW | dspy/adapters/json_adapter.py | 26 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/adapters/base.py | 23 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/adapters/types/__init__.py | 10 | __all__ = ["History", "Image", "Audio", "File", "Type", "Tool", "ToolCalls", "ToolCallResults", "Code", "Reasoning"] | CODE |
| LOW | dspy/evaluate/__init__.py | 5 | __all__ = [ | CODE |
| LOW | dspy/evaluate/evaluate.py | 45 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/predict/rlm.py | 54 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/predict/react.py | 10 | logger = logging.getLogger(__name__) | CODE |
| LOW | dspy/predict/predict.py | 23 | logger = logging.getLogger(__name__) | CODE |
| 30 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | dspy/signatures/signature.py | 830 | # Step 1: Convert camelCase to snake_case | COMMENT |
| LOW⚡ | dspy/signatures/signature.py | 838 | # Step 2: Handle numbers by adding underscores around them | COMMENT |
| LOW | dspy/signatures/signature.py | 852 | # Step 3: Convert to Title Case while preserving acronyms | COMMENT |
| LOW⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 230 | # Step 1: Bootstrap few-shot examples | COMMENT |
| LOW⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 261 | # Step 3: Find optimal prompt parameters | COMMENT |
| LOW | dspy/teleprompt/mipro_optimizer_v2.py | 243 | # Step 2: Propose instruction candidates | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 60 | ##### Step 1: Initial Metadata (no direct access to full context) | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 62 | # Step 1: Peek at the data | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 70 | ##### Step 2: Write Code to Explore Context | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 72 | # Step 2: Search for relevant sections | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 82 | ##### Step 3: Trigger Sub-LLM Calls | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 84 | # Step 3: Use sub-LLM for semantic extraction | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 93 | ##### Step 4: Submit Final Answer | COMMENT |
| LOW⚡ | docs/docs/api/modules/RLM.md | 95 | # Step 4: Return final answer | COMMENT |
| LOW | docs/docs/tutorials/mem0_react_agent/index.md | 27 | ## Step 1: Understanding Mem0 Integration | COMMENT |
| LOW | docs/docs/tutorials/mem0_react_agent/index.md | 59 | ## Step 2: Create Memory-Aware Tools | COMMENT |
| LOW⚡ | docs/docs/tutorials/mem0_react_agent/index.md | 129 | ## Step 3: Build the Memory-Enhanced ReAct Agent | COMMENT |
| LOW | docs/docs/tutorials/mem0_react_agent/index.md | 198 | ## Step 4: Running the Memory-Enhanced Agent | COMMENT |
| LOW | docs/docs/tutorials/sample_code_generation/index.md | 21 | ## Step 1: Documentation Fetching and Processing | COMMENT |
| LOW | docs/docs/tutorials/sample_code_generation/index.md | 198 | ## Step 2: Learning from Documentation URLs | STRING |
| LOW | docs/docs/tutorials/sample_code_generation/index.md | 243 | ## Step 3: Generating Code Examples | COMMENT |
| LOW | docs/docs/tutorials/sample_code_generation/index.md | 318 | ## Step 4: Interactive Library Learning Function | COMMENT |
| LOW | docs/docs/tutorials/sample_code_generation/index.md | 335 | # Step 1: Learn from documentation | COMMENT |
| LOW | docs/docs/tutorials/sample_code_generation/index.md | 338 | # Step 2: Generate examples for each use case | COMMENT |
| LOW⚡ | docs/docs/tutorials/optimizer_tracking/index.md | 104 | #### Step 1: Access the MLflow UI | COMMENT |
| LOW⚡ | docs/docs/tutorials/optimizer_tracking/index.md | 107 | #### Step 2: Understanding the Experiment Structure | COMMENT |
| LOW⚡ | docs/docs/tutorials/optimizer_tracking/index.md | 112 | #### Step 3: Analyzing the Parent Run | COMMENT |
| LOW⚡ | docs/docs/tutorials/optimizer_tracking/index.md | 117 | #### Step 4: Examining Child Runs | COMMENT |
| LOW | docs/docs/tutorials/email_extraction/index.md | 64 | ## Step 1: Define Our Data Structures | COMMENT |
| LOW | docs/docs/tutorials/email_extraction/index.md | 97 | ## Step 2: Create DSPy Signatures | COMMENT |
| LOW | docs/docs/tutorials/email_extraction/index.md | 147 | ## Step 3: Build the Email Processing Module | COMMENT |
| LOW⚡ | docs/docs/tutorials/email_extraction/index.md | 167 | # Step 1: Classify the email | COMMENT |
| LOW⚡ | docs/docs/tutorials/email_extraction/index.md | 174 | # Step 2: Extract entities | COMMENT |
| LOW⚡ | docs/docs/tutorials/email_extraction/index.md | 181 | # Step 3: Generate summary | COMMENT |
| LOW⚡ | docs/docs/tutorials/email_extraction/index.md | 188 | # Step 4: Determine actions | COMMENT |
| LOW⚡ | docs/docs/tutorials/email_extraction/index.md | 196 | # Step 5: Structure the results | COMMENT |
| LOW | docs/docs/tutorials/email_extraction/index.md | 213 | ## Step 4: Running the Email Processing System | COMMENT |
| LOW | docs/docs/tutorials/ai_text_game/index.md | 21 | ## Step 1: Core Game Framework | COMMENT |
| LOW | docs/docs/tutorials/ai_text_game/index.md | 168 | ## Step 2: AI-Powered Story Generation | COMMENT |
| LOW | docs/docs/tutorials/ai_text_game/index.md | 297 | ## Step 3: Game Interface and Interaction | COMMENT |
| LOW | docs/docs/tutorials/ai_text_game/index.md | 405 | ## Step 4: Main Game Loop | STRING |
| LOW | docs/docs/tutorials/yahoo_finance_react/index.md | 15 | ## Step 1: Convert LangChain Tool to DSPy | COMMENT |
| LOW | docs/docs/tutorials/yahoo_finance_react/index.md | 33 | ## Step 2: Create Supporting Financial Tools | COMMENT |
| LOW | docs/docs/tutorials/yahoo_finance_react/index.md | 88 | ## Step 3: Build the Financial ReAct Agent | COMMENT |
| LOW | docs/docs/tutorials/yahoo_finance_react/index.md | 115 | ## Step 4: Run Financial Analysis | COMMENT |
| LOW | docs/docs/tutorials/llms_txt_generation/index.md | 19 | ### Step 1: Define Our Signatures | COMMENT |
| LOW | docs/docs/tutorials/llms_txt_generation/index.md | 59 | ### Step 2: Create the Repository Analyzer Module | COMMENT |
| LOW | docs/docs/tutorials/llms_txt_generation/index.md | 107 | ### Step 3: Gather Repository Information | COMMENT |
| LOW | docs/docs/tutorials/llms_txt_generation/index.md | 173 | ### Step 4: Configure DSPy and Generate llms.txt | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/_vendor/lm15/auth.py | 501 | else None | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 81 | # on the messages it emits before a tool call and documents replaying them | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 361 | "openrouter", | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 381 | # the same field the Responses dialect already sends. | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 701 | ), | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 941 | extensions=partial.extensions, | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 961 | # effort; `enabled` + budget_tokens is accepted but not translated) and | COMMENT |
| LOW | dspy/_vendor/lm15/compat.py | 1081 | # Moonshot AI over the Anthropic wire (platform.kimi.ai messages-- | COMMENT |
| LOW | dspy/_vendor/lm15/access.py | 181 | # opens three chat wires and the account surfaces. `meta` names the | COMMENT |
| LOW | dspy/_vendor/lm15/access.py | 341 | env_keys=MOONSHOTAI_ENV_KEYS, | COMMENT |
| LOW | dspy/_vendor/lm15/access.py | 481 | # one host every resource kind answers on — a classic `OpenAI`-kind | COMMENT |
| LOW | dspy/_vendor/lm15/access.py | 761 | api_key_header: str = "x-api-key", | COMMENT |
| LOW | dspy/_vendor/lm15/features.py | 1 | """ | COMMENT |
| LOW | dspy/_vendor/lm15/features.py | 21 | # in-process configuration always wins, but between two kinds of | COMMENT |
| LOW | dspy/_vendor/lm15/types.py | 1881 | top_k: int | None = None | COMMENT |
| LOW | dspy/_vendor/lm15/types.py | 1901 | # attribution (OpenAI safety_identifier, Anthropic metadata.user_id). | COMMENT |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 181 | """Canonical response_format (INV-050) -> chat-completions response_format.""" | COMMENT |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 201 | # refused with UnsupportedFeatureError, or — for the four call-mode / | COMMENT |
| LOW | dspy/_vendor/lm15/providers/openai_chat.py | 1441 | adapt("config.response_format", "dropped", | COMMENT |
| LOW | dspy/_vendor/lm15/providers/openai.py | 281 | if cache_cfg.retention == "long": | COMMENT |
| LOW | dspy/_vendor/lm15/providers/xai.py | 261 | # code as provider_code instead of dropping it. | COMMENT |
| LOW | dspy/evaluate/evaluate.py | 401 | # TODO: the display_table can't handle False but can handle 0! | COMMENT |
| LOW | dspy/predict/retry.py | 1 | # import copy | COMMENT |
| LOW | dspy/predict/retry.py | 21 | # prefix="Previous " + actual_prefix, | COMMENT |
| LOW | dspy/predict/retry.py | 41 | # # Convert the dict past_outputs={"answer": ...} to kwargs | COMMENT |
| LOW | dspy/predict/retry.py | 61 | # pred = self.forward(**kwargs) | COMMENT |
| LOW | dspy/teleprompt/random_search.py | 161 | # sample between 4 and 10 examples from traces | COMMENT |
| LOW | dspy/teleprompt/grpo.py | 261 | COMMENT | |
| LOW | dspy/teleprompt/grpo.py | 521 | logger.warning(f"GRPOGroup has no diversity. This could be due to low temperature, or low number | COMMENT |
| LOW | dspy/teleprompt/bootstrap_finetune.py | 221 | # program: Program, | COMMENT |
| LOW | tests/predict/test_retry.py | 1 | # import functools | COMMENT |
| LOW | tests/predict/test_retry.py | 21 | # result = retry_module.forward( | COMMENT |
| LOW | tests/predict/test_retry.py | 41 | # print(f"SimpleModule got {result.answer=}") | COMMENT |
| LOW | tests/predict/test_retry.py | 61 | # # class AnswerQuestion(dspy.Signature): | COMMENT |
| LOW | tests/predict/test_retry.py | 81 | # # return result | COMMENT |
| LOW | tests/predict/test_predict.py | 241 | COMMENT | |
| LOW | tests/predict/test_predict.py | 261 | # content="¿Qué tal?", | COMMENT |
| LOW | tests/reliability/reliability_conf.yaml | 1 | adapter: chat | COMMENT |
| LOW | tests/reliability/reliability_conf.yaml | 21 | - model_name: "gpt-4-turbo" | COMMENT |
| LOW | tests/reliability/reliability_conf.yaml | 41 | - model_name: "claude-3.5-haiku" | COMMENT |
| LOW | tests/reliability/reliability_conf.yaml | 61 | - model_name: "llama-3.1-70b-instruct" | COMMENT |
| LOW | docs/docs/stylesheets/home.css | 601 | border-bottom-color: var(--hp-accent); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | docs/docs/tutorials/async/index.md | 60 | os.environ["OPENAI_API_KEY"] = "your_api_key" | CODE |
| HIGH | docs/docs/tutorials/async/index.md | 85 | os.environ["OPENAI_API_KEY"] = "your_api_key" | CODE |
| HIGH | docs/docs/tutorials/async/index.md | 142 | os.environ["OPENAI_API_KEY"] = "your_api_key" | CODE |
| HIGH | docs/docs/tutorials/streaming/index.md | 23 | os.environ["OPENAI_API_KEY"] = "your_api_key" | CODE |
| HIGH | docs/docs/tutorials/streaming/index.md | 471 | os.environ["OPENAI_API_KEY"] = "your_api_key" | CODE |
| HIGH | docs/docs/tutorials/jev_decisions/index.md | 209 | os.environ["TYPESAFE_API_KEY"] = "your-api-key" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | dspy/propose/dataset_summary_generator.py | 22 | """I will also provide you with a few observations I have already made. Please add your own observations or if you | STRING |
| MEDIUM | dspy/_vendor/lm15/vet.py | 104 | # PROTOCOL.md pins the harness account id: the ctor cannot derive one | COMMENT |
| MEDIUM | dspy/_vendor/lm15/vet.py | 646 | # The harness gives the certificate and the key separately; the | COMMENT |
| MEDIUM | dspy/_vendor/lm15/providers/base.py | 378 | # harness injects a fixed clock; users never touch it. | COMMENT |
| MEDIUM | dspy/_vendor/lm15/providers/base.py | 1000 | # harness direction drive the same code. There is NO local fan-out | COMMENT |
| MEDIUM | dspy/_vendor/lm15/providers/base.py | 1266 | # so the async twins and a future harness direction drive identical | COMMENT |
| LOW | dspy/adapters/utils.py | 104 | # (e.g. the value is a JSON string), just use the string representation of the value | COMMENT |
| LOW | dspy/evaluate/evaluate.py | 38 | # available, this method will simply return the input string. | COMMENT |
| MEDIUM | dspy/teleprompt/gepa/instruction_proposal.py | 751 | # instead of just the current instruction, for more holistic instruction proposals. | COMMENT |
| MEDIUM | dspy/dsp/utils/settings.py | 155 | # We check its existence and type to be more robust. | COMMENT |
| LOW | tests/predict/test_rlm.py | 631 | # Unclosed fence (just return the body) | COMMENT |
| MEDIUM | tests/predict/test_rlm.py | 615 | """Tests for robust fenced-code extraction.""" | STRING |
| MEDIUM | tests/teleprompt/test_gepa_instruction_proposer.py | 158 | # Use a robust dummy LM with enough responses for optimization steps | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/propose/grounded_proposer.py | 250 | CODE | |
| LOW | dspy/clients/lm.py | 203 | CODE | |
| LOW | dspy/retrievers/databricks_rm.py | 84 | CODE | |
| LOW | dspy/_vendor/lm15/features.py | 279 | CODE | |
| LOW | dspy/_vendor/lm15/live.py | 358 | CODE | |
| LOW | dspy/_vendor/lm15/live.py | 531 | CODE | |
| LOW | dspy/_vendor/lm15/errors.py | 51 | CODE | |
| LOW | dspy/_vendor/lm15/doctor.py | 183 | CODE | |
| LOW | dspy/_vendor/lm15/providers/openai_codex.py | 37 | CODE | |
| LOW | dspy/_vendor/lm15/providers/base.py | 524 | CODE | |
| LOW | dspy/_vendor/lm15/transports/_async.py | 238 | CODE | |
| LOW | dspy/_vendor/lm15/transports/_sync.py | 223 | CODE | |
| LOW | dspy/utils/exceptions.py | 25 | CODE | |
| LOW | dspy/primitives/python_interpreter.py | 243 | CODE | |
| LOW | dspy/evaluate/evaluate.py | 71 | CODE | |
| LOW | dspy/evaluate/evaluate.py | 117 | CODE | |
| LOW | dspy/predict/parallel.py | 10 | CODE | |
| LOW | dspy/teleprompt/bootstrap_trace.py | 30 | CODE | |
| LOW | dspy/teleprompt/bettertogether.py | 194 | CODE | |
| LOW | dspy/teleprompt/random_search.py | 28 | CODE | |
| LOW | dspy/teleprompt/grpo.py | 27 | CODE | |
| LOW | dspy/teleprompt/utils.py | 324 | CODE | |
| LOW | dspy/teleprompt/simba.py | 29 | CODE | |
| LOW | dspy/teleprompt/mipro_optimizer_v2.py | 61 | CODE | |
| LOW | dspy/teleprompt/mipro_optimizer_v2.py | 109 | CODE | |
| LOW | dspy/teleprompt/gepa/gepa.py | 399 | CODE | |
| LOW | dspy/teleprompt/gepa/gepa_utils.py | 109 | CODE | |
| LOW | dspy/dsp/utils/utils.py | 45 | CODE | |
| LOW | tests/predict/test_parallel.py | 194 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/_vendor/lm15/doctor.py | 67 | ``"env:<VAR>"``, ``"placeholder"``, or ``"oauth-file"``. Conformance | STRING |
| LOW | dspy/_vendor/lm15/doctor.py | 316 | kind="placeholder", | CODE |
| LOW | dspy/adapters/baml_adapter.py | 219 | # PatientDetails(name='John Doe', age=45, address=PatientAddress(street='123 Main St', city='Anytown', country='US') | STRING |
| LOW | dspy/adapters/baml_adapter.py | 219 | # PatientDetails(name='John Doe', age=45, address=PatientAddress(street='123 Main St', city='Anytown', country='US') | STRING |
| LOW | tests/datasets/test_dataset.py | 9 | dummy_data = """content,question,answer | CODE |
| LOW | tests/datasets/test_dataset.py | 34 | tmp_file.write(dummy_data) | STRING |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 283 | name="John Doe", age=45, address=PatientAddress(street="123 Main St", city="Anytown", country="US") | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 283 | name="John Doe", age=45, address=PatientAddress(street="123 Main St", city="Anytown", country="US") | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 290 | assert '"name": "John Doe"' in user_message | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 292 | assert '"street": "123 Main St"' in user_message | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 306 | patient = PatientDetails(name="Jane Doe", age=30) | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 312 | assert '"name": "Jane Doe"' in user_message | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 550 | choices=[Choices(message=Message(content='{"patient": {"name": "John Doe", "age": 28}}'))], | CODE |
| LOW⚡ | tests/adapters/test_baml_adapter.py | 559 | assert result[0]["patient"].name == "John Doe" | CODE |
| LOW | tests/adapters/test_baml_adapter.py | 648 | user_profile = UserProfile(name="John Doe", email="john@example.com", age=30) | CODE |
| LOW | tests/adapters/test_baml_adapter.py | 660 | assert '"name": "John Doe"' in user_message | CODE |
| LOW⚡ | tests/adapters/test_tool.py | 357 | assert result["primary_address"]["street"] == "123 Main St" | CODE |
| LOW | tests/adapters/test_tool.py | 346 | Address(street="123 Main St", city="Test City", zip_code="12345", is_primary=True), | CODE |
| LOW | docs/docs/learn/programming/adapters.md | 194 | "scientists_involved": ["John Doe", "Jane Smith"], | CODE |
| LOW | docs/docs/learn/evaluation/data.md | 59 | Values can be accessed using the `.`(dot) operator. You can access the value of key `name` in defined object `Example(na | CODE |
| LOW | docs/docs/deep-dive/data-handling/examples.md | 60 | Values can be accessed using the `.`(dot) operator. You can access the value of key `name` in defined object `Example(na | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/clients/provider.py | 35 | # Check if job is done | STRING |
| LOW | dspy/clients/openai.py | 142 | # Check if there is an active job | COMMENT |
| LOW | dspy/signatures/signature.py | 718 | # Check if it's a built-in known type or in the provided names | COMMENT |
| LOW | dspy/signatures/signature.py | 724 | # Check if it matches any known built-in type by name | COMMENT |
| LOW | dspy/adapters/utils.py | 171 | # Check if the identifier is a valid enum member value *before* checking if it's a valid enum | COMMENT |
| LOW | dspy/adapters/base.py | 446 | # Check if all fields are present and not None | COMMENT |
| LOW | dspy/adapters/base.py | 449 | # Check if demo has at least one input and one output field | COMMENT |
| LOW | dspy/adapters/types/citation.py | 196 | # Check if the chunk has citation data in provider_specific_fields | COMMENT |
| LOW | dspy/adapters/types/citation.py | 218 | # Check if the response contains citations in the expected format | COMMENT |
| LOW | dspy/adapters/types/reasoning.py | 159 | # Check if this is a valid string method/attribute | COMMENT |
| LOW | dspy/adapters/types/tool.py | 105 | # Check if the type (or its origin) is a subclass of Pydantic's BaseModel | COMMENT |
| LOW | dspy/teleprompt/bettertogether.py | 580 | # Check if this is the best score so far | COMMENT |
| LOW | tests/docs/test_mkdocs_links.py | 9 | # Read file and extract nav section | COMMENT |
| LOW | tests/reliability/generate/utils.py | 278 | # Check if the directory contains a program.py and an inputs directory | COMMENT |
| LOW | tests/reliability/generate/utils.py | 684 | # Read the file contents | STRING |
| LOW | tests/teleprompt/test_copro_optimizer.py | 170 | # Check if the results_best and results_latest contain valid statistics | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/adapters/test_json_adapter.py | 0 | answer the question with multiple answers and scores | STRING |
| HIGH | tests/adapters/test_chat_adapter.py | 0 | answer the question with multiple answers and scores | STRING |
| HIGH | tests/adapters/test_xml_adapter.py | 0 | answer the question with multiple answers and scores | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/clients/test_cache.py | 248 | def test_function(prompt, model): | CODE |
| LOW⚡ | tests/clients/test_cache.py | 305 | async def test_function(prompt, model): | CODE |
| LOW⚡ | tests/clients/test_cache.py | 332 | def test_function(**kwargs): | CODE |
| LOW⚡ | tests/utils/test_annotation.py | 6 | def test_function(): | CODE |
| LOW⚡ | tests/utils/test_annotation.py | 17 | def test_function(): | CODE |
| LOW⚡ | tests/utils/test_annotation.py | 55 | def test_function(): | CODE |
| LOW⚡ | tests/utils/test_annotation.py | 64 | def test_function(): | CODE |
| LOW⚡ | tests/utils/test_annotation.py | 72 | def test_function(): | CODE |
| LOW | tests/utils/test_annotation.py | 84 | def test_function(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | dspy/signatures/signature.py | 830 | # Step 1: Convert camelCase to snake_case | COMMENT |
| LOW⚡ | dspy/signatures/signature.py | 838 | # Step 2: Handle numbers by adding underscores around them | COMMENT |
| LOW | dspy/signatures/signature.py | 852 | # Step 3: Convert to Title Case while preserving acronyms | COMMENT |
| LOW⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 230 | # Step 1: Bootstrap few-shot examples | COMMENT |
| LOW⚡ | dspy/teleprompt/mipro_optimizer_v2.py | 261 | # Step 3: Find optimal prompt parameters | COMMENT |
| LOW | dspy/teleprompt/mipro_optimizer_v2.py | 243 | # Step 2: Propose instruction candidates | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | docs/docs/diving-deeper/adapters.md | 150 | **`dspy.adapters.types.tool.ToolCalls.from_dict_list(...)`** | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | docs/docs/community/built-with-dspy.md | 22 | | **[MedVAL](https://arxiv.org/abs/2507.03152)** | Expert-level validation of AI-generated medical text with scalable la | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/clients/test_lm.py | 1575 | CODE | |
| MEDIUM | tests/streaming/test_streaming.py | 2130 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | dspy/adapters/json_adapter.py | 208 | # TODO: implement format_finetune_data method in JSONAdapter | COMMENT |
| LOW | .github/workflows/build_and_release.yml | 82 | # TODO: Add tests using dspy-ai-test | COMMENT |