Skip to content

Commit

Permalink
style:fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-ckt committed Oct 16, 2024
1 parent 8fde567 commit 1262c34
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions dbgpt/rag/knowledge/docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,31 @@


def load_from_xml_v2(base_uri, rels_item_xml):
"""Return |_SerializedRelationships| instance loaded with the relationships.
contained in *rels_item_xml*.collection if *rels_item_xml* is |None|.
"""
Return |_SerializedRelationships| instance loaded with the
relationships contained in *rels_item_xml*. Returns an empty
collection if *rels_item_xml* is |None|.
"""
serial_rels = _SerializedRelationships()
srels = _SerializedRelationships()
if rels_item_xml is not None:
rels_elm = parse_xml(rels_item_xml)
for rel_elm in rels_elm.Relationship_lst:
if rel_elm.target_ref in ('../NULL', 'NULL'):
if rel_elm.target_ref in ("../NULL", "NULL"):
continue
serial_rels.srels.append(_SerializedRelationship(base_uri, rel_elm))
return serial_rels
srels._srels.append(_SerializedRelationship(base_uri, rel_elm))
return srels


class DocxKnowledge(Knowledge):
"""Docx Knowledge."""

def __init__(
self,
file_path: Optional[str] = None,
knowledge_type: Any = KnowledgeType.DOCUMENT,
encoding: Optional[str] = "utf-8",
loader: Optional[Any] = None,
metadata: Optional[Dict[str, Union[str, List[str]]]] = None,
**kwargs: Any,
self,
file_path: Optional[str] = None,
knowledge_type: Any = KnowledgeType.DOCUMENT,
encoding: Optional[str] = "utf-8",
loader: Optional[Any] = None,
metadata: Optional[Dict[str, Union[str, List[str]]]] = None,
**kwargs: Any,
) -> None:
"""Create Docx Knowledge with Knowledge arguments.
Expand Down

0 comments on commit 1262c34

Please sign in to comment.