dev #3
@@ -9,7 +9,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def load_configs():
|
def load_configs():
|
||||||
with open("config/loaders.yaml") as f:
|
with open("config/loaders.yaml",encoding='UTF-8') as f:
|
||||||
configs = yaml.safe_load(f)
|
configs = yaml.safe_load(f)
|
||||||
return configs
|
return configs
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import os
|
|
||||||
import yaml
|
|
||||||
import json
|
|
||||||
import importlib
|
import importlib
|
||||||
from cachetools import cached, LRUCache
|
import os
|
||||||
from llama_index.core.tools.tool_spec.base import BaseToolSpec
|
|
||||||
|
import yaml
|
||||||
from llama_index.core.tools.function_tool import FunctionTool
|
from llama_index.core.tools.function_tool import FunctionTool
|
||||||
|
from llama_index.core.tools.tool_spec.base import BaseToolSpec
|
||||||
|
|
||||||
|
|
||||||
class ToolType:
|
class ToolType:
|
||||||
@@ -46,7 +45,7 @@ class ToolFactory:
|
|||||||
def from_env() -> list[FunctionTool]:
|
def from_env() -> list[FunctionTool]:
|
||||||
tools = []
|
tools = []
|
||||||
if os.path.exists("config/tools.yaml"):
|
if os.path.exists("config/tools.yaml"):
|
||||||
with open("config/tools.yaml", "r") as f:
|
with open("config/tools.yaml", "r", encoding='UTF-8') as f:
|
||||||
tool_configs = yaml.safe_load(f)
|
tool_configs = yaml.safe_load(f)
|
||||||
if tool_configs != None and len(tool_configs.items()) != 0:
|
if tool_configs != None and len(tool_configs.items()) != 0:
|
||||||
for tool_type, config_entries in tool_configs.items():
|
for tool_type, config_entries in tool_configs.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user