A Python library for extracting structured information from unstructured text using LLMs with precise source grounding and interactive visualization.
This report summarizes scanner evidence for google/langextract, a Python project with 38,934 GitHub stars. SynthScan examined 47,957 lines of code across 133 source files, recording 1042 pattern matches distributed across 19 syntactic categories. The legacy adjusted pattern signal is 26.4 (Elevated 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? 877 finding(s).
Are imports declared and package/API names verified? 74 finding(s).
Are wrappers, guards, and repeated structures necessary? 765 finding(s).
Which changes need focused human review? 1042 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 1042 distinct pattern matches across 19 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 | tests/chunking_test.py | 69 | def test_multi_sentence_chunk(self): | CODE |
| LOW | tests/chunking_test.py | 96 | def test_sentence_with_multiple_newlines_and_right_interval(self): | CODE |
| LOW | tests/chunking_test.py | 164 | def test_long_token_gets_own_chunk(self): | CODE |
| LOW | tests/chunking_test.py | 207 | def test_newline_at_chunk_boundary_does_not_create_empty_interval(self): | CODE |
| LOW | tests/chunking_test.py | 261 | def test_newlines_is_secondary_sentence_break(self): | CODE |
| LOW | tests/chunking_test.py | 312 | def test_tokenizer_propagation(self): | CODE |
| LOW | tests/chunking_test.py | 425 | def test_make_batches_of_textchunk( | CODE |
| LOW | tests/chunking_test.py | 473 | def test_text_chunk_additional_context(self): | CODE |
| LOW | tests/chunking_test.py | 486 | def test_chunk_iterator_without_additional_context(self): | CODE |
| LOW | tests/chunking_test.py | 497 | def test_multiple_chunks_with_additional_context(self): | CODE |
| LOW | tests/chunking_test.py | 549 | def test_text_chunk_properties( | CODE |
| LOW⚡ | tests/progress_test.py | 27 | def test_download_progress_bar(self): | CODE |
| LOW⚡ | tests/progress_test.py | 37 | def test_extraction_progress_bar(self): | CODE |
| LOW⚡ | tests/progress_test.py | 47 | def test_save_load_progress_bars(self): | CODE |
| LOW⚡ | tests/progress_test.py | 57 | def test_model_info_extraction(self): | CODE |
| LOW | tests/progress_test.py | 68 | def test_formatting_functions(self): | CODE |
| LOW | tests/format_handler_test.py | 147 | def test_end_to_end_integration_with_prompt_and_resolver(self): | CODE |
| LOW | tests/format_handler_test.py | 232 | def test_format_parse_roundtrip( | STRING |
| LOW | tests/format_handler_test.py | 260 | def test_think_tags_stripped_before_parsing(self): | CODE |
| LOW | tests/format_handler_test.py | 276 | def test_top_level_list_accepted_as_fallback(self): | CODE |
| LOW | tests/format_handler_test.py | 340 | def test_format_type_normalization_in_init_and_resolver_params( | CODE |
| LOW | tests/format_handler_test.py | 365 | def test_invalid_format_type_raises(self): | CODE |
| LOW | tests/annotation_test.py | 50 | def assert_char_interval_match_source( | CODE |
| LOW | tests/annotation_test.py | 83 | def test_annotate_text_single_chunk(self): | CODE |
| LOW | tests/annotation_test.py | 209 | def test_annotate_text_without_index_suffix(self): | CODE |
| LOW | tests/annotation_test.py | 328 | def test_annotate_text_with_attributes_suffix(self): | CODE |
| LOW | tests/annotation_test.py | 472 | def test_annotate_text_multiple_chunks(self): | CODE |
| LOW | tests/annotation_test.py | 572 | def test_annotate_text_no_extractions(self): | CODE |
| LOW | tests/annotation_test.py | 640 | def test_releases_prompts_before_next_batch_with_list_outputs(self): | CODE |
| LOW | tests/annotation_test.py | 691 | def test_releases_prompts_before_next_batch_with_iterator_outputs(self): | CODE |
| LOW | tests/annotation_test.py | 869 | def test_annotate_documents_exceptions( | CODE |
| LOW | tests/annotation_test.py | 920 | def test_multipass_extraction_non_overlapping(self): | CODE |
| LOW | tests/annotation_test.py | 970 | def test_multipass_extraction_overlapping(self): | CODE |
| LOW | tests/annotation_test.py | 1021 | def test_multipass_extraction_single_pass(self): | CODE |
| LOW | tests/annotation_test.py | 1051 | def test_multipass_extraction_empty_passes(self): | CODE |
| LOW | tests/annotation_test.py | 1155 | def test_merge_non_overlapping_extractions( | CODE |
| LOW | tests/annotation_test.py | 1263 | def test_yields_documents_not_generators(self): | CODE |
| LOW | tests/annotation_test.py | 1323 | def test_context_window_includes_previous_chunk_text(self): | CODE |
| LOW | tests/annotation_test.py | 1374 | def test_no_context_included_when_disabled(self): | CODE |
| LOW | tests/annotation_test.py | 1412 | def test_context_window_per_document_isolation(self): | CODE |
| LOW⚡ | tests/schema_test.py | 48 | def _openai_attribute_properties(openai_schema, extraction_class): | CODE |
| LOW⚡ | tests/schema_test.py | 57 | def test_abstract_methods_required(self): | CODE |
| LOW⚡ | tests/schema_test.py | 62 | def test_subclass_must_implement_all_methods(self): | CODE |
| LOW⚡ | tests/schema_test.py | 972 | def test_base_schema_rejects_user_schemas_by_default(self): | CODE |
| LOW⚡ | tests/schema_test.py | 976 | def test_gemini_from_schema_dict_targets_json_schema_field(self): | CODE |
| LOW⚡ | tests/schema_test.py | 986 | def test_gemini_from_schema_dict_validates_envelope(self): | CODE |
| LOW⚡ | tests/schema_test.py | 996 | def test_openai_from_schema_dict_builds_response_format(self): | CODE |
| LOW | tests/schema_test.py | 79 | def test_get_schema_class_returns_none_by_default(self): | CODE |
| LOW | tests/schema_test.py | 89 | def test_apply_schema_stores_instance(self): | CODE |
| LOW | tests/schema_test.py | 258 | def test_from_examples_constructs_expected_schema( | CODE |
| LOW | tests/schema_test.py | 265 | def test_to_provider_config_returns_response_schema(self): | CODE |
| LOW | tests/schema_test.py | 287 | def test_requires_raw_output_returns_true(self): | CODE |
| LOW | tests/schema_test.py | 308 | def test_response_format_returns_json_schema_response_format(self): | CODE |
| LOW | tests/schema_test.py | 341 | def test_to_provider_config_uses_provider_schema_hook(self): | CODE |
| LOW | tests/schema_test.py | 349 | def test_from_examples_constructs_strict_openai_schema(self): | CODE |
| LOW | tests/schema_test.py | 447 | def test_from_examples_preserves_list_attribute_schema(self): | CODE |
| LOW | tests/schema_test.py | 474 | def test_from_examples_empty_examples_allow_empty_extraction_objects(self): | CODE |
| LOW | tests/schema_test.py | 488 | def test_validate_format_rejects_yaml(self): | CODE |
| LOW | tests/schema_test.py | 499 | def test_requires_raw_output_returns_true(self): | CODE |
| LOW | tests/schema_test.py | 505 | def test_validate_format_warns_when_fences_enabled(self): | CODE |
| 604 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | langextract/plugins.py | 125 | Load a provider class from module:Class specification. Args: spec: Import specification in format "module.path:Cl | STRING |
| HIGH | langextract/plugins.py | 186 | Get a provider class by name. Args: name: Provider name (e.g., "gemini", "openai", "ollama"). allow_override: | STRING |
| HIGH | langextract/annotation.py | 124 | Iterates over documents to yield text chunks along with the document ID. Args: documents: A sequence of Document | STRING |
| HIGH | langextract/annotation.py | 222 | Annotates a sequence of documents with NLP extractions. Breaks documents into chunks, processes them into prompts | STRING |
| HIGH | langextract/chunking.py | 146 | Creates a token interval. Args: start_index: first token's index (inclusive). end_index: last token's index + | STRING |
| HIGH | langextract/chunking.py | 173 | Get the text within an interval of tokens. Args: tokenized_text: Tokenized documents. token_interval: An inte | STRING |
| HIGH | langextract/chunking.py | 220 | Returns the char interval corresponding to the token interval. Args: tokenized_text: Document. token_interval | STRING |
| HIGH | langextract/chunking.py | 247 | Converts all whitespace characters in input text to a single space. Args: text: Input to sanitize. Returns: | STRING |
| HIGH | langextract/io.py | 51 | Loads the dataset from a CSV file. Args: delimiter: The delimiter to use when reading the CSV file. Yiel | STRING |
| HIGH | langextract/io.py | 148 | Loads annotated documents from a JSON Lines file. Args: jsonl_path: The file path to the JSON Lines file. sho | STRING |
| HIGH | langextract/io.py | 198 | Reads a CSV file and yields rows as dicts. Args: filepath: The path to the file. column_names: The names of t | STRING |
| HIGH | langextract/io.py | 271 | Download text content from a URL with optional progress bar. Args: url: The URL to download from. timeout: Re | STRING |
| HIGH | langextract/prompt_validation.py | 136 | Align extractions to their own example text and collect issues. Args: examples: The few-shot examples to validate | STRING |
| HIGH | langextract/prompting.py | 56 | Reads a structured prompt template from a file. Args: prompt_path: Path to a file containing PromptTemplateStruct | STRING |
| HIGH | langextract/factory.py | 120 | Create a language model instance from configuration. Args: config: Model configuration with optional model_id and | STRING |
| HIGH | langextract/factory.py | 242 | Internal helper to create a model with optional schema constraints. This function creates a language model and option | STRING |
| HIGH | langextract/extraction.py | 76 | Extracts structured information from text. Retrieves structured information from the provided text or documents using | STRING |
| HIGH | langextract/resolver.py | 282 | Runs resolve function on text with YAML/JSON extraction data. Args: input_text: The input text to be proces | STRING |
| HIGH | langextract/resolver.py | 416 | Parses a YAML or JSON-formatted string into extraction data. This method is kept for backward compatibility with te | STRING |
| HIGH | langextract/resolver.py | 451 | Extracts and orders extraction data based on their associated indexes. This function processes a list of dictionari | STRING |
| HIGH | langextract/core/output_schema.py | 111 | Validates the LangExtract output envelope and returns an isolated copy. LangExtract's resolver parses a top-level JSO | STRING |
| HIGH | langextract/core/output_schema.py | 255 | Builds a schema for one LangExtract extraction object. Pair this with `extractions_schema()` to produce the full outp | STRING |
| HIGH | langextract/core/base_model.py | 206 | Parses model output as JSON or YAML. Note: This expects raw JSON/YAML without code fences. Code fence extractio | STRING |
| HIGH | langextract/core/tokenizer.py | 474 | Reconstructs the substring of the original text spanning a given token interval. Args: tokenized_text: A Tokenize | STRING |
| HIGH | langextract/core/tokenizer.py | 586 | Finds a 'sentence' interval from a given start index. Sentence boundaries are defined by: - punctuation tokens in | STRING |
| HIGH | langextract/core/format_handler.py | 172 | Parse model output to extract data. Args: text: Raw model output. strict: If True, enforce strict schem | STRING |
| HIGH | langextract/core/format_handler.py | 297 | Extract content from text, handling fences if configured. Args: text: Input text that may contain fenced bloc | STRING |
| HIGH | langextract/providers/openai_batch.py | 357 | Execute batch inference on multiple prompts using OpenAI Batch API. Args: client: OpenAI client instance (or comp | STRING |
| HIGH | langextract/providers/router.py | 140 | Resolve a model ID to a provider class. Args: model_id: The model identifier to resolve. Returns: The prov | STRING |
| HIGH | langextract/providers/router.py | 171 | Resolve a provider name to a provider class. This allows explicit provider selection by name or class name. Args: | STRING |
| HIGH | langextract/providers/gemini_batch.py | 282 | Encode tools in a form that Vertex AI batch can import. Vertex AI batch rejects input files that contain empty JSON o | STRING |
| HIGH | langextract/providers/gemini_batch.py | 325 | Build a batch request in REST format for file-based submission. Constructs a properly formatted request dictionary fo | STRING |
| HIGH | langextract/providers/gemini_batch.py | 401 | Submit a file-based batch job to Vertex AI using GCS storage. Batch processing is only supported with Vertex AI becau | STRING |
| HIGH | langextract/providers/gemini_batch.py | 671 | Poll batch job until completion or timeout. Args: client: google.genai.Client instance for polling job status. | STRING |
| HIGH | langextract/providers/gemini_batch.py | 770 | Extract text outputs from file-based batch results, preserving order. Reads results from GCS output directory. Arg | STRING |
| HIGH | langextract/providers/gemini_batch.py | 851 | Execute batch inference on multiple prompts using the Vertex AI Batch API. This function provides file-based batch pr | STRING |
| HIGH | langextract/providers/ollama.py | 561 | Sends a prompt to an Ollama model and returns the generated response. Note: This is a low-level method. Constructor | STRING |
| HIGH | scripts/create_provider_plugin.py | 270 | Replaces a placeholder line, failing loudly if it is missing. Args: content: Text containing exactly one placehol | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | autoformat.sh | 1 | #!/bin/bash | COMMENT |
| LOW | .pre-commit-config.yaml | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | pyproject.toml | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tox.ini | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/chunking_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/progress_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/format_handler_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/annotation_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/schema_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/prompting_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/inference_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/provider_schema_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/create_provider_plugin_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/extract_precedence_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/resolver_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/resolver_test.py | 661 | extraction_text="prednisone", | COMMENT |
| LOW | tests/fuzzy_alignment_cases_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/test_kwargs_passthrough.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/gemini_retry_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/data_lib_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/init_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/openai_batch_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/registry_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/tokenizer_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/extract_schema_integration_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/prompt_validation_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/factory_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/visualization_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/io_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/provider_plugin_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/factory_schema_test.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/test_live_api.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/test_ollama_integration.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | tests/test_gemini_batch_api.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/plugins.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/annotation.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/chunking.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/registry.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/data_lib.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/io.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/prompt_validation.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/prompting.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/__init__.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/visualization.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/factory.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/tokenizer.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/extraction.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/resolver.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/inference.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/exceptions.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/progress.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/data.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/schema.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/output_schema.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/__init__.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/types.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/base_model.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/tokenizer.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/format_handler.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| LOW | langextract/core/exceptions.py | 1 | # Copyright 2025 Google LLC. | COMMENT |
| 49 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/prompt_validation_test.py | 457 | except Exception: # pylint: disable=broad-except | CODE |
| HIGH | tests/prompt_validation_test.py | 505 | except Exception: # pylint: disable=broad-except | CODE |
| HIGH | tests/prompt_validation_test.py | 526 | except Exception: # pylint: disable=broad-except | CODE |
| HIGH | langextract/annotation.py | 389 | except AttributeError: | CODE |
| HIGH | langextract/core/debug_utils.py | 184 | except Exception: | CODE |
| HIGH | langextract/providers/gemini.py | 396 | except ImportError: | CODE |
| HIGH | langextract/providers/gemini.py | 414 | except ImportError: | CODE |
| HIGH | langextract/providers/router.py | 208 | except re.error: | CODE |
| HIGH | langextract/providers/gemini_batch.py | 194 | except Exception: | CODE |
| HIGH | langextract/providers/gemini_batch.py | 471 | except OSError: | CODE |
| HIGH | benchmarks/fuzzy_benchmark.py | 253 | except (subprocess.CalledProcessError, FileNotFoundError): | CODE |
| HIGH | .github/scripts/zenodo_publish.py | 71 | except FileNotFoundError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/openai_batch_test.py | 19 | CODE | |
| LOW | langextract/plugins.py | 20 | CODE | |
| LOW | langextract/registry.py | 21 | CODE | |
| LOW | langextract/data_lib.py | 16 | CODE | |
| LOW | langextract/io.py | 16 | CODE | |
| LOW | langextract/prompt_validation.py | 17 | CODE | |
| LOW | langextract/prompting.py | 16 | CODE | |
| LOW | langextract/__init__.py | 21 | CODE | |
| LOW | langextract/visualization.py | 24 | CODE | |
| LOW | langextract/factory.py | 22 | CODE | |
| LOW | langextract/tokenizer.py | 21 | CODE | |
| LOW | langextract/tokenizer.py | 25 | CODE | |
| LOW | langextract/extraction.py | 17 | CODE | |
| LOW | langextract/resolver.py | 21 | CODE | |
| LOW | langextract/inference.py | 21 | CODE | |
| LOW | langextract/exceptions.py | 22 | CODE | |
| LOW | langextract/progress.py | 16 | CODE | |
| LOW | langextract/data.py | 21 | CODE | |
| LOW | langextract/data.py | 25 | CODE | |
| LOW | langextract/schema.py | 22 | CODE | |
| LOW | langextract/core/output_schema.py | 16 | CODE | |
| LOW | langextract/core/__init__.py | 22 | CODE | |
| LOW | langextract/core/types.py | 16 | CODE | |
| LOW | langextract/core/base_model.py | 16 | CODE | |
| LOW | langextract/core/format_handler.py | 17 | CODE | |
| LOW | langextract/core/exceptions.py | 21 | CODE | |
| LOW | langextract/core/data.py | 16 | CODE | |
| LOW | langextract/core/schema.py | 16 | CODE | |
| LOW | langextract/core/debug_utils.py | 16 | CODE | |
| LOW | langextract/providers/openai_batch.py | 22 | CODE | |
| LOW | langextract/providers/gemini.py | 19 | CODE | |
| LOW | langextract/providers/openai.py | 18 | CODE | |
| LOW | langextract/providers/router.py | 22 | CODE | |
| LOW | langextract/providers/gemini_batch.py | 25 | CODE | |
| LOW | langextract/providers/ollama.py | 84 | CODE | |
| LOW | langextract/providers/schemas/__init__.py | 16 | CODE | |
| LOW | langextract/providers/schemas/gemini.py | 18 | CODE | |
| LOW | langextract/providers/schemas/openai.py | 18 | CODE | |
| LOW | langextract/_compat/registry.py | 18 | CODE | |
| LOW | langextract/_compat/__init__.py | 21 | CODE | |
| LOW | langextract/_compat/inference.py | 17 | CODE | |
| LOW | langextract/_compat/exceptions.py | 18 | CODE | |
| LOW | langextract/_compat/schema.py | 18 | CODE | |
| LOW | …amples/custom_provider_plugin/test_example_provider.py | 24 | CODE | |
| LOW | …ovider_plugin/langextract_provider_example/provider.py | 17 | CODE | |
| LOW | …ovider_plugin/langextract_provider_example/__init__.py | 17 | CODE | |
| LOW | …provider_plugin/langextract_provider_example/schema.py | 17 | CODE | |
| LOW | benchmarks/fuzzy_benchmark.py | 29 | CODE | |
| LOW | scripts/validate_community_providers.py | 18 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/prompt_validation_test.py | 457 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | tests/prompt_validation_test.py | 505 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | tests/prompt_validation_test.py | 526 | except Exception: # pylint: disable=broad-except | CODE |
| LOW | langextract/prompting.py | 78 | except Exception as e: | CODE |
| LOW | langextract/visualization.py | 59 | except Exception: | CODE |
| LOW | langextract/resolver.py | 443 | except Exception as e: | CODE |
| LOW | langextract/core/base_model.py | 228 | except Exception as e: | CODE |
| LOW | langextract/core/debug_utils.py | 89 | except Exception: | CODE |
| LOW | langextract/core/debug_utils.py | 129 | except Exception: | CODE |
| LOW | langextract/core/debug_utils.py | 184 | except Exception: | CODE |
| LOW | langextract/providers/openai_batch.py | 253 | except Exception as e: | CODE |
| LOW | langextract/providers/openai_batch.py | 277 | except Exception as e: | CODE |
| LOW | langextract/providers/openai_batch.py | 313 | except Exception as e: | CODE |
| LOW | langextract/providers/openai_batch.py | 444 | except Exception as e: | CODE |
| LOW | langextract/providers/openai_batch.py | 470 | except Exception as e: | CODE |
| LOW | langextract/providers/openai_batch.py | 496 | except Exception as e: | CODE |
| LOW | langextract/providers/openai_batch.py | 508 | except Exception as e: | CODE |
| LOW | langextract/providers/__init__.py | 131 | except Exception as e: | CODE |
| LOW | langextract/providers/__init__.py | 136 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini.py | 455 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini.py | 559 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini.py | 598 | except Exception as e: | CODE |
| LOW | langextract/providers/openai.py | 260 | except Exception as e: | CODE |
| LOW | langextract/providers/openai.py | 382 | except Exception as e: | CODE |
| LOW | langextract/providers/openai.py | 422 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini_batch.py | 194 | except Exception: | CODE |
| LOW | langextract/providers/gemini_batch.py | 275 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini_batch.py | 502 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini_batch.py | 543 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini_batch.py | 554 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini_batch.py | 705 | except Exception as e: | CODE |
| LOW | langextract/providers/gemini_batch.py | 991 | except Exception as e: | CODE |
| LOW | langextract/providers/ollama.py | 313 | except Exception as e: | CODE |
| LOW | …ovider_plugin/langextract_provider_example/provider.py | 181 | except Exception as e: | CODE |
| LOW | examples/ollama/demo_ollama.py | 452 | except Exception as e: | CODE |
| LOW | examples/ollama/demo_ollama.py | 533 | except Exception as e: | CODE |
| MEDIUM | benchmarks/plotting.py | 339 | print(f"Error loading {json_file}: {e}") | CODE |
| LOW | scripts/create_provider_plugin.py | 828 | except Exception as e: | CODE |
| LOW | scripts/create_provider_plugin.py | 858 | except Exception: | CODE |
| LOW | scripts/create_provider_plugin.py | 864 | except Exception as e: | CODE |
| LOW | scripts/create_provider_plugin.py | 908 | except Exception as e: | STRING |
| LOW | scripts/create_provider_plugin.py | 927 | except Exception as e: | STRING |
| LOW | scripts/create_provider_plugin.py | 1138 | except Exception: | STRING |
| LOW | scripts/create_provider_plugin.py | 1168 | except Exception: | STRING |
| LOW | .github/scripts/zenodo_publish.py | 230 | except Exception as e: | CODE |
| MEDIUM | .github/scripts/zenodo_publish.py | 199 | def main() -> int: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | README.md | 227 | docker run --rm -e LANGEXTRACT_API_KEY="your-api-key" langextract python your_script.py | CODE |
| HIGH | README.md | 250 | export LANGEXTRACT_API_KEY="your-api-key-here" | CODE |
| HIGH | README.md | 260 | LANGEXTRACT_API_KEY=your-api-key-here | CODE |
| HIGH | README.md | 289 | api_key="your-api-key-here" # Only use this for testing/development | CODE |
| HIGH | docs/examples/medication_examples.md | 51 | api_key="your-api-key-here" # Optional if LANGEXTRACT_API_KEY environment variable is set | CODE |
| HIGH | docs/examples/medication_examples.md | 171 | api_key="your-api-key-here" # Optional if LANGEXTRACT_API_KEY environment variable is set | STRING |
| HIGH | docs/examples/japanese_extraction.md | 43 | api_key="your-api-key-here" # Optional if env var is set | CODE |
| HIGH | examples/custom_provider_plugin/README.md | 125 | provider_kwargs={"api_key": "your-api-key"}, | CODE |
| HIGH | examples/custom_provider_plugin/README.md | 142 | provider_kwargs={"api_key": "your-api-key"}, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/create_provider_plugin_test.py | 253 | CODE | |
| LOW | tests/extract_schema_integration_test.py | 150 | CODE | |
| LOW | tests/extract_schema_integration_test.py | 184 | CODE | |
| LOW | langextract/annotation.py | 46 | CODE | |
| LOW | langextract/annotation.py | 285 | CODE | |
| LOW | langextract/data_lib.py | 27 | CODE | |
| LOW | langextract/io.py | 85 | CODE | |
| LOW | langextract/io.py | 265 | CODE | |
| LOW | langextract/prompt_validation.py | 130 | CODE | |
| LOW | langextract/prompting.py | 52 | CODE | |
| LOW | langextract/factory.py | 58 | CODE | |
| LOW | langextract/extraction.py | 45 | CODE | |
| LOW | langextract/resolver.py | 1297 | CODE | |
| LOW | langextract/resolver.py | 447 | CODE | |
| LOW | langextract/resolver.py | 601 | CODE | |
| LOW | langextract/core/tokenizer.py | 580 | CODE | |
| LOW | langextract/core/tokenizer.py | 336 | CODE | |
| LOW | langextract/core/format_handler.py | 169 | CODE | |
| LOW | langextract/providers/openai_batch.py | 411 | CODE | |
| LOW | langextract/providers/__init__.py | 71 | CODE | |
| LOW | langextract/providers/__init__.py | 149 | CODE | |
| LOW | langextract/providers/gemini.py | 424 | CODE | |
| LOW | langextract/providers/gemini.py | 490 | CODE | |
| LOW | langextract/providers/openai.py | 329 | CODE | |
| LOW | langextract/providers/router.py | 170 | CODE | |
| LOW | langextract/providers/gemini_batch.py | 317 | CODE | |
| LOW | langextract/providers/gemini_batch.py | 764 | CODE | |
| LOW | langextract/providers/gemini_batch.py | 528 | CODE | |
| LOW | langextract/providers/schemas/gemini.py | 121 | CODE | |
| LOW | langextract/providers/schemas/openai.py | 85 | CODE | |
| LOW | examples/ollama/demo_ollama.py | 418 | CODE | |
| LOW | benchmarks/benchmark.py | 140 | CODE | |
| LOW | benchmarks/benchmark.py | 276 | CODE | |
| LOW | benchmarks/benchmark.py | 311 | CODE | |
| LOW | benchmarks/fuzzy_benchmark.py | 342 | CODE | |
| LOW | benchmarks/plotting.py | 170 | CODE | |
| LOW | benchmarks/plotting.py | 220 | CODE | |
| LOW | benchmarks/plotting.py | 376 | CODE | |
| LOW | benchmarks/plotting.py | 492 | CODE | |
| LOW | .github/scripts/zenodo_publish.py | 57 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_live_api.py | 0 | the patient was prescribed lisinopril and metformin last month. he takes the lisinopril 10mg daily for hypertension, but | STRING |
| HIGH | docs/examples/medication_examples.md | 0 | the patient was prescribed lisinopril and metformin last month. he takes the lisinopril 10mg daily for hypertension, but | STRING |
| HIGH | examples/ollama/demo_ollama.py | 0 | the patient was prescribed lisinopril and metformin last month. he takes the lisinopril 10mg daily for hypertension, but | STRING |
| HIGH | tests/test_live_api.py | 0 | extract medications with their details, using attributes to group related information: 1. extract entities in the order | STRING |
| HIGH | docs/examples/medication_examples.md | 0 | extract medications with their details, using attributes to group related information: 1. extract entities in the order | STRING |
| HIGH | examples/ollama/demo_ollama.py | 0 | extract medications with their details, using attributes to group related information: 1. extract entities in the order | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/annotation_test.py | 804 | # Define a side effect function so return length based on batch length. | COMMENT |
| MEDIUM | tests/resolver_test.py | 2026 | # Define a chunk that includes the entire text. | COMMENT |
| MEDIUM | tests/resolver_test.py | 2068 | # Define a chunk that includes the entire text. | COMMENT |
| MEDIUM | tests/resolver_test.py | 2114 | # Define a chunk that includes too many tokens. | COMMENT |
| MEDIUM | tests/resolver_test.py | 2155 | # Define a correct chunk. | COMMENT |
| MEDIUM | tests/resolver_test.py | 2182 | # Define a chunk that includes the entire text. | COMMENT |
| MEDIUM | tests/extract_schema_integration_test.py | 225 | # Create a mock instance with required attributes | COMMENT |
| MEDIUM | tests/extract_schema_integration_test.py | 276 | # Create a mock Gemini schema with validate_format that issues warnings | COMMENT |
| MEDIUM | langextract/providers/ollama.py | 24 | # Create an example for few-shot learning | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/openai_batch_test.py | 49 | def set_content(self, file_id: str, text: str) -> None: | CODE |
| LOW | langextract/plugins.py | 30 | __all__ = ["available_providers", "get_provider_class"] | CODE |
| LOW | langextract/prompt_validation.py | 30 | __all__ = [ | CODE |
| LOW | langextract/prompting.py | 268 | def _update_state(self, document_id: str, chunk_text: str) -> None: | CODE |
| LOW | langextract/__init__.py | 30 | __all__ = [ | CODE |
| LOW | langextract/exceptions.py | 35 | __all__ = [ | CODE |
| LOW | langextract/schema.py | 47 | __all__ = [ | CODE |
| LOW | langextract/core/output_schema.py | 26 | __all__ = [ | CODE |
| LOW | langextract/core/__init__.py | 24 | __all__ = [ | CODE |
| LOW | langextract/core/types.py | 24 | __all__ = [ | CODE |
| LOW | langextract/core/base_model.py | 29 | __all__ = ['BaseLanguageModel'] | CODE |
| LOW | langextract/core/base_model.py | 125 | def set_fence_output(self, fence_output: bool | None) -> None: | CODE |
| LOW | langextract/core/tokenizer.py | 35 | __all__ = [ | CODE |
| LOW | langextract/core/exceptions.py | 23 | __all__ = [ | CODE |
| LOW | langextract/core/data.py | 30 | __all__ = [ | CODE |
| LOW | langextract/core/schema.py | 26 | __all__ = [ | CODE |
| LOW | langextract/providers/__init__.py | 33 | __all__ = [ | CODE |
| LOW | langextract/providers/gemini_batch.py | 528 | def set_multi(self, items: Sequence[tuple[dict, str]]) -> None: | CODE |
| LOW | langextract/providers/schemas/__init__.py | 24 | __all__ = ["GeminiSchema", "OpenAISchema"] | CODE |
| LOW | langextract/_compat/__init__.py | 23 | __all__ = ["inference", "schema", "exceptions", "registry"] | CODE |
| LOW | …ovider_plugin/langextract_provider_example/__init__.py | 19 | __all__ = ["CustomGeminiProvider"] | CODE |
| LOW | .github/scripts/zenodo_publish.py | 157 | def update_metadata(draft_id: str) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/annotation_test.py | 506 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/resolver_test.py | 667 | # -------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/resolver_test.py | 670 | # -------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/resolver_test.py | 673 | # -------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/resolver_test.py | 676 | # -------------------------------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/annotation_test.py | 94 | - patient: "Jane Doe" | CODE |
| LOW | tests/annotation_test.py | 121 | extraction_text="Jane Doe", | CODE |
| LOW | tests/annotation_test.py | 220 | - patient: "Jane Doe" | CODE |
| LOW | tests/annotation_test.py | 240 | extraction_text="Jane Doe", | CODE |
| LOW | tests/annotation_test.py | 339 | - patient: "Jane Doe" | CODE |
| LOW | tests/annotation_test.py | 374 | extraction_text="Jane Doe", | CODE |
| LOW | tests/schema_test.py | 219 | extraction_text="John Doe", | CODE |
| LOW | tests/resolver_test.py | 413 | "patient": "Jane Doe", | CODE |
| LOW | tests/resolver_test.py | 430 | extraction_text="Jane Doe", | CODE |
| LOW | tests/resolver_test.py | 454 | "patient": "John Doe", | CODE |
| LOW | tests/resolver_test.py | 493 | extraction_text="John Doe", | CODE |
| LOW | tests/data_lib_test.py | 195 | extraction_text="placeholder", | CODE |
| LOW | tests/tokenizer_test.py | 812 | expected_substring="Jane Doe", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | langextract/annotation.py | 209 | CODE | |
| LOW | langextract/annotation.py | 534 | CODE | |
| LOW | langextract/extraction.py | 45 | CODE | |
| LOW | langextract/resolver.py | 337 | CODE | |
| LOW | langextract/resolver.py | 799 | CODE | |
| LOW | langextract/providers/gemini.py | 237 | CODE | |
| LOW | langextract/providers/openai.py | 109 | CODE | |
| LOW | langextract/providers/ollama.py | 379 | CODE | |
| LOW | langextract/providers/ollama.py | 476 | CODE | |
| LOW | langextract/providers/ollama.py | 540 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | langextract/_compat/README.md | 16 | - `from langextract.inference import InferenceOutputError` → `from langextract.core.exceptions import InferenceOutputErr | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_kwargs_passthrough.py | 704 | """Format key should be omitted from payload when None (not sent as null).""" | STRING |
| HIGH | langextract/visualization.py | 492 | let animationInterval = null; | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | langextract/providers/ollama.py | 24 | # Create an example for few-shot learning | STRING |
| MEDIUM | docs/examples/japanese_extraction.md | 20 | # Define example data (few-shot examples help the model understand the task) | COMMENT |
| MEDIUM | skills/langextract-usage/SKILL.md | 114 | examples=examples, # few-shot examples (required) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | langextract/core/tokenizer.py | 278 | # Fallback to the robust regex method | COMMENT |
| MEDIUM | benchmarks/plotting.py | 37 | """Generate comprehensive benchmark visualization. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | langextract/core/base_model.py | 220 | # Check if we have a format_type attribute (providers should set this) | COMMENT |
| LOW | langextract/providers/gemini_batch.py | 258 | # Check if rule already exists | COMMENT |