mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-16 01:37:59 +00:00
langchain[patch]: oai tools output parser nit (#16540)
allow positional init args
This commit is contained in:
parent
f9976b9630
commit
c173a69908
@ -72,6 +72,10 @@ class JsonOutputKeyToolsParser(JsonOutputToolsParser):
|
||||
return_single: bool = False
|
||||
"""Whether to return only the first tool call."""
|
||||
|
||||
def __init__(self, key_name: str, **kwargs: Any) -> None:
|
||||
"""Allow init with positional args."""
|
||||
super().__init__(key_name=key_name, **kwargs)
|
||||
|
||||
def parse_result(self, result: List[Generation], *, partial: bool = False) -> Any:
|
||||
results = super().parse_result(result)
|
||||
results = [res for res in results if res["type"] == self.key_name]
|
||||
|
Loading…
Reference in New Issue
Block a user