forked from docling-project/docling
-
Notifications
You must be signed in to change notification settings - Fork 2
Site/komipo 20251211 #166
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
seongmincho315
wants to merge
20
commits into
develop
Choose a base branch
from
site/komipo-20251211
base: develop
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.
Open
Site/komipo 20251211 #166
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4069830
fix: config
seongmincho315 316d532
fix: config
mestanam89 2601b2a
fix: script
mestanam89 fa4de8a
fix:readme
mestanam89 2913f75
fix: miniLM path
seongmincho315 d8f9106
fix: html 아닌 경우에만 ocr 수행
seongmincho315 4ba3747
add: 보안컨설팅 조치사항으로 인해 첨부파일 가드레일 추가
seongmincho315 41ba56a
fix: config
seongmincho315 7afc6f9
fix: config
mestanam89 2ebdbd9
fix: script
mestanam89 52ecf20
fix:readme
mestanam89 849a32f
fix: html 아닌 경우에만 ocr 수행
seongmincho315 055d059
add: 보안컨설팅 조치사항으로 인해 첨부파일 가드레일 추가
seongmincho315 3f6e7ac
Merge branch 'site/komipo-20251211' of https://github.com/genonai/doc…
jungkyusong-star 0f03ec6
chore: 리베이스 작업은 성민 프로
seongmincho315 7654399
fix: img tag
seongmincho315 1f7bb47
feat: 첨부용 전처리기에 가드레일 추가.
seongmincho315 acb33e0
feat: json 전처리기 하나로 통합.(PMS - 경상오더, TM, 발전 정지)
seongmincho315 d35e771
feat: OneAgent 연동용 전처리기 추가. (첨부용 전처리기 기반)
seongmincho315 b5877fe
feat: 모듈화
seongmincho315 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: genonai/doc_parser
Length of output: 1215
🏁 Script executed:
Repository: genonai/doc_parser
Length of output: 1444
🏁 Script executed:
Repository: genonai/doc_parser
Length of output: 963
🏁 Script executed:
Repository: genonai/doc_parser
Length of output: 361
Move the synchronous
requests.post()call out of the async event loop.The decorator makes a blocking network call for every chunk with no timeout or error handling. If the guardrail service is slow or fails, it will stall the entire async preprocessing pipeline.
Use
asyncio.to_thread()to run the POST in a thread pool, add a timeout, and safely handle the response:Suggested implementation
def guardrail(func): `@wraps`(func) async def wrapper(*args, **kwargs): result = await func(*args, **kwargs) + if not GENOS_URL or not GUARDRAIL_BEARER_TOKEN: + return result for r in result: url = f"{GENOS_URL}/api/gateway/workflow/{GUARDRAIL_WORKFLOW_ID}" headers = dict(Authorization=f"Bearer {GUARDRAIL_BEARER_TOKEN}") if hasattr(r, "text"): body = {"question": r.text} - res = requests.post(f"{url}/run/v2", json=body, headers=headers) - - answer = res.json()["data"]["text"] + res = await asyncio.to_thread( + requests.post, + f"{url}/run/v2", + json=body, + headers=headers, + timeout=5, + ) + res.raise_for_status() + payload = res.json() + answer = ((payload.get("data") or {}).get("text") or "")🧰 Tools
🪛 Ruff (0.15.10)
[error] 126-126: Probable use of
requestscall without timeout(S113)
🤖 Prompt for AI Agents