mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-26 01:12:21 +00:00
Fix XML function calling args parsing.
This commit is contained in:
parent
93a1a865f0
commit
3adfb70fc9
1 changed files with 6 additions and 2 deletions
|
|
@ -727,10 +727,14 @@ def parse_xml_params(xml_content):
|
|||
root = ET.fromstring(xml_content)
|
||||
params = {}
|
||||
for child in root.findall(".//parameters/*"):
|
||||
params[child.tag] = child.text
|
||||
try:
|
||||
# Attempt to decode the element's text as JSON
|
||||
params[child.tag] = json.loads(child.text)
|
||||
except json.JSONDecodeError:
|
||||
# If JSON decoding fails, use the original text
|
||||
params[child.tag] = child.text
|
||||
return params
|
||||
|
||||
|
||||
###
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue