AI Slop Code RIsk Monitor

stanfordnlp/dspy

DSPy: The framework for programming—not prompting—language models

33.8 High pattern signal View on GitHub

Maintenance and Governance Review

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.

33.8
Adjusted Signal
33.8
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
38.6K
Stars
Python
Language
144.8K
Lines of Code
632
Files
3.7K
Pattern Hits
2026-10-12
Scan Date
0.20
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 60.9/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 2481 finding(s).

Hallucinated Dependency & Supply Chain Risk 19.8/100 · LOW

Are imports declared and package/API names verified? 623 finding(s).

Agent Over-Engineering Ratio 69.0/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 2651 finding(s).

PR Review Velocity Impact 83.4/100 · CRITICAL

Which changes need focused human review? 3736 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 1HIGH 127MEDIUM 412LOW 3196

Directory Score Breakdown

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.

Pattern Findings

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.

Hyper-Verbose Identifiers1990 hits · 1828 pts
SeverityFileLineSnippetContext
LOWdspy/propose/dataset_summary_generator.py30def order_input_keys_in_string(unordered_repr):CODE
LOWdspy/propose/propose_base.py9 def propose_instructions_for_program(self):CODE
LOWdspy/propose/propose_base.py12 def propose_instruction_for_predictor(self):CODE
LOWdspy/propose/utils.py22def create_instruction_set_history_string(base_program, trial_logs, top_n):CODE
LOWdspy/propose/utils.py58def parse_list_of_instructions(instruction_string):CODE
LOWdspy/propose/utils.py70def get_program_instruction_set_string(program):CODE
LOWdspy/propose/utils.py78def create_predictor_level_history_string(base_program, predictor_i, trial_logs, top_n):CODE
LOWdspy/propose/grounded_proposer.py64def generate_instruction_class(CODE
LOWdspy/propose/grounded_proposer.py155 def gather_examples_from_sets(candidate_sets, max_examples):CODE
LOW⚡dspy/propose/grounded_proposer.py306 def propose_instructions_for_program(CODE
LOW⚡dspy/propose/grounded_proposer.py366 def propose_instruction_for_predictor(CODE
LOWdspy/clients/base_lm.py124 def supports_function_calling(self) -> bool:CODE
LOWdspy/clients/base_lm.py372 def _extract_citations_from_response(self, choice):CODE
LOWdspy/clients/embedding.py169def _cached_compute_embeddings(model, batch_inputs, caching=True, **kwargs):CODE
LOWdspy/clients/embedding.py185async def _cached_acompute_embeddings(model, batch_inputs, caching=True, **kwargs):CODE
LOWdspy/clients/__init__.py86def configure_litellm_logging(level: str = "ERROR"):CODE
LOWdspy/clients/utils_finetune.py131def find_data_errors_completion(data_dict: dict[str, str]) -> str | None:CODE
LOWdspy/clients/utils_finetune.py164def find_data_error_chat_message(message: dict[str, Any]) -> str | None:CODE
LOW⚡dspy/clients/openai.py124 def is_terminal_training_status(status: TrainingStatus) -> bool:CODE
LOWdspy/clients/_litellm.py12def _configure_litellm_defaults(litellm: types.ModuleType) -> None:CODE
LOWdspy/clients/_litellm.py38def is_litellm_context_window_error(error: Exception) -> bool:CODE
LOWdspy/clients/lm.py37def _is_openai_reasoning_model(model: str) -> bool:CODE
LOWdspy/clients/lm.py327 def supports_function_calling(self) -> bool:CODE
LOWdspy/clients/lm.py358 def _get_cached_completion_fn(self, completion_fn, cache):CODE
LOWdspy/clients/lm.py645def _get_stream_completion_fn(CODE
LOWdspy/clients/lm.py790def litellm_responses_completion(request: dict[str, Any], num_retries: int, cache: dict[str, Any] | None = None):CODE
LOWdspy/clients/lm.py806async def alitellm_responses_completion(request: dict[str, Any], num_retries: int, cache: dict[str, Any] | None = None):CODE
LOWdspy/clients/lm.py822def _convert_chat_request_to_responses_request(request: dict[str, Any]):CODE
LOWdspy/clients/lm.py831def _add_dspy_identifier_to_headers(headers: dict[str, Any] | None = None):CODE
LOWdspy/clients/databricks.py273def _create_directory_in_databricks_unity_catalog(w: "WorkspaceClient", databricks_unity_catalog_path: str):CODE
LOWdspy/clients/databricks.py346def _validate_completion_data(data: dict[str, Any]):CODE
LOWdspy/retrievers/databricks_rm.py326 def _query_via_databricks_sdk(CODE
LOW⚡dspy/_vendor/lm15/auth.py187def extract_chatgpt_account_id(token: str) -> str | None:CODE
LOW⚡dspy/_vendor/lm15/auth.py362def load_codex_cli_credential(CODE
LOWdspy/_vendor/lm15/auth.py233def load_claude_code_credential(CODE
LOWdspy/_vendor/lm15/auth.py262def read_claude_code_credential(CODE
LOWdspy/_vendor/lm15/auth.py272def refresh_claude_code_credential(refresh_token: str) -> LocalOAuthCredential:CODE
LOWdspy/_vendor/lm15/auth.py293def _write_claude_code_credential_unlocked(credential: LocalOAuthCredential, path: Path) -> None:CODE
LOWdspy/_vendor/lm15/auth.py306def write_claude_code_credential(CODE
LOWdspy/_vendor/lm15/auth.py315def get_claude_code_access_token(CODE
LOWdspy/_vendor/lm15/auth.py392def read_codex_cli_credential(CODE
LOWdspy/_vendor/lm15/auth.py402def refresh_codex_cli_credential(refresh_token: str) -> LocalOAuthCredential:CODE
LOWdspy/_vendor/lm15/auth.py424def write_codex_cli_credential(CODE
LOWdspy/_vendor/lm15/auth.py435def _write_codex_cli_credential_unlocked(CODE
LOWdspy/_vendor/lm15/auth.py457def get_codex_cli_access_token(CODE
LOWdspy/_vendor/lm15/auth.py613def _xai_credential_from_token_response(CODE
LOWdspy/_vendor/lm15/auth.py746def _parse_xai_device_authorization(payload: dict[str, Any]) -> XaiDeviceAuthorization:CODE
LOWdspy/_vendor/lm15/_authlock.py298def write_private_json_atomic(path: Path, data: dict[str, Any]) -> None:CODE
LOWdspy/_vendor/lm15/compat.py33def _check_json_object_or_none(value: object, field_name: str) -> None:CODE
LOWdspy/_vendor/lm15/compat.py932def resolve_openai_chat_compat(partial: OpenAIChatCompat) -> ResolvedOpenAIChatCompat:CODE
LOWdspy/_vendor/lm15/compat.py1171def merge_openai_responses_compat(CODE
LOWdspy/_vendor/lm15/compat.py1192def resolve_openai_responses_compat(partial: OpenAIResponsesCompat) -> ResolvedOpenAIResponsesCompat:CODE
LOWdspy/_vendor/lm15/models.py34def _check_non_negative_or_none(value: float | None, field_name: str) -> None:CODE
LOWdspy/_vendor/lm15/models.py62def _check_json_object_or_none(value: object, field_name: str) -> None:CODE
LOW⚡dspy/_vendor/lm15/serde.py1001def image_generation_request_to_dict(r: ImageGenerationRequest) -> dict[str, Any]:CODE
LOW⚡dspy/_vendor/lm15/serde.py1011def image_generation_request_from_dict(d: dict[str, Any]) -> ImageGenerationRequest:CODE
LOW⚡dspy/_vendor/lm15/serde.py1021def image_generation_response_to_dict(r: ImageGenerationResponse) -> dict[str, Any]:CODE
LOW⚡dspy/_vendor/lm15/serde.py1043def speech_generation_request_to_dict(r: SpeechGenerationRequest) -> dict[str, Any]:CODE
LOW⚡dspy/_vendor/lm15/serde.py1053def speech_generation_request_from_dict(d: dict[str, Any]) -> SpeechGenerationRequest:CODE
LOW⚡dspy/_vendor/lm15/serde.py1063def speech_generation_response_to_dict(r: SpeechGenerationResponse) -> dict[str, Any]:CODE
1930 more matches not shown…
Decorative Section Separators274 hits · 915 pts
SeverityFileLineSnippetContext
MEDIUM⚡dspy/_vendor/lm15/auth.py359# ─── OpenAI Codex CLI (~/.codex/auth.json) ───────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/auth.py230# ─── Claude Code (~/.claude/.credentials.json) ───────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/auth.py507# ─── xAI Grok (device-code OAuth; lm15 store or Pi agent store) ──────COMMENT
MEDIUMdspy/_vendor/lm15/auth.py718# ─── xAI device-code login (RFC 8628) ────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/auth.py864# ─── Uniform login entry point ───────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/authkit.py59# ─── PKCE (RFC 7636, S256) ───────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/authkit.py81# ─── Device-code polling (RFC 8628 §3.5) ─────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/authkit.py163# ─── Loopback callback listener ──────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/authkit.py277# ─── lm15-owned credential store ─────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/compat.py25# ─── Shared helpers ──────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/compat.py48# ─── OpenAI Responses API compatibility ──────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/compat.py332# ─── OpenAI Chat Completions compatibility ───────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/compat.py946# ─── Anthropic Messages compatibility ───────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/compat.py1168# ─── Merge helpers ──────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/models.py21# ─── Validation helpers ──────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/models.py69# ─── Pricing ─────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/models.py122# ─── Endpoint-specific model capabilities ────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/models.py192# ─── Registry ────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/registry.py249 # ─── declaring a provider (RouterConfig(providers=...)) ─────────────COMMENT
MEDIUMdspy/_vendor/lm15/tools.py152# ─── JSON-value check (for defaults and enum/Literal members) ────────COMMENT
MEDIUMdspy/_vendor/lm15/tools.py176# ─── Hint → schema mapping ───────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/tools.py533# ─── Public API ──────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/batch.py41 # ─── Snapshot access ─────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/batch.py76 # ─── Verbs (update the snapshot in place, return self) ───────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/serde.py999# ─── Media generation ────────────────────────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/serde.py1083# ─── Video generation ────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py100# ─── Helpers ─────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py126# ─── Continuation state ──────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py163# ─── Parts ───────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py298# ─── Messages ────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py328# ─── Tools ───────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py361# ─── Config ──────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py447# ─── Cache resources ─────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py566# ─── Logprobs ────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py616# ─── ErrorDetail ─────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py636# ─── Delta ───────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py735# ─── Usage ───────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py763# ─── StreamEvent ─────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py805# ─── Request / Response ─────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py868# ─── Batch ─────────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py926# ─── Files ─────────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py1127# ─── ModelInfo ───────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py1222# ─── AudioFormat ─────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py1240# ─── LiveConfig ──────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/serde.py1277# ─── LiveClientEvent / LiveServerEvent ───────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/access.py69# ─── The table ───────────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/access.py177# ─── Responses servers reached through OpenAILM ────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/access.py205# ─── Chat Completions servers reached through OpenAIChatLM ───────────COMMENT
MEDIUMdspy/_vendor/lm15/access.py303# ─── Anthropic Messages servers reached through AnthropicLM ─────────────COMMENT
MEDIUMdspy/_vendor/lm15/access.py627# ─── Credential loading, keyed by provider ───────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py196# ── Stream assembly ──────────────────────────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py205# ── Model metadata (catalog hydration) ──────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py208# ── Router (lm15.router) ─────────────────────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py219# ── Connection budget (lm15.transports) ───────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py222# ── MAP-13 adaptations (lm15.adaptation) ──────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py225# ── Tool derivation (lm15.tools) ─────────────────────────────────────COMMENT
MEDIUM⚡dspy/_vendor/lm15/__init__.py235# ── Judgments (changes/2026-09-17-judgments.md) ─────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/__init__.py63# ── Canonical types ──────────────────────────────────────────────────COMMENT
MEDIUMdspy/_vendor/lm15/__init__.py145# ── Access policies (auth by composition; spec/auth.md AUTH-10) ──────COMMENT
MEDIUMdspy/_vendor/lm15/__init__.py148# ── Errors ───────────────────────────────────────────────────────────COMMENT
214 more matches not shown…
Unused Imports575 hits · 474 pts
SeverityFileLineSnippetContext
LOWdspy/__init__.py3CODE
LOWdspy/__init__.py4CODE
LOWdspy/__init__.py5CODE
LOWdspy/__init__.py6CODE
LOWdspy/__init__.py7CODE
LOWdspy/__init__.py8CODE
LOWdspy/__init__.py9CODE
LOWdspy/__init__.py11CODE
LOWdspy/__init__.py12CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py13CODE
LOWdspy/__init__.py14CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py15CODE
LOWdspy/__init__.py38CODE
LOWdspy/__init__.py38CODE
LOWdspy/__init__.py39CODE
LOWdspy/__init__.py40CODE
LOWdspy/__init__.py42CODE
LOWdspy/__init__.py43CODE
LOWdspy/__init__.py46CODE
LOWdspy/__init__.py47CODE
LOWdspy/__init__.py47CODE
LOWdspy/__init__.py47CODE
LOWdspy/__init__.py47CODE
LOWdspy/__init__.py47CODE
LOWdspy/lm15.py27CODE
LOWdspy/lm15.py29CODE
515 more matches not shown…
Empty Error Handlers56 hits · 280 pts
SeverityFileLineSnippetContext
HIGHdspy/propose/utils.py63except json.JSONDecodeError:CODE
HIGHdspy/clients/execution.py566except Exception:CODE
HIGHdspy/clients/lm_local.py222except Exception:CODE
HIGHdspy/clients/engines/lifecycle.py18except Exception:CODE
HIGHdspy/retrievers/embeddings.py152except ImportError:CODE
HIGHdspy/_vendor/lm15/_authlock.py322except OSError: # pragma: no cover - permission oddities are best-effortCODE
HIGHdspy/_vendor/lm15/_authlock.py331except OSError: # pragma: no cover - fsync of dir is best-effortCODE
HIGHdspy/_vendor/lm15/_authlock.py242except OSError:CODE
HIGHdspy/_vendor/lm15/_authlock.py317except OSError:CODE
HIGHdspy/_vendor/lm15/compat.py532except KeyError:CODE
HIGHdspy/_vendor/lm15/vet.py203except Exception:CODE
HIGHdspy/_vendor/lm15/result.py652except Exception:CODE
HIGHdspy/_vendor/lm15/result.py1180except Exception:CODE
HIGHdspy/_vendor/lm15/providers/gemini.py1162except Exception:CODE
HIGHdspy/_vendor/lm15/providers/openai.py1392except Exception:CODE
HIGHdspy/_vendor/lm15/providers/xai.py266except ValueError:CODE
HIGHdspy/_vendor/lm15/providers/base.py117except (TypeError, ValueError, OverflowError):CODE
HIGHdspy/_vendor/lm15/transports/_ssl.py30except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_types.py107except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_types.py199except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_proxy.py72except Exception: # pragma: no cover — platform lookup quirks bypass nothingCODE
HIGHdspy/_vendor/lm15/transports/_fetch.py173except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_fetch.py165except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_async.py126except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_async.py137except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_async.py141except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_async.py490except OSError:CODE
HIGHdspy/_vendor/lm15/transports/_async.py520except OSError:CODE
HIGHdspy/_vendor/lm15/transports/_sync.py114except Exception:CODE
HIGHdspy/_vendor/lm15/transports/_sync.py419except OSError:CODE
HIGHdspy/_vendor/lm15/transports/_sync.py428except Exception:CODE
HIGHdspy/_vendor/lm15/cloud/chains.py538except ValueError:CODE
HIGHdspy/signatures/signature.py735except ImportError:CODE
HIGHdspy/datasets/alfworld/alfworld.py75except RuntimeError:CODE
HIGHdspy/utils/parallelizer.py196except Exception:CODE
HIGHdspy/utils/pickle_by_value.py56except ValueError:CODE
HIGHdspy/streaming/streaming_listener.py288except ValueError:CODE
HIGHdspy/streaming/streaming_listener.py265except ValueError:CODE
HIGHdspy/primitives/python_interpreter.py364except ProcessLookupError:CODE
HIGHdspy/primitives/base_module.py121except Exception:CODE
HIGHdspy/adapters/types/base_type.py56except TypeError:CODE
HIGHdspy/adapters/types/citation.py203except Exception:CODE
HIGHdspy/predict/refine.py205except TypeError:CODE
HIGHdspy/teleprompt/simba_utils.py239except (TypeError, orjson.JSONEncodeError):CODE
HIGHdspy/teleprompt/gepa/gepa_flex_utils.py45except Exception:CODE
HIGHtests/clients/test_lm_async_execution.py69except (BrokenPipeError, ConnectionResetError):CODE
HIGHtests/signatures/test_adapter_image.py447except Exception:CODE
HIGHtests/signatures/test_adapter_file.py20except Exception:CODE
HIGHtests/utils/test_usage_tracker.py513except RuntimeError:CODE
HIGHtests/adapters/conftest.py59except StopAdapterCallCapture:CODE
HIGHtests/adapters/test_baml_adapter.py336except Exception:CODE
HIGHtests/adapters/test_resource_loading.py44except (ValueError, TypeError):CODE
HIGHtests/adapters/test_resource_loading.py55except (ValueError, TypeError, ValidationError):CODE
HIGHtests/flex/test_flex_interpreter.py456except Exception:CODE
HIGHtests/flex/test_flex_interpreter.py476except Exception:CODE
HIGHdocs/hooks/fetch_stats.py65except Exception:CODE
Excessive Try-Catch Wrapping207 hits · 232 pts
SeverityFileLineSnippetContext
LOWdspy/propose/dataset_summary_generator.py82 except Exception as e:CODE
LOWdspy/propose/grounded_proposer.py222 except Exception as e:CODE
MEDIUMdspy/propose/grounded_proposer.py224 print(f"Error getting program description. Running without program aware proposer. Error: {e}")CODE
LOWdspy/propose/grounded_proposer.py289 except Exception as e:CODE
MEDIUMdspy/propose/grounded_proposer.py290 print(f"Error getting source code: {e}.\n\nRunning without program aware proposer.")CODE
LOW⚡dspy/propose/grounded_proposer.py301 except Exception as e:CODE
MEDIUM⚡dspy/propose/grounded_proposer.py302 print(f"Error getting data summary: {e}.\n\nRunning without data aware proposer.")CODE
LOWdspy/clients/base_lm.py390 except Exception:CODE
LOWdspy/clients/disk_serialization.py64 except Exception as e:CODE
LOWdspy/clients/execution.py430 except Exception:CODE
LOWdspy/clients/execution.py459 except Exception:CODE
LOWdspy/clients/execution.py507 except Exception:CODE
LOWdspy/clients/execution.py523 except Exception:CODE
LOWdspy/clients/execution.py560 except Exception as secondary:CODE
LOWdspy/clients/execution.py566 except Exception:CODE
LOWdspy/clients/execution.py636 except Exception as exc:CODE
LOWdspy/clients/execution.py711 except Exception as exc:CODE
MEDIUMdspy/clients/execution.py499def _partial(accumulator):CODE
LOWdspy/clients/lm_local.py222 except Exception:CODE
MEDIUMdspy/clients/lm_local.py200def train_sft_locally(model_name, train_data, train_kwargs):CODE
LOWdspy/clients/cache.py121 except Exception:CODE
LOWdspy/clients/cache.py177 except Exception:CODE
LOWdspy/clients/cache.py188 except Exception as e:CODE
LOWdspy/clients/__init__.py73 except Exception as e:CODE
LOW⚡dspy/clients/openai.py110 except Exception:CODE
LOW⚡dspy/clients/openai.py120 except Exception:CODE
LOWdspy/clients/costs.py24 except Exception:CODE
LOWdspy/clients/lm.py557 except Exception as err:CODE
LOWdspy/clients/databricks.py159 except Exception:CODE
LOWdspy/clients/databricks.py259 except Exception as e:CODE
LOW⚡dspy/clients/databricks.py289 except Exception:CODE
LOW⚡dspy/clients/databricks.py298 except Exception:CODE
MEDIUMdspy/clients/databricks.py263def _get_workspace_client() -> "WorkspaceClient":CODE
LOWdspy/clients/errors.py117 except Exception as exc:CODE
LOWdspy/clients/model_metadata/__init__.py72 except Exception as exc:CODE
LOWdspy/clients/engines/legacy_engine.py81 except Exception as exc:CODE
LOWdspy/clients/engines/legacy_engine.py112 except Exception as exc:CODE
LOWdspy/clients/engines/lifecycle.py18 except Exception:CODE
LOWdspy/clients/engines/lifecycle.py37 except Exception as cleanup:CODE
LOWdspy/clients/engines/lifecycle.py60 except Exception as cleanup:CODE
LOWdspy/clients/engines/litellm_errors.py121 except Exception as exc:CODE
MEDIUMdspy/clients/engines/litellm_errors.py118def litellm_errors(*, model=None, provider=None):CODE
LOW⚡dspy/_vendor/lm15/auth.py180 except Exception:CODE
LOW⚡dspy/_vendor/lm15/auth.py190 except Exception:CODE
LOW⚡dspy/_vendor/lm15/auth.py349 except Exception as exc:CODE
LOWdspy/_vendor/lm15/auth.py154 except Exception:CODE
LOWdspy/_vendor/lm15/auth.py490 except Exception as exc:CODE
LOWdspy/_vendor/lm15/auth.py705 except Exception as exc:CODE
LOWdspy/_vendor/lm15/auth.py782 except Exception:CODE
LOWdspy/_vendor/lm15/models.py291 except Exception as exc:CODE
LOWdspy/_vendor/lm15/tools.py333 except Exception as exc:CODE
LOWdspy/_vendor/lm15/tools.py359 except Exception as exc:CODE
LOWdspy/_vendor/lm15/tools.py585 except Exception as exc:CODE
LOWdspy/_vendor/lm15/vet.py203 except Exception:CODE
LOWdspy/_vendor/lm15/vet.py854 except Exception as exc:CODE
LOWdspy/_vendor/lm15/vet.py867 except Exception as exc:CODE
MEDIUMdspy/_vendor/lm15/result.py585def _incomplete(accumulator):CODE
MEDIUMdspy/_vendor/lm15/result.py656def _close_events(source, primary=None, response=None, record=None):CODE
MEDIUMdspy/_vendor/lm15/result.py665def _aclose_events(source, primary=None, response=None, record=None):CODE
LOW⚡dspy/_vendor/lm15/result.py652 except Exception:CODE
147 more matches not shown…
Docstring Block Structure41 hits · 205 pts
SeverityFileLineSnippetContext
HIGHdspy/clients/base_lm.py240Reconstruct an LM from `dump_state` output. Legacy states without a class marker load as `dspy.LM`. Custom LM STRING
HIGHdspy/clients/provider.py13A future representing an asynchronous model fine-tuning job. This class extends `concurrent.futures.Future` to reprSTRING
HIGHdspy/clients/provider.py82A job for reinforcement learning-based fine-tuning. This class represents a reinforcement learning fine-tuning job STRING
HIGHdspy/retrievers/embeddings.py158 Load the embeddings index from disk into the current instance. Args: path: Directory path STRING
HIGHdspy/retrievers/embeddings.py218 Create an Embeddings instance from a saved index. This is the recommended way to load saved embeddingsSTRING
HIGHdspy/signatures/signature.py279Return a new Signature class with identical fields and new instructions. This method does not mutate `cls`. It STRING
HIGHdspy/signatures/signature.py308Return a new Signature class with identical fields and `instructions` appended to the existing instructions. ThSTRING
HIGHdspy/signatures/signature.py363Insert a field at index 0 of the `inputs` or `outputs` section. Args: name (str): Field name to addSTRING
HIGHdspy/signatures/signature.py390Insert a field at the end of the `inputs` or `outputs` section. Args: name (str): Field name to addSTRING
HIGHdspy/signatures/signature.py417Return a new Signature class without the given field. If `name` is not present, the fields are unchanged (no erSTRING
HIGHdspy/signatures/signature.py452Insert a field at a specific position among inputs or outputs. Negative indices are supported (e.g., `-1` appenSTRING
HIGHdspy/signatures/signature.py564Create a new Signature subclass with the specified fields and instructions. Args: signature: Either a strinSTRING
HIGHdspy/signatures/signature.py686Recursively parse an AST node representing a type annotation. This function converts Python's Abstract Syntax Tree STRING
HIGHdspy/streaming/streamify.py63 Wrap a DSPy program so that it streams its outputs incrementally, rather than returning them all at once. It alSTRING
HIGHdspy/primitives/code_interpreter.py127Execute Python code and return the result. Args: code: Python code to execute variablesSTRING
HIGHdspy/primitives/example.py230Mark which fields are inputs and return a new `Example`. Fields not listed here are treated as labels (expectedSTRING
HIGHdspy/primitives/module.py41Base class for all DSPy modules (programs). A Module is a building block for DSPy programs that can contain predictSTRING
HIGHdspy/primitives/module.py227Apply a function to all named predictors in this module. This method iterates through all Predict instances in STRING
HIGHdspy/primitives/module.py281 Processes a list of dspy.Example instances in parallel using the Parallel module. Args: exSTRING
HIGHdspy/adapters/types/citation.py95Convert a list of dictionaries to a Citations instance. Args: citations_dicts: A list of dictionariSTRING
HIGHdspy/adapters/types/tool.py239 Build a DSPy tool from a LangChain tool. Args: tool: The LangChain tool to convert. STRING
HIGHdspy/adapters/types/tool.py304Execute this individual tool call and return its result. Args: functions: Functions to searSTRING
HIGHdspy/adapters/types/tool.py365Convert a list of dictionaries to a ToolCalls instance. Args: tool_calls_dicts: A list of dictionarSTRING
HIGHdspy/adapters/types/image.py185 Normalize an in-memory image or preserve a remote image reference. Args: image: A PIL Image, bytes, URSTRING
HIGHdspy/evaluate/metrics.py12Compute the Exact Match (EM) metric between a prediction and reference answers. Returns True if any reference exactSTRING
HIGHdspy/evaluate/metrics.py40Compute the maximum token-level F1 score against reference answers. Strings are normalized (same as in `EM`) and whSTRING
HIGHdspy/evaluate/metrics.py64Compute the maximum HotPotQA-style F1 score against reference answers. Like `F1`, but if either normalized side is STRING
HIGHdspy/evaluate/metrics.py88Normalize text for string and token comparisons. Steps: 1) Unicode NFD normalization 2) lowercasingSTRING
HIGHdspy/evaluate/metrics.py127Compute boolean exact match after normalization. Args: prediction (str): Predicted answer. ground_tSTRING
HIGHdspy/evaluate/metrics.py145Compute token-level F1 between prediction and reference (after normalization). Strings are normalized (see `normaliSTRING
HIGHdspy/evaluate/metrics.py184Compute HotPotQA-style token F1 with special labels. If either normalized string is in {"yes", "no", "noanswer"} anSTRING
HIGHdspy/evaluate/metrics.py222Compute token-level precision of prediction against reference (after normalization). Precision is (# overlapping toSTRING
HIGHdspy/evaluate/metrics.py286Evaluate exact match or F1-thresholded match for an example/prediction pair. If `example.answer` is a string, compaSTRING
HIGHdspy/evaluate/metrics.py321Return True if any passage in `pred.context` contains the answer(s). Strings are normalized (and passages also use STRING
HIGHdspy/evaluate/evaluate.py129 Args: program (dspy.Module): The DSPy program to evaluate. metric (Callable): The metriSTRING
HIGHdspy/predict/rlm.py821Execute RLM to produce outputs from the given inputs. Args: interpreter_factory: Optional zero-arguSTRING
HIGHdspy/predict/rlm.py919Async version of forward(). Execute RLM to produce outputs. Args: interpreter_factory: Optional zerSTRING
HIGHdspy/predict/refine.py50 Refines a module by running it up to N times with different rollout IDs at `temperature=1.0` and returnSTRING
HIGHdspy/teleprompt/bettertogether.py212Compile and optimize a student program using a sequence of optimization strategies. Executes the optimizers speSTRING
HIGHdspy/teleprompt/gepa/gepa.py237 ... ``` GEPA can also be used as a batch inference-time search strategy, by passing `valset=trainset, STRING
HIGHtests/mock_interpreter.py83Execute code and return the next scripted response. Args: code: The code that would be executed (reSTRING
Self-Referential Comments62 hits · 178 pts
SeverityFileLineSnippetContext
MEDIUM⚡dspy/propose/grounded_proposer.py314 """This method is responsible for returning the full set of new instructions for our program, given the specifieSTRING
MEDIUMdspy/propose/grounded_proposer.py334 # Create an instruction for each predictorCOMMENT
MEDIUM⚡dspy/propose/grounded_proposer.py376 """This method is responsible for returning a single instruction for a given predictor, using the specified critSTRING
MEDIUM⚡dspy/propose/grounded_proposer.py378 # Create an instruction history string for our predictorCOMMENT
MEDIUMdspy/clients/cache.py253 # Create a modified request that includes the function identifier so that it's incorporated into the cacheCOMMENT
MEDIUM⚡dspy/clients/databricks.py299 # Create the directory if it doesn't exist, we don't raise an error because this is a common case.COMMENT
MEDIUMdspy/retrievers/embeddings.py241 # Create a minimal instance without triggering embedding computationCOMMENT
MEDIUMdspy/retrievers/databricks_rm.py44 # Create a Databricks Vector Search EndpointSTRING
MEDIUMdspy/retrievers/databricks_rm.py51 # Create a Databricks Direct Access Vector Search IndexSTRING
MEDIUMdspy/retrievers/databricks_rm.py66 # Create a DatabricksRM retriever module to query the Databricks Direct Access VectorSTRING
MEDIUMdspy/streaming/streamify.py96 # Create the program and wrap it with streaming functionalitySTRING
MEDIUMdspy/streaming/streamify.py128 # Create the program and wrap it with streaming functionalitySTRING
MEDIUMdspy/streaming/streamify.py154 # Create the program and wrap it with streaming functionalitySTRING
MEDIUM⚡dspy/primitives/base_module.py124 # Create an empty instance.COMMENT
MEDIUMdspy/primitives/base_module.py212 # Create the directory (and any parent directories)COMMENT
MEDIUMdspy/primitives/module.py22 # Create the instance without invoking ``__init__`` so we can injectCOMMENT
MEDIUMdspy/primitives/module.py298 # Create a list of execution pairs (self, example)COMMENT
MEDIUMdspy/primitives/module.py301 # Create an instance of ParallelCOMMENT
MEDIUMdspy/adapters/two_step_adapter.py68 # Create a task description for the main LMCOMMENT
MEDIUMdspy/adapters/types/tool.py144 # Create a pydantic model wrapper with a dummy field `value` to parse the arg to the correct type.COMMENT
MEDIUM⚡dspy/predict/refine.py72 # Define a QA module with chain of thoughtSTRING
MEDIUM⚡dspy/predict/refine.py75 # Define a reward function that checks for one-word answersSTRING
MEDIUM⚡dspy/predict/refine.py79 # Create a refined module that tries up to 3 timesSTRING
MEDIUMdspy/predict/code_act.py128 # Define the tool functions in the interpreterCOMMENT
MEDIUMdspy/predict/knn.py23 # Create a training dataset with examplesSTRING
MEDIUM⚡dspy/teleprompt/knn_fewshot.py29 # Define a QA module with chain of thoughtSTRING
MEDIUM⚡dspy/teleprompt/knn_fewshot.py32 # Create a training dataset with examplesSTRING
MEDIUMdspy/teleprompt/utils.py39 # Create the mini-batch using the sampled indicesCOMMENT
MEDIUMdspy/teleprompt/utils.py220 # Define the save path for the programCOMMENT
MEDIUM⚡dspy/teleprompt/utils.py248 # Create a loggerCOMMENT
MEDIUM⚡dspy/teleprompt/utils.py252 # Create a file handler that logs debug and higher level messagesCOMMENT
MEDIUM⚡dspy/teleprompt/utils.py259 # Create a console handler with a higher log levelCOMMENT
MEDIUMdspy/teleprompt/mipro_optimizer_v2.py548 # Initialize optimization variablesCOMMENT
MEDIUMdspy/teleprompt/mipro_optimizer_v2.py556 # Define the objective functionCOMMENT
MEDIUMdspy/teleprompt/mipro_optimizer_v2.py568 # Create a new candidate programCOMMENT
MEDIUMdspy/teleprompt/gepa/instruction_proposal.py522 # Create a rich multimodal examples_with_feedback that includes both text and imagesCOMMENT
MEDIUM⚡tests/clients/test_cache.py246 # Define a test functionCOMMENT
MEDIUM⚡tests/clients/test_cache.py303 # Define a test functionCOMMENT
MEDIUM⚡tests/clients/test_cache.py330 # Define a test functionCOMMENT
MEDIUMtests/clients/test_cache.py217 # Create a new cache instance with disk cache disabledCOMMENT
MEDIUMtests/clients/test_cache.py273 # Define a test functionCOMMENT
MEDIUMtests/test_utils/server/__init__.py33 # Create a server log file used to store request logsCOMMENT
MEDIUMtests/signatures/test_adapter_image.py426 # Create a dspy.Image from the fileCOMMENT
MEDIUMtests/utils/test_saving.py96 # Create a custom handler to capture log messagesCOMMENT
MEDIUMtests/utils/test_settings.py127 # Define the coroutines to be runCOMMENT
MEDIUMtests/utils/test_settings.py229 # Create a temporary Python file with our custom moduleCOMMENT
MEDIUM⚡tests/primitives/test_python_interpreter.py1397 # Create a string just over the thresholdCOMMENT
MEDIUM⚡tests/primitives/test_python_interpreter.py1407 # Create a string with recognizable pattern just over thresholdCOMMENT
MEDIUMtests/primitives/test_base_module.py135 # Create a temporary Python file with our custom moduleCOMMENT
MEDIUMtests/primitives/test_base_module.py202 # Create a custom handler to capture log messagesSTRING
MEDIUM⚡tests/predict/test_rlm.py824 # Create a field with description and constraintsCOMMENT
MEDIUMtests/predict/test_predict.py607 # Define a model for datetime inputs and outputsCOMMENT
MEDIUMtests/predict/test_predict.py1764 # Create an instance of the Query modelCOMMENT
MEDIUMtests/predict/test_react.py215 # Create a simple tool for testingCOMMENT
MEDIUMtests/reliability/generate/utils.py297 # Create a GeneratedTestCase object and add it to the listCOMMENT
MEDIUMtests/teleprompt/test_copro_optimizer.py7# Define a simple metric function for testingCOMMENT
MEDIUMtests/teleprompt/test_bootstrap_finetune.py10# Define a simple metric function for testingCOMMENT
MEDIUMtests/teleprompt/test_bootstrap.py10# Define a simple metric function for testingCOMMENT
MEDIUMtests/teleprompt/test_bettertogether.py18# Define a simple metric function for testingCOMMENT
MEDIUMtests/teleprompt/test_bettertogether.py179 # Create a mock Teleprompter that returns the studentCOMMENT
2 more matches not shown…
Deep Nesting182 hits · 157 pts
SeverityFileLineSnippetContext
LOWdspy/propose/dataset_summary_generator.py48CODE
LOWdspy/propose/utils.py146CODE
LOWdspy/propose/grounded_proposer.py144CODE
LOWdspy/propose/grounded_proposer.py306CODE
LOWdspy/propose/grounded_proposer.py155CODE
LOWdspy/clients/execution.py73CODE
LOWdspy/clients/execution.py264CODE
LOWdspy/clients/execution.py555CODE
LOWdspy/clients/execution.py574CODE
LOWdspy/clients/execution.py613CODE
LOWdspy/clients/execution.py653CODE
LOWdspy/clients/execution.py692CODE
LOWdspy/clients/cache.py17CODE
LOWdspy/clients/cache.py41CODE
LOWdspy/clients/legacy_outputs.py24CODE
LOWdspy/clients/capabilities.py121CODE
LOWdspy/clients/databricks.py305CODE
LOWdspy/clients/databricks.py51CODE
LOWdspy/clients/legacy_requests.py80CODE
LOWdspy/clients/legacy_requests.py104CODE
LOWdspy/clients/model_metadata/__init__.py44CODE
LOWdspy/clients/model_metadata/__init__.py108CODE
LOWdspy/clients/engines/litellm_engine.py203CODE
LOWdspy/clients/engines/lifecycle.py45CODE
LOWdspy/clients/engines/streaming.py22CODE
LOWdspy/retrievers/weaviate_rm.py73CODE
LOWdspy/retrievers/weaviate_rm.py113CODE
LOWdspy/_vendor/lm15/tools.py200CODE
LOWdspy/_vendor/lm15/tools.py454CODE
LOWdspy/_vendor/lm15/serde.py165CODE
LOWdspy/_vendor/lm15/serde.py638CODE
LOWdspy/_vendor/lm15/types.py154CODE
LOWdspy/_vendor/lm15/types.py1275CODE
LOWdspy/_vendor/lm15/types.py2631CODE
LOWdspy/_vendor/lm15/result.py522CODE
LOWdspy/_vendor/lm15/result.py676CODE
LOWdspy/_vendor/lm15/result.py108CODE
LOWdspy/_vendor/lm15/result.py388CODE
LOWdspy/_vendor/lm15/live.py148CODE
LOWdspy/_vendor/lm15/router.py303CODE
LOWdspy/_vendor/lm15/router.py905CODE
LOWdspy/_vendor/lm15/router.py1108CODE
LOWdspy/_vendor/lm15/router.py386CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py124CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py323CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py451CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py613CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py687CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py938CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py1190CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py1345CODE
LOWdspy/_vendor/lm15/providers/openai_chat.py1679CODE
LOWdspy/_vendor/lm15/providers/gemini.py699CODE
LOWdspy/_vendor/lm15/providers/gemini.py881CODE
LOWdspy/_vendor/lm15/providers/gemini.py991CODE
LOWdspy/_vendor/lm15/providers/gemini.py1125CODE
LOWdspy/_vendor/lm15/providers/gemini.py1194CODE
LOWdspy/_vendor/lm15/providers/gemini.py1233CODE
LOWdspy/_vendor/lm15/providers/gemini.py1393CODE
LOWdspy/_vendor/lm15/providers/typesafe.py114CODE
122 more matches not shown…
Modern AI Meta-Vocabulary39 hits · 116 pts
SeverityFileLineSnippetContext
MEDIUMdspy/adapters/base.py270 # Begin few-shot examplesSTRING
MEDIUMdspy/adapters/base.py276 # End few-shot examplesSTRING
MEDIUM⚡dspy/predict/refine.py72 # Define a QA module with chain of thoughtSTRING
MEDIUM⚡dspy/teleprompt/knn_fewshot.py29 # Define a QA module with chain of thoughtSTRING
MEDIUMdspy/teleprompt/knn_fewshot.py45 # Compile the QA module with few-shot learningSTRING
MEDIUMdspy/teleprompt/random_search.py82 # zero-shotCOMMENT
MEDIUMdspy/teleprompt/random_search.py91 # unshuffled few-shotCOMMENT
MEDIUMdspy/teleprompt/random_search.py165# Alternatively, we can keep track of the (zero-shot) number of tokens when we bootstrap.COMMENT
MEDIUMdspy/teleprompt/utils.py365 # zero-shotCOMMENT
MEDIUMdspy/teleprompt/utils.py378 # unshuffled few-shotCOMMENT
MEDIUMdspy/teleprompt/utils.py391 # shuffled few-shotCOMMENT
MEDIUMdspy/teleprompt/copro_optimizer.py150 # Seed the prompt optimizer zero shot with just the instruction, generate BREADTH new promptsCOMMENT
MEDIUM⚡dspy/teleprompt/mipro_optimizer_v2.py230 # Step 1: Bootstrap few-shot examplesCOMMENT
MEDIUM⚡dspy/teleprompt/mipro_optimizer_v2.py256 # If zero-shot, discard demosCOMMENT
MEDIUM⚡dspy/teleprompt/mipro_optimizer_v2.py309 # Set num instruct candidates to 1/2 of N if optimizing with few-shot examples, otherwise set to NCOMMENT
MEDIUM⚡dspy/teleprompt/mipro_optimizer_v2.py310 # This is because we've found that it's generally better to spend optimization budget on few-shot examplesCOMMENT
MEDIUM⚡dspy/teleprompt/mipro_optimizer_v2.py283 num_vars *= 2 # Account for few-shot examples + instruction variablesCODE
MEDIUMdspy/teleprompt/mipro_optimizer_v2.py448 # logger.info(f"!!!!\n\n\n\n\nError generating few-shot examples: {e}")COMMENT
MEDIUMdspy/teleprompt/mipro_optimizer_v2.py449 # logger.info("Running without few-shot examples.!!!!\n\n\n\n\n")COMMENT
MEDIUMtests/adapters/test_json_adapter.py985 # 1 system message, 2 few shot examples (1 user and assistant message for each example), 1 user messageCOMMENT
MEDIUMtests/adapters/test_json_adapter.py1078 # Image information in the few-shot example's user messageCOMMENT
MEDIUMtests/adapters/test_chat_adapter.py2210 # 1 system message, 2 few shot examples (1 user and assistant message for each example), 1 user messageCOMMENT
MEDIUMtests/adapters/test_chat_adapter.py2275 # Image information in the few-shot example's user messageCOMMENT
MEDIUMtests/adapters/test_xml_adapter.py390 # Image information in the few-shot example's user messageSTRING
MEDIUMtests/predict/test_react.py237 # The 3rd call raises context window exceeded errorCOMMENT
MEDIUM⚡tests/examples/test_baleen.py62 # Ask any question you like to this simple RAG program.COMMENT
MEDIUM⚡tests/examples/test_baleen.py66 uncompiled_baleen = SimplifiedBaleen() # uncompiled (i.e., zero-shot) programCODE
MEDIUMtests/examples/test_baleen.py103 uncompiled_baleen = SimplifiedBaleen() # uncompiled (i.e., zero-shot) programCODE
MEDIUMtests/teleprompt/test_utils.py84 # Find the call where seed == -1 (unshuffled few-shot)COMMENT
MEDIUMtests/teleprompt/test_random_search.py74 # -3 (zero-shot) is a valid seed; a plain iterator is single-use.COMMENT
MEDIUMdocs/overrides/home.html339 <div class="line"><span class="tok-cm"># Baseline 62% (gpt-5.4-mini, zero-shot)</span></div>CODE
MEDIUMdocs/docs/getting-started/react-and-tools.md72## ReAct manages an agentic loopCOMMENT
MEDIUMdocs/docs/api/optimizers/GEPA/GEPA_Advanced.md153#### Advanced Example: RAG-Enhanced Instruction ProposerCOMMENT
MEDIUM⚡docs/docs/tutorials/build_ai_program/index.md16## Retrieval-Augmented Generation (RAG)COMMENT
MEDIUM⚡docs/docs/tutorials/build_ai_program/index.md18### [Retrieval-Augmented Generation (RAG)](../rag/index.ipynb)COMMENT
MEDIUM⚡docs/docs/tutorials/build_ai_program/index.md21### [Building RAG as Agent](../agents/index.ipynb)COMMENT
MEDIUM⚡docs/docs/tutorials/build_ai_program/index.md24### [Multi-Hop RAG](../multihop_search/index.ipynb)COMMENT
MEDIUMdocs/docs/community/community-resources.md23| **Building Self-improving Agents in Production with DSPy** | [Link](https://relevanceai.com/blog/building-self-improviCODE
MEDIUMdocs/docs/community/use-cases.md62| **[Moody's](https://www.moodys.com/)** | Leveraging DSPy to optimize RAG systems, LLM-as-a-Judge, and agentic systems CODE
Cross-Language Confusion20 hits · 102 pts
SeverityFileLineSnippetContext
HIGHdspy/clients/execution.py600 accumulator.push(event)CODE
HIGHdspy/clients/execution.py679 accumulator.push(event)CODE
HIGHdspy/_vendor/lm15/compat.py264 # null) and reasoning comes back as `summary` text withCOMMENT
HIGHdspy/_vendor/lm15/tools.py717 affects only value nullability (``anyOf`` with null), neverSTRING
HIGHdspy/_vendor/lm15/result.py394 self._accumulator.push(event)CODE
HIGHdspy/_vendor/lm15/result.py496 self._accumulator.push(event)CODE
HIGHdspy/_vendor/lm15/result.py531 accumulator.push(event)CODE
HIGHdspy/_vendor/lm15/result.py557 accumulator.push(event)CODE
HIGHdspy/_vendor/lm15/result.py79 acc.push(event)STRING
HIGHdspy/_vendor/lm15/providers/openai_chat.py387 """A dict whose every value is null/empty (litellm: {"refusal": null})."""STRING
HIGHdspy/teleprompt/bootstrap.py121 assert predictor1.signature.equals(CODE
HIGHdspy/teleprompt/gepa/gepa_utils.py375 trace_instances = [t for t in trace if t[0].signature.equals(module.signature)]CODE
HIGH⚡tests/signatures/test_signature.py146 assert sig1.equals(sig2)CODE
HIGH⚡tests/signatures/test_signature.py152 assert not sig1.equals(sig2)CODE
HIGH⚡tests/signatures/test_signature.py160 assert TestSignature.equals(TestSignature)CODE
HIGHtests/signatures/test_signature.py515 assert sig1.equals(sig2)CODE
HIGHtests/signatures/test_signature.py557 assert Sig1.equals(Sig2)CODE
HIGHtests/adapters/test_baml_adapter.py211 assert 'mode: "auto" or null,' in schemaCODE
HIGHtests/adapters/test_chat_adapter.py803 '{"type": "null"}], "default": null, "title": "Document Title"}, "end_char_index": 'CODE
HIGHtests/adapters/test_chat_adapter.py806 '"string"}, {"type": "null"}], "default": null, "title": "Supported Text"}}, 'CODE
Modern Structural Boilerplate90 hits · 92 pts
SeverityFileLineSnippetContext
LOWdspy/lm15.py33__all__ = [CODE
LOWdspy/propose/__init__.py3__all__ = [CODE
LOWdspy/clients/lm_local.py19logger = logging.getLogger(__name__)CODE
LOWdspy/clients/cache.py14logger = logging.getLogger(__name__)CODE
LOWdspy/clients/__init__.py13logger = logging.getLogger(__name__)CODE
LOWdspy/clients/__init__.py112__all__ = [CODE
LOWdspy/clients/lm.py30logger = logging.getLogger(__name__)CODE
LOWdspy/clients/databricks.py16logger = logging.getLogger(__name__)CODE
LOWdspy/clients/model_metadata/__init__.py20logger = logging.getLogger(__name__)CODE
LOWdspy/clients/engines/__init__.py13__all__ = [CODE
LOWdspy/experimental/__init__.py7__all__ = [CODE
LOWdspy/retrievers/__init__.py4__all__ = ["Embeddings", "EmbeddingsWithScores", "Retrieve"]CODE
LOWdspy/_vendor/lm15/auth.py61__all__ = [CODE
LOWdspy/_vendor/lm15/authkit.py42__all__ = [CODE
LOWdspy/_vendor/lm15/credentials.py28__all__ = [CODE
LOWdspy/_vendor/lm15/registry.py81__all__ = [CODE
LOWdspy/_vendor/lm15/tools.py46__all__ = [CODE
LOWdspy/_vendor/lm15/batch.py29__all__ = ["AsyncBatchJob", "BatchJob"]CODE
LOW⚡dspy/_vendor/lm15/__init__.py239__all__ = [CODE
LOWdspy/_vendor/lm15/result.py58__all__ = [CODE
LOWdspy/_vendor/lm15/judgments.py307__all__ = [CODE
LOWdspy/_vendor/lm15/router.py91__all__ = [CODE
LOWdspy/_vendor/lm15/router.py878def _set_origin(lm: object, label: str) -> None:CODE
LOWdspy/_vendor/lm15/testing.py44__all__ = ["FakeLM", "FakeTransport", "FakeResponse"]CODE
LOWdspy/_vendor/lm15/model_registry.py9__all__ = ["ModelRegistry"]CODE
LOWdspy/_vendor/lm15/doctor.py48__all__ = ["AuthReport", "AuthStep", "explain_auth"]CODE
LOWdspy/_vendor/lm15/profiles.py49__all__ = [CODE
LOWdspy/_vendor/lm15/video_jobs.py20__all__ = ["AsyncVideoJob", "VideoJob", "VideoWaitTimeout"]CODE
LOWdspy/_vendor/lm15/providers/__init__.py23__all__ = [CODE
LOWdspy/_vendor/lm15/providers/typesafe.py341__all__ = ["TypeSafeLM"]CODE
LOWdspy/_vendor/lm15/providers/async_base.py1026__all__ = [CODE
LOWdspy/_vendor/lm15/transports/__init__.py29__all__ = [CODE
LOWdspy/_vendor/lm15/cloud/chains.py60__all__ = ["ChainContext", "Rung", "Step", "CredentialSource", "chain_for", "named_rungs", "explain",CODE
LOWdspy/_vendor/lm15/cloud/sigv4.py35__all__ = ["SigV4Signature", "sign", "canonicalize"]CODE
LOWdspy/_vendor/lm15/cloud/hosts.py39__all__ = ["resolve_settings", "render_base_url", "join_endpoint", "endpoint_from_env", "location_host",CODE
LOWdspy/_vendor/lm15/cloud/rs256.py42__all__ = ["RsaPrivateKey", "load_private_key", "certificate_der", "sign_pkcs1v15_sha256", "jwt_encode", "b64url"]CODE
LOWdspy/signatures/__init__.py10__all__ = [CODE
LOWdspy/datasets/__init__.py8__all__ = [CODE
LOWdspy/utils/callback.py12logger = logging.getLogger(__name__)CODE
LOWdspy/utils/parallelizer.py16logger = logging.getLogger(__name__)CODE
LOWdspy/utils/saving.py12logger = logging.getLogger(__name__)CODE
LOWdspy/utils/__init__.py26__all__ = [CODE
LOWdspy/streaming/__init__.py5__all__ = [CODE
LOWdspy/streaming/streamify.py20logger = logging.getLogger(__name__)CODE
LOWdspy/primitives/repl_types.py23__all__ = ["REPLVariable", "REPLEntry", "REPLHistory"]CODE
LOWdspy/primitives/__init__.py16__all__ = [CODE
LOW⚡dspy/primitives/python_interpreter.py32__all__ = ["PythonInterpreter", "FinalOutput", "CodeExecutionError", "CodeInterpreterError"]CODE
LOW⚡dspy/primitives/python_interpreter.py34logger = logging.getLogger(__name__)CODE
LOWdspy/primitives/base_module.py17logger = logging.getLogger(__name__)CODE
LOWdspy/primitives/module.py15logger = logging.getLogger(__name__)CODE
LOWdspy/primitives/sandbox_serializable.py38__all__ = ["SandboxSerializable", "build_repl_variable"]CODE
LOWdspy/adapters/__init__.py8__all__ = [CODE
LOWdspy/adapters/json_adapter.py26logger = logging.getLogger(__name__)CODE
LOWdspy/adapters/base.py23logger = logging.getLogger(__name__)CODE
LOWdspy/adapters/types/__init__.py10__all__ = ["History", "Image", "Audio", "File", "Type", "Tool", "ToolCalls", "ToolCallResults", "Code", "Reasoning"]CODE
LOWdspy/evaluate/__init__.py5__all__ = [CODE
LOWdspy/evaluate/evaluate.py45logger = logging.getLogger(__name__)CODE
LOWdspy/predict/rlm.py54logger = logging.getLogger(__name__)CODE
LOWdspy/predict/react.py10logger = logging.getLogger(__name__)CODE
LOWdspy/predict/predict.py23logger = logging.getLogger(__name__)CODE
30 more matches not shown…
Structural Annotation Overuse49 hits · 88 pts
SeverityFileLineSnippetContext
LOW⚡dspy/signatures/signature.py830 # Step 1: Convert camelCase to snake_caseCOMMENT
LOW⚡dspy/signatures/signature.py838 # Step 2: Handle numbers by adding underscores around themCOMMENT
LOWdspy/signatures/signature.py852 # Step 3: Convert to Title Case while preserving acronymsCOMMENT
LOW⚡dspy/teleprompt/mipro_optimizer_v2.py230 # Step 1: Bootstrap few-shot examplesCOMMENT
LOW⚡dspy/teleprompt/mipro_optimizer_v2.py261 # Step 3: Find optimal prompt parametersCOMMENT
LOWdspy/teleprompt/mipro_optimizer_v2.py243 # Step 2: Propose instruction candidatesCOMMENT
LOW⚡docs/docs/api/modules/RLM.md60##### Step 1: Initial Metadata (no direct access to full context)COMMENT
LOW⚡docs/docs/api/modules/RLM.md62# Step 1: Peek at the dataCOMMENT
LOW⚡docs/docs/api/modules/RLM.md70##### Step 2: Write Code to Explore ContextCOMMENT
LOW⚡docs/docs/api/modules/RLM.md72# Step 2: Search for relevant sectionsCOMMENT
LOW⚡docs/docs/api/modules/RLM.md82##### Step 3: Trigger Sub-LLM CallsCOMMENT
LOW⚡docs/docs/api/modules/RLM.md84# Step 3: Use sub-LLM for semantic extractionCOMMENT
LOW⚡docs/docs/api/modules/RLM.md93##### Step 4: Submit Final AnswerCOMMENT
LOW⚡docs/docs/api/modules/RLM.md95# Step 4: Return final answerCOMMENT
LOWdocs/docs/tutorials/mem0_react_agent/index.md27## Step 1: Understanding Mem0 IntegrationCOMMENT
LOWdocs/docs/tutorials/mem0_react_agent/index.md59## Step 2: Create Memory-Aware ToolsCOMMENT
LOW⚡docs/docs/tutorials/mem0_react_agent/index.md129## Step 3: Build the Memory-Enhanced ReAct AgentCOMMENT
LOWdocs/docs/tutorials/mem0_react_agent/index.md198## Step 4: Running the Memory-Enhanced AgentCOMMENT
LOWdocs/docs/tutorials/sample_code_generation/index.md21## Step 1: Documentation Fetching and ProcessingCOMMENT
LOWdocs/docs/tutorials/sample_code_generation/index.md198## Step 2: Learning from Documentation URLsSTRING
LOWdocs/docs/tutorials/sample_code_generation/index.md243## Step 3: Generating Code ExamplesCOMMENT
LOWdocs/docs/tutorials/sample_code_generation/index.md318## Step 4: Interactive Library Learning FunctionCOMMENT
LOWdocs/docs/tutorials/sample_code_generation/index.md335 # Step 1: Learn from documentationCOMMENT
LOWdocs/docs/tutorials/sample_code_generation/index.md338 # Step 2: Generate examples for each use caseCOMMENT
LOW⚡docs/docs/tutorials/optimizer_tracking/index.md104#### Step 1: Access the MLflow UICOMMENT
LOW⚡docs/docs/tutorials/optimizer_tracking/index.md107#### Step 2: Understanding the Experiment StructureCOMMENT
LOW⚡docs/docs/tutorials/optimizer_tracking/index.md112#### Step 3: Analyzing the Parent RunCOMMENT
LOW⚡docs/docs/tutorials/optimizer_tracking/index.md117#### Step 4: Examining Child RunsCOMMENT
LOWdocs/docs/tutorials/email_extraction/index.md64## Step 1: Define Our Data StructuresCOMMENT
LOWdocs/docs/tutorials/email_extraction/index.md97## Step 2: Create DSPy SignaturesCOMMENT
LOWdocs/docs/tutorials/email_extraction/index.md147## Step 3: Build the Email Processing ModuleCOMMENT
LOW⚡docs/docs/tutorials/email_extraction/index.md167 # Step 1: Classify the emailCOMMENT
LOW⚡docs/docs/tutorials/email_extraction/index.md174 # Step 2: Extract entitiesCOMMENT
LOW⚡docs/docs/tutorials/email_extraction/index.md181 # Step 3: Generate summaryCOMMENT
LOW⚡docs/docs/tutorials/email_extraction/index.md188 # Step 4: Determine actionsCOMMENT
LOW⚡docs/docs/tutorials/email_extraction/index.md196 # Step 5: Structure the resultsCOMMENT
LOWdocs/docs/tutorials/email_extraction/index.md213## Step 4: Running the Email Processing SystemCOMMENT
LOWdocs/docs/tutorials/ai_text_game/index.md21## Step 1: Core Game FrameworkCOMMENT
LOWdocs/docs/tutorials/ai_text_game/index.md168## Step 2: AI-Powered Story GenerationCOMMENT
LOWdocs/docs/tutorials/ai_text_game/index.md297## Step 3: Game Interface and InteractionCOMMENT
LOWdocs/docs/tutorials/ai_text_game/index.md405## Step 4: Main Game LoopSTRING
LOWdocs/docs/tutorials/yahoo_finance_react/index.md15## Step 1: Convert LangChain Tool to DSPyCOMMENT
LOWdocs/docs/tutorials/yahoo_finance_react/index.md33## Step 2: Create Supporting Financial ToolsCOMMENT
LOWdocs/docs/tutorials/yahoo_finance_react/index.md88## Step 3: Build the Financial ReAct AgentCOMMENT
LOWdocs/docs/tutorials/yahoo_finance_react/index.md115## Step 4: Run Financial AnalysisCOMMENT
LOWdocs/docs/tutorials/llms_txt_generation/index.md19### Step 1: Define Our SignaturesCOMMENT
LOWdocs/docs/tutorials/llms_txt_generation/index.md59### Step 2: Create the Repository Analyzer ModuleCOMMENT
LOWdocs/docs/tutorials/llms_txt_generation/index.md107### Step 3: Gather Repository InformationCOMMENT
LOWdocs/docs/tutorials/llms_txt_generation/index.md173### Step 4: Configure DSPy and Generate llms.txtCOMMENT
Over-Commented Block42 hits · 39 pts
SeverityFileLineSnippetContext
LOWdspy/_vendor/lm15/auth.py501 else NoneCOMMENT
LOWdspy/_vendor/lm15/compat.py81# on the messages it emits before a tool call and documents replaying themCOMMENT
LOWdspy/_vendor/lm15/compat.py361 "openrouter",COMMENT
LOWdspy/_vendor/lm15/compat.py381# the same field the Responses dialect already sends.COMMENT
LOWdspy/_vendor/lm15/compat.py701 ),COMMENT
LOWdspy/_vendor/lm15/compat.py941 extensions=partial.extensions,COMMENT
LOWdspy/_vendor/lm15/compat.py961# effort; `enabled` + budget_tokens is accepted but not translated) andCOMMENT
LOWdspy/_vendor/lm15/compat.py1081 # Moonshot AI over the Anthropic wire (platform.kimi.ai messages--COMMENT
LOWdspy/_vendor/lm15/access.py181# opens three chat wires and the account surfaces. `meta` names theCOMMENT
LOWdspy/_vendor/lm15/access.py341 env_keys=MOONSHOTAI_ENV_KEYS,COMMENT
LOWdspy/_vendor/lm15/access.py481# one host every resource kind answers on — a classic `OpenAI`-kindCOMMENT
LOWdspy/_vendor/lm15/access.py761 api_key_header: str = "x-api-key",COMMENT
LOWdspy/_vendor/lm15/features.py1"""COMMENT
LOWdspy/_vendor/lm15/features.py21# in-process configuration always wins, but between two kinds ofCOMMENT
LOWdspy/_vendor/lm15/types.py1881 top_k: int | None = NoneCOMMENT
LOWdspy/_vendor/lm15/types.py1901 # attribution (OpenAI safety_identifier, Anthropic metadata.user_id).COMMENT
LOWdspy/_vendor/lm15/providers/openai_chat.py181 """Canonical response_format (INV-050) -> chat-completions response_format."""COMMENT
LOWdspy/_vendor/lm15/providers/openai_chat.py201# refused with UnsupportedFeatureError, or — for the four call-mode /COMMENT
LOWdspy/_vendor/lm15/providers/openai_chat.py1441 adapt("config.response_format", "dropped",COMMENT
LOWdspy/_vendor/lm15/providers/openai.py281 if cache_cfg.retention == "long":COMMENT
LOWdspy/_vendor/lm15/providers/xai.py261 # code as provider_code instead of dropping it.COMMENT
LOWdspy/evaluate/evaluate.py401# TODO: the display_table can't handle False but can handle 0!COMMENT
LOWdspy/predict/retry.py1# import copyCOMMENT
LOWdspy/predict/retry.py21# prefix="Previous " + actual_prefix,COMMENT
LOWdspy/predict/retry.py41# # Convert the dict past_outputs={"answer": ...} to kwargsCOMMENT
LOWdspy/predict/retry.py61# pred = self.forward(**kwargs)COMMENT
LOWdspy/teleprompt/random_search.py161# sample between 4 and 10 examples from tracesCOMMENT
LOWdspy/teleprompt/grpo.py261COMMENT
LOWdspy/teleprompt/grpo.py521 logger.warning(f"GRPOGroup has no diversity. This could be due to low temperature, or low numberCOMMENT
LOWdspy/teleprompt/bootstrap_finetune.py221# program: Program,COMMENT
LOWtests/predict/test_retry.py1# import functoolsCOMMENT
LOWtests/predict/test_retry.py21# result = retry_module.forward(COMMENT
LOWtests/predict/test_retry.py41# print(f"SimpleModule got {result.answer=}")COMMENT
LOWtests/predict/test_retry.py61# # class AnswerQuestion(dspy.Signature):COMMENT
LOWtests/predict/test_retry.py81# # return resultCOMMENT
LOWtests/predict/test_predict.py241COMMENT
LOWtests/predict/test_predict.py261# content="¿Qué tal?",COMMENT
LOWtests/reliability/reliability_conf.yaml1adapter: chatCOMMENT
LOWtests/reliability/reliability_conf.yaml21 - model_name: "gpt-4-turbo"COMMENT
LOWtests/reliability/reliability_conf.yaml41 - model_name: "claude-3.5-haiku"COMMENT
LOWtests/reliability/reliability_conf.yaml61 - model_name: "llama-3.1-70b-instruct"COMMENT
LOWdocs/docs/stylesheets/home.css601 border-bottom-color: var(--hp-accent);COMMENT
Magic Placeholder Names6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHdocs/docs/tutorials/async/index.md60os.environ["OPENAI_API_KEY"] = "your_api_key"CODE
HIGHdocs/docs/tutorials/async/index.md85os.environ["OPENAI_API_KEY"] = "your_api_key"CODE
HIGHdocs/docs/tutorials/async/index.md142os.environ["OPENAI_API_KEY"] = "your_api_key"CODE
HIGHdocs/docs/tutorials/streaming/index.md23os.environ["OPENAI_API_KEY"] = "your_api_key"CODE
HIGHdocs/docs/tutorials/streaming/index.md471os.environ["OPENAI_API_KEY"] = "your_api_key"CODE
HIGHdocs/docs/tutorials/jev_decisions/index.md209os.environ["TYPESAFE_API_KEY"] = "your-api-key"CODE
AI Slop Vocabulary13 hits · 29 pts
SeverityFileLineSnippetContext
MEDIUMdspy/propose/dataset_summary_generator.py22 """I will also provide you with a few observations I have already made. Please add your own observations or if you STRING
MEDIUMdspy/_vendor/lm15/vet.py104 # PROTOCOL.md pins the harness account id: the ctor cannot derive oneCOMMENT
MEDIUMdspy/_vendor/lm15/vet.py646 # The harness gives the certificate and the key separately; theCOMMENT
MEDIUMdspy/_vendor/lm15/providers/base.py378 # harness injects a fixed clock; users never touch it.COMMENT
MEDIUMdspy/_vendor/lm15/providers/base.py1000 # harness direction drive the same code. There is NO local fan-outCOMMENT
MEDIUMdspy/_vendor/lm15/providers/base.py1266 # so the async twins and a future harness direction drive identicalCOMMENT
LOWdspy/adapters/utils.py104 # (e.g. the value is a JSON string), just use the string representation of the valueCOMMENT
LOWdspy/evaluate/evaluate.py38 # available, this method will simply return the input string.COMMENT
MEDIUMdspy/teleprompt/gepa/instruction_proposal.py751 # instead of just the current instruction, for more holistic instruction proposals.COMMENT
MEDIUMdspy/dsp/utils/settings.py155 # We check its existence and type to be more robust.COMMENT
LOWtests/predict/test_rlm.py631 # Unclosed fence (just return the body)COMMENT
MEDIUMtests/predict/test_rlm.py615 """Tests for robust fenced-code extraction."""STRING
MEDIUMtests/teleprompt/test_gepa_instruction_proposer.py158 # Use a robust dummy LM with enough responses for optimization stepsCOMMENT
AI Structural Patterns29 hits · 28 pts
SeverityFileLineSnippetContext
LOWdspy/propose/grounded_proposer.py250CODE
LOWdspy/clients/lm.py203CODE
LOWdspy/retrievers/databricks_rm.py84CODE
LOWdspy/_vendor/lm15/features.py279CODE
LOWdspy/_vendor/lm15/live.py358CODE
LOWdspy/_vendor/lm15/live.py531CODE
LOWdspy/_vendor/lm15/errors.py51CODE
LOWdspy/_vendor/lm15/doctor.py183CODE
LOWdspy/_vendor/lm15/providers/openai_codex.py37CODE
LOWdspy/_vendor/lm15/providers/base.py524CODE
LOWdspy/_vendor/lm15/transports/_async.py238CODE
LOWdspy/_vendor/lm15/transports/_sync.py223CODE
LOWdspy/utils/exceptions.py25CODE
LOWdspy/primitives/python_interpreter.py243CODE
LOWdspy/evaluate/evaluate.py71CODE
LOWdspy/evaluate/evaluate.py117CODE
LOWdspy/predict/parallel.py10CODE
LOWdspy/teleprompt/bootstrap_trace.py30CODE
LOWdspy/teleprompt/bettertogether.py194CODE
LOWdspy/teleprompt/random_search.py28CODE
LOWdspy/teleprompt/grpo.py27CODE
LOWdspy/teleprompt/utils.py324CODE
LOWdspy/teleprompt/simba.py29CODE
LOWdspy/teleprompt/mipro_optimizer_v2.py61CODE
LOWdspy/teleprompt/mipro_optimizer_v2.py109CODE
LOWdspy/teleprompt/gepa/gepa.py399CODE
LOWdspy/teleprompt/gepa/gepa_utils.py109CODE
LOWdspy/dsp/utils/utils.py45CODE
LOWtests/predict/test_parallel.py194CODE
Fake / Example Data21 hits · 22 pts
SeverityFileLineSnippetContext
LOWdspy/_vendor/lm15/doctor.py67 ``"env:<VAR>"``, ``"placeholder"``, or ``"oauth-file"``. ConformanceSTRING
LOWdspy/_vendor/lm15/doctor.py316 kind="placeholder",CODE
LOWdspy/adapters/baml_adapter.py219 # PatientDetails(name='John Doe', age=45, address=PatientAddress(street='123 Main St', city='Anytown', country='US')STRING
LOWdspy/adapters/baml_adapter.py219 # PatientDetails(name='John Doe', age=45, address=PatientAddress(street='123 Main St', city='Anytown', country='US')STRING
LOWtests/datasets/test_dataset.py9dummy_data = """content,question,answerCODE
LOWtests/datasets/test_dataset.py34 tmp_file.write(dummy_data)STRING
LOW⚡tests/adapters/test_baml_adapter.py283 name="John Doe", age=45, address=PatientAddress(street="123 Main St", city="Anytown", country="US")CODE
LOW⚡tests/adapters/test_baml_adapter.py283 name="John Doe", age=45, address=PatientAddress(street="123 Main St", city="Anytown", country="US")CODE
LOW⚡tests/adapters/test_baml_adapter.py290 assert '"name": "John Doe"' in user_messageCODE
LOW⚡tests/adapters/test_baml_adapter.py292 assert '"street": "123 Main St"' in user_messageCODE
LOW⚡tests/adapters/test_baml_adapter.py306 patient = PatientDetails(name="Jane Doe", age=30)CODE
LOW⚡tests/adapters/test_baml_adapter.py312 assert '"name": "Jane Doe"' in user_messageCODE
LOW⚡tests/adapters/test_baml_adapter.py550 choices=[Choices(message=Message(content='{"patient": {"name": "John Doe", "age": 28}}'))],CODE
LOW⚡tests/adapters/test_baml_adapter.py559 assert result[0]["patient"].name == "John Doe"CODE
LOWtests/adapters/test_baml_adapter.py648 user_profile = UserProfile(name="John Doe", email="john@example.com", age=30)CODE
LOWtests/adapters/test_baml_adapter.py660 assert '"name": "John Doe"' in user_messageCODE
LOW⚡tests/adapters/test_tool.py357 assert result["primary_address"]["street"] == "123 Main St"CODE
LOWtests/adapters/test_tool.py346 Address(street="123 Main St", city="Test City", zip_code="12345", is_primary=True),CODE
LOWdocs/docs/learn/programming/adapters.md194 "scientists_involved": ["John Doe", "Jane Smith"],CODE
LOWdocs/docs/learn/evaluation/data.md59Values can be accessed using the `.`(dot) operator. You can access the value of key `name` in defined object `Example(naCODE
LOWdocs/docs/deep-dive/data-handling/examples.md60Values can be accessed using the `.`(dot) operator. You can access the value of key `name` in defined object `Example(naCODE
Redundant / Tautological Comments16 hits · 22 pts
SeverityFileLineSnippetContext
LOWdspy/clients/provider.py35 # Check if job is doneSTRING
LOWdspy/clients/openai.py142 # Check if there is an active jobCOMMENT
LOWdspy/signatures/signature.py718 # Check if it's a built-in known type or in the provided namesCOMMENT
LOWdspy/signatures/signature.py724 # Check if it matches any known built-in type by nameCOMMENT
LOWdspy/adapters/utils.py171 # Check if the identifier is a valid enum member value *before* checking if it's a valid enumCOMMENT
LOWdspy/adapters/base.py446 # Check if all fields are present and not NoneCOMMENT
LOWdspy/adapters/base.py449 # Check if demo has at least one input and one output fieldCOMMENT
LOWdspy/adapters/types/citation.py196 # Check if the chunk has citation data in provider_specific_fieldsCOMMENT
LOWdspy/adapters/types/citation.py218 # Check if the response contains citations in the expected formatCOMMENT
LOWdspy/adapters/types/reasoning.py159 # Check if this is a valid string method/attributeCOMMENT
LOWdspy/adapters/types/tool.py105 # Check if the type (or its origin) is a subclass of Pydantic's BaseModelCOMMENT
LOWdspy/teleprompt/bettertogether.py580 # Check if this is the best score so farCOMMENT
LOWtests/docs/test_mkdocs_links.py9 # Read file and extract nav sectionCOMMENT
LOWtests/reliability/generate/utils.py278 # Check if the directory contains a program.py and an inputs directoryCOMMENT
LOWtests/reliability/generate/utils.py684 # Read the file contentsSTRING
LOWtests/teleprompt/test_copro_optimizer.py170 # Check if the results_best and results_latest contain valid statisticsCOMMENT
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHtests/adapters/test_json_adapter.py0answer the question with multiple answers and scoresSTRING
HIGHtests/adapters/test_chat_adapter.py0answer the question with multiple answers and scoresSTRING
HIGHtests/adapters/test_xml_adapter.py0answer the question with multiple answers and scoresSTRING
Overly Generic Function Names9 hits · 13 pts
SeverityFileLineSnippetContext
LOW⚡tests/clients/test_cache.py248 def test_function(prompt, model):CODE
LOW⚡tests/clients/test_cache.py305 async def test_function(prompt, model):CODE
LOW⚡tests/clients/test_cache.py332 def test_function(**kwargs):CODE
LOW⚡tests/utils/test_annotation.py6 def test_function():CODE
LOW⚡tests/utils/test_annotation.py17 def test_function():CODE
LOW⚡tests/utils/test_annotation.py55 def test_function():CODE
LOW⚡tests/utils/test_annotation.py64 def test_function():CODE
LOW⚡tests/utils/test_annotation.py72 def test_function():CODE
LOWtests/utils/test_annotation.py84 def test_function():CODE
Verbosity Indicators6 hits · 12 pts
SeverityFileLineSnippetContext
LOW⚡dspy/signatures/signature.py830 # Step 1: Convert camelCase to snake_caseCOMMENT
LOW⚡dspy/signatures/signature.py838 # Step 2: Handle numbers by adding underscores around themCOMMENT
LOWdspy/signatures/signature.py852 # Step 3: Convert to Title Case while preserving acronymsCOMMENT
LOW⚡dspy/teleprompt/mipro_optimizer_v2.py230 # Step 1: Bootstrap few-shot examplesCOMMENT
LOW⚡dspy/teleprompt/mipro_optimizer_v2.py261 # Step 3: Find optimal prompt parametersCOMMENT
LOWdspy/teleprompt/mipro_optimizer_v2.py243 # Step 2: Propose instruction candidatesCOMMENT
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALdocs/docs/diving-deeper/adapters.md150**`dspy.adapters.types.tool.ToolCalls.from_dict_list(...)`**CODE
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHdocs/docs/community/built-with-dspy.md22| **[MedVAL](https://arxiv.org/abs/2507.03152)** | Expert-level validation of AI-generated medical text with scalable laCODE
Dead Code2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMtests/clients/test_lm.py1575CODE
MEDIUMtests/streaming/test_streaming.py2130CODE
TODO Padding2 hits · 3 pts
SeverityFileLineSnippetContext
LOWdspy/adapters/json_adapter.py208 # TODO: implement format_finetune_data method in JSONAdapterCOMMENT
LOW.github/workflows/build_and_release.yml82 # TODO: Add tests using dspy-ai-testCOMMENT