Skip to content

Commit d38f8a1

Browse files
JinHai-CNKevinHuSh
andauthored
Add license and Fix IDE warnings (#11985)
### What problem does this PR solve? - Add license - Fix IDE warnings ### Type of change - [x] Refactoring --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com> Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
1 parent 8e4d011 commit d38f8a1

File tree

10 files changed

+41
-27
lines changed

10 files changed

+41
-27
lines changed

agent/component/message.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ def thoughts(self) -> str:
204204

205205
def _parse_markdown_table_lines(self, table_lines: list):
206206
"""
207-
Parse a list of markdown table lines into a pandas DataFrame.
207+
Parse a list of Markdown table lines into a pandas DataFrame.
208208
209209
Args:
210-
table_lines: List of strings, each representing a row in the markdown table
210+
table_lines: List of strings, each representing a row in the Markdown table
211211
(excluding separator lines like |---|---|)
212212
213213
Returns:
@@ -278,7 +278,7 @@ def _convert_content(self, content):
278278
# Debug: log the content being parsed
279279
logging.info(f"XLSX Parser: Content length={len(content) if content else 0}, first 500 chars: {content[:500] if content else 'None'}")
280280

281-
# Try to parse ALL markdown tables from the content
281+
# Try to parse ALL Markdown tables from the content
282282
# Each table will be written to a separate sheet
283283
tables = [] # List of (sheet_name, dataframe)
284284

common/data_source/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11

22
"""
33
Thanks to https://github.com/onyx-dot-app/onyx
4+
5+
Content of this directory is under the "MIT Expat" license as defined below.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
424
"""
525

626
from .blob_connector import BlobStorageConnector

common/data_source/confluence_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def paginated_cql_user_retrieval(
717717
"""
718718
The search/user endpoint can be used to fetch users.
719719
It's a separate endpoint from the content/search endpoint used only for users.
720-
Otherwise it's very similar to the content/search endpoint.
720+
It's very similar to the content/search endpoint.
721721
"""
722722

723723
# this is needed since there is a live bug with Confluence Server/Data Center

common/data_source/discord_connector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ class DiscordConnector(LoadConnector, PollConnector):
233233

234234
def __init__(
235235
self,
236-
server_ids: list[str] = [],
237-
channel_names: list[str] = [],
236+
server_ids: list[str] | None = None,
237+
channel_names: list[str] | None = None,
238238
# YYYY-MM-DD
239239
start_date: str | None = None,
240240
batch_size: int = INDEX_BATCH_SIZE,

common/data_source/gmail_connector.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import os
32
from typing import Any
43
from google.oauth2.credentials import Credentials as OAuthCredentials
54
from google.oauth2.service_account import Credentials as ServiceAccountCredentials

common/data_source/google_drive/connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ def yield_all_docs_from_checkpoint_connector(
12101210
creds = get_credentials_from_env(email, oauth=True)
12111211
print("Credentials loaded successfully")
12121212
print(f"{creds=}")
1213-
sys.exit(0)
1213+
# sys.exit(0)
12141214
connector = GoogleDriveConnector(
12151215
include_shared_drives=False,
12161216
shared_drive_urls=None,

common/data_source/google_drive/file_retrieval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,6 @@ def get_all_files_for_oauth(
341341

342342
# Just in case we need to get the root folder id
343343
def get_root_folder_id(service: Resource) -> str:
344-
# we dont paginate here because there is only one root folder per user
344+
# we don't paginate here because there is only one root folder per user
345345
# https://developers.google.com/drive/api/guides/v2-to-v3-reference
346346
return service.files().get(fileId="root", fields=GoogleFields.ID.value).execute()[GoogleFields.ID.value]

deepdoc/parser/resume/step_two.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,11 @@ def forEdu(cv):
147147
edu_nst.append(e)
148148

149149
cv["sch_rank_kwd"] = []
150-
if cv["school_rank_int"] <= 20 \
151-
or ("海外名校" in fea and cv["school_rank_int"] <= 200):
150+
if cv["school_rank_int"] <= 20 or ("海外名校" in fea and cv["school_rank_int"] <= 200):
152151
cv["sch_rank_kwd"].append("顶尖学校")
153-
elif cv["school_rank_int"] <= 50 and cv["school_rank_int"] > 20 \
154-
or ("海外名校" in fea and cv["school_rank_int"] <= 500 and \
155-
cv["school_rank_int"] > 200):
152+
elif 50 >= cv["school_rank_int"] > 20 or ("海外名校" in fea and 500 >= cv["school_rank_int"] > 200):
156153
cv["sch_rank_kwd"].append("精英学校")
157-
elif cv["school_rank_int"] > 50 and ("985" in fea or "211" in fea) \
158-
or ("海外名校" in fea and cv["school_rank_int"] > 500):
154+
elif cv["school_rank_int"] > 50 and ("985" in fea or "211" in fea) or ("海外名校" in fea and cv["school_rank_int"] > 500):
159155
cv["sch_rank_kwd"].append("优质学校")
160156
else:
161157
cv["sch_rank_kwd"].append("一般学校")
@@ -208,8 +204,7 @@ def forEdu(cv):
208204
cv["tag_kwd"].append("好学校")
209205
cv["tag_kwd"].append("好学历")
210206
break
211-
if (len(cv.get("degree_kwd", [])) >= 1 and \
212-
"本科" in cv["degree_kwd"] and \
207+
if (len(cv.get("degree_kwd", [])) >= 1 and "本科" in cv["degree_kwd"] and
213208
any([d.lower() in ["硕士", "博士", "mba", "博士"] for d in cv.get("degree_kwd", [])])) \
214209
or all([d.lower() in ["硕士", "博士", "mba", "博士后"] for d in cv.get("degree_kwd", [])]) \
215210
or any([d in ["mba", "emba", "博士后"] for d in cv.get("degree_kwd", [])]):
@@ -406,7 +401,7 @@ def forWork(cv):
406401

407402
def turnTm2Dt(b):
408403
if not b:
409-
return
404+
return None
410405
b = str(b).strip()
411406
if re.match(r"[0-9]{10,}", b):
412407
b = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(int(b[:10])))
@@ -416,7 +411,7 @@ def turnTm2Dt(b):
416411
def getYMD(b):
417412
y, m, d = "", "", "01"
418413
if not b:
419-
return (y, m, d)
414+
return y, m, d
420415
b = turnTm2Dt(b)
421416
if re.match(r"[0-9]{4}", b):
422417
y = int(b[:4])
@@ -430,7 +425,7 @@ def getYMD(b):
430425
d = "1"
431426
if not m or int(m) > 12 or int(m) < 1:
432427
m = "1"
433-
return (y, m, d)
428+
return y, m, d
434429

435430

436431
def birth(cv):
@@ -480,22 +475,22 @@ def parse(cv):
480475
for k in rmkeys:
481476
del cv[k]
482477

483-
integerity = 0.
478+
integrity = 0.
484479
flds_num = 0.
485480

486481
def hasValues(flds):
487-
nonlocal integerity, flds_num
482+
nonlocal integrity, flds_num
488483
flds_num += len(flds)
489484
for f in flds:
490485
v = str(cv.get(f, ""))
491486
if len(v) > 0 and v != '0' and v != '[]':
492-
integerity += 1
487+
integrity += 1
493488

494489
hasValues(tks_fld)
495490
hasValues(small_tks_fld)
496491
hasValues(kwd_fld)
497492
hasValues(num_fld)
498-
cv["integerity_flt"] = integerity / flds_num
493+
cv["integerity_flt"] = integrity / flds_num
499494

500495
if cv.get("corporation_type"):
501496
for p, r in [(r"(公司|企业|其它|其他|Others*|\n|未填写|Enterprises|Company|companies)", ""),

docs/guides/agent/agent_component_reference/docs_generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In the **Message** component, reference the `download` output variable from the
4040

4141
### Content
4242

43-
The main text content to include in the document. Supports markdown formatting:
43+
The main text content to include in the document. Supports Markdown formatting:
4444

4545
- **Bold**: `**text**` or `__text__`
4646
- **Italic**: `*text*` or `_text_`

rag/prompts/analyze_task_system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Scale depth to match complexity. Always stop once success criteria are met.
4141

4242
**For HIGH (150–250 words for analysis only):**
4343
- Comprehensive objective analysis; Intent & Scope
44-
- 5–8 step Plan with dependencies/parallelism
44+
- 5–8 steps Plan with dependencies/parallelism
4545
- **Uncertainty & Probes** (key unknowns → probe → stop condition)
4646
- Measurable Success Criteria; Failure detectors & fallbacks
4747
- **Source Plan** (evidence acquisition & validation)

0 commit comments

Comments
 (0)