Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit 9dc9c21

Browse files
use safe_load for yaml
1 parent e080db7 commit 9dc9c21

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

llama_hub/tools/chatgpt_plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This tool has more extensive example usage documented in a Jupyter notebook [her
1111
import requests
1212
import yaml
1313
f = requests.get('https://raw.githubusercontent.com/sisbell/chatgpt-plugin-store/main/manifests/today-currency-converter.oiconma.repl.co.json').text
14-
manifest = yaml.load(f, Loader=yaml.Loader)
14+
manifest = yaml.safe_load(f)
1515

1616
from llama_hub.tools.chatgpt_plugin import ChatGPTPluginToolSpec
1717
from llama_index.agent import OpenAIAgent

llama_hub/tools/chatgpt_plugin/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(
3131
pass
3232
elif manifest_url:
3333
response = requests.get(manifest_url).text
34-
manifest = yaml.load(response, Loader=yaml.Loader)
34+
manifest = yaml.safe_load(response)
3535
else:
3636
raise ValueError("You must provide either a manifest or a manifest_url")
3737

llama_hub/tools/notebooks/chatgpt_plugin.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"f = requests.get(\n",
2828
" \"https://raw.githubusercontent.com/sisbell/chatgpt-plugin-store/main/manifests/today-currency-converter.oiconma.repl.co.json\"\n",
2929
").text\n",
30-
"manifest = yaml.load(f, Loader=yaml.Loader)"
30+
"manifest = yaml.safe_load(f)"
3131
]
3232
},
3333
{

llama_hub/tools/notebooks/openapi_and_requests.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"f = requests.get(\n",
2929
" \"https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml\"\n",
3030
").text\n",
31-
"open_api_spec = yaml.load(f, Loader=yaml.Loader)"
31+
"open_api_spec = yaml.safe_load(f)"
3232
]
3333
},
3434
{
@@ -240,4 +240,4 @@
240240
},
241241
"nbformat": 4,
242242
"nbformat_minor": 5
243-
}
243+
}

llama_hub/tools/openapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from llama_hub.tools.openapi import OpenAPIToolSpec
1414
from llama_index.agent import OpenAIAgent
1515

1616
f = requests.get('https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml').text
17-
open_api_spec = yaml.load(f, Loader=yaml.Loader)
17+
open_api_spec = yaml.safe_load(f)
1818
# OR
1919
open_spec = OpenAPIToolSpec(url='https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml')
2020

llama_hub/tools/openapi/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, spec: Optional[dict] = None, url: Optional[str] = None):
2626
pass
2727
elif url:
2828
response = requests.get(url).text
29-
spec = yaml.load(response, Loader=yaml.Loader)
29+
spec = yaml.safe_load(response)
3030
else:
3131
raise ValueError("You must provide a url or OpenAPI spec as a dict")
3232

0 commit comments

Comments
 (0)