mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-23 11:30:37 +00:00
lint
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Literal
|
||||
from typing import Literal, Optional
|
||||
|
||||
from langchain_core.agents import AgentAction
|
||||
|
||||
@@ -21,7 +21,7 @@ def _escape(xml: str) -> str:
|
||||
def format_xml(
|
||||
intermediate_steps: list[tuple[AgentAction, str]],
|
||||
*,
|
||||
escape_format: Literal["minimal"] | None = "minimal",
|
||||
escape_format: Optional[Literal["minimal"]] = "minimal",
|
||||
) -> str:
|
||||
"""Format the intermediate steps as XML.
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import re
|
||||
from typing import Literal, Union
|
||||
from typing import Literal, Union, Optional
|
||||
|
||||
from langchain_core.agents import AgentAction, AgentFinish
|
||||
from pydantic import Field
|
||||
@@ -56,7 +56,7 @@ class XMLAgentOutputParser(AgentOutputParser):
|
||||
contains malformed XML structure.
|
||||
"""
|
||||
|
||||
escape_format: Literal["minimal"] | None = Field(default="minimal")
|
||||
escape_format: Optional[Literal["minimal"]] = Field(default="minimal")
|
||||
"""The format to use for escaping XML characters.
|
||||
|
||||
minimal - uses custom delimiters to replace XML tags within content,
|
||||
|
Reference in New Issue
Block a user