Skip to content

Commit

Permalink
Update _rm_titles function
Browse files Browse the repository at this point in the history
  • Loading branch information
rsk2327 committed Mar 13, 2024
1 parent 6adea20 commit b743d92
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/core/langchain_core/utils/function_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ class ToolDescription(TypedDict):
function: FunctionDescription


def _rm_titles(kv: dict) -> dict:
def _rm_titles(
kv: dict
) -> dict:

new_kv = {}
for k, v in kv.items():
if k == "title":
# print(kv.keys())
if k == "title" and 'type' in kv.keys():
continue
elif isinstance(v, dict):
new_kv[k] = _rm_titles(v)
Expand Down

0 comments on commit b743d92

Please sign in to comment.