fix: added future langchain functionality
This commit is contained in:
parent
8297100b22
commit
d4ed1eb629
1 changed files with 8 additions and 1 deletions
|
|
@ -26,7 +26,14 @@ def load_file(file_name, file_content, accepted_types) -> Any:
|
|||
return json.loads(decoded_string)
|
||||
elif suffix in ["yaml", "yml"]:
|
||||
# Return the yaml content
|
||||
return yaml.safe_load(decoded_string)
|
||||
loaded_yaml = yaml.load(decoded_string, Loader=yaml.FullLoader)
|
||||
try:
|
||||
from langchain.agents.agent_toolkits.openapi.spec import reduce_openapi_spec
|
||||
|
||||
return reduce_openapi_spec(loaded_yaml)
|
||||
except ImportError:
|
||||
return loaded_yaml
|
||||
|
||||
elif suffix == "csv":
|
||||
# Load the csv content
|
||||
csv_reader = csv.DictReader(io.StringIO(decoded_string))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue