generated from langchain-ai/integration-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Improve Information Extraction Tools and extract common utilities #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eora21
wants to merge
13
commits into
main
Choose a base branch
from
refactor/information-extraction-tools
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3d2fb4a to
f539042
Compare
- Add constants.py for shared constants (KILOBYTE, MEGABYTE) - Add file_utils.py for reusable file-to-base64 conversion - Extract common file validation and encoding logic
- Use common utilities (constants, file_utils) - Improve docstrings to Google Style - Add generate_schema() method for schema generation - Enhance error handling - Remove hwp/hwpx from supported extensions per API docs
- Move common fixtures to conftest.py - Update to use tool.invoke() instead of tool.extract() - Update mock targets to ChatUpstage - Remove duplicate fixtures
- Export UpstagePrebuiltInformationExtraction - Export UpstageUniversalInformationExtraction
- Import from utils.value_retriever instead of duplicating - Maintain backward compatibility
- Replace ChatUpstage with httpx for multipart/form-data requests - Use common utilities (constants) - Improve docstrings to Google Style - Enhance error handling - Align with Prebuilt API requirements (multipart/form-data only)
- Functionality moved to file_utils.py - No longer referenced in codebase
- Fix line length violations (E501) by breaking long lines - Fix mypy type errors for HumanMessage content and json.loads - Remove hardcoded API key from universal_information_extraction.py - Add type casts and type checks for proper type safety - Add mypy cache directories to .gitignore
f539042 to
03486bb
Compare
- Fix PrebuiltInformationExtraction: Update mock strategy from ChatUpstage to httpx.Client to match actual implementation - Fix UniversalInformationExtraction: Replace ChatUpstage patch with direct api_wrapper assignment to avoid model_validator issues - Fix API key handling in PrebuiltInformationExtraction.__init__ to properly handle explicit api_key parameter - Ensure upstage_api_key is explicitly set after super().__init__ to prevent BaseTool from not preserving it All tests now pass (289 passed, 1 skipped)
- Format long function signatures to single line - Remove unused 'patch' import from test_universal_information_extraction - Apply ruff auto-fixes
inahjeon
approved these changes
Jan 9, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
constants.py,file_utils.py) for reusable file operations and shared constantsUpstageUniversalInformationExtractiontool: improve docstrings (Google Style), addgenerate_schema()method for schema generation, use common utilities, enhance error handling, and align supported file extensions with API documentationUpstagePrebuiltInformationExtractiontool: replaceChatUpstagewith directhttpxHTTP calls formultipart/form-datarequests to align with Prebuilt API requirements, use common utilities, improve docstrings, and enhance error handlingget_from_param_or_envfunction fromdocument_parse.pyanddocument_parse_parsers.py, now importing fromutils.value_retriever__init__.pyfor public APIconftest.py, update to usetool.invoke()instead of deprecatedtool.extract(), and update mock targetsinformation_extraction_check.pymodule (functionality moved tofile_utils.py)tools/directory and utilities toutils/directoryDependencies: N/A
Twitter handle: N/A