Unverified Commit 9b15ddc3 authored by Yeuoly's avatar Yeuoly

fix: typo

parent 2f9cb8c4
...@@ -4,7 +4,7 @@ from os import path ...@@ -4,7 +4,7 @@ from os import path
from yaml import load, FullLoader from yaml import load, FullLoader
from core.tools.entities.tool_entities import ToolProviderType, \ from core.tools.entities.tool_entities import ToolProviderType, \
ToolParamter, ToolProviderCredentials, ToolDescription, ToolProviderIdentity ToolParameter, ToolProviderCredentials, ToolDescription, ToolProviderIdentity
from core.tools.provider.tool_provider import ToolProviderController from core.tools.provider.tool_provider import ToolProviderController
from core.tools.errors import ToolNotFoundError from core.tools.errors import ToolNotFoundError
from core.tools.tool.model_tool import ModelTool from core.tools.tool.model_tool import ModelTool
...@@ -16,7 +16,7 @@ from core.entities.model_entities import ModelStatus ...@@ -16,7 +16,7 @@ from core.entities.model_entities import ModelStatus
from core.provider_manager import ProviderManager, ProviderConfiguration, ProviderModelBundle from core.provider_manager import ProviderManager, ProviderConfiguration, ProviderModelBundle
from core.model_manager import ModelInstance from core.model_manager import ModelInstance
class ModelToolProviderConifguration(BaseModel): class ModelToolProviderConfiguration(BaseModel):
""" """
the configuration of the model tool provider the configuration of the model tool provider
""" """
...@@ -31,9 +31,9 @@ class ModelToolProviderConifguration(BaseModel): ...@@ -31,9 +31,9 @@ class ModelToolProviderConifguration(BaseModel):
providers: List[Provider] = None providers: List[Provider] = None
_model_tool_provider_config: ModelToolProviderConifguration = None _model_tool_provider_config: ModelToolProviderConfiguration = None
with open(path.join(path.dirname(__file__), '_model_providers.yaml'), 'r') as f: with open(path.join(path.dirname(__file__), '_model_providers.yaml'), 'r') as f:
_model_tool_provider_config = ModelToolProviderConifguration(**load(f, Loader=FullLoader)) _model_tool_provider_config = ModelToolProviderConfiguration(**load(f, Loader=FullLoader))
class ModelToolProviderController(ToolProviderController): class ModelToolProviderController(ToolProviderController):
configuration: ProviderConfiguration = None configuration: ProviderConfiguration = None
...@@ -151,12 +151,12 @@ class ModelToolProviderController(ToolProviderController): ...@@ -151,12 +151,12 @@ class ModelToolProviderController(ToolProviderController):
label=I18nObject(zh_Hans=model.label.zh_Hans, en_US=model.label.en_US), label=I18nObject(zh_Hans=model.label.zh_Hans, en_US=model.label.en_US),
), ),
parameters=[ parameters=[
ToolParamter( ToolParameter(
name='image_id', name='image_id',
label=I18nObject(zh_Hans='图片ID', en_US='Image ID'), label=I18nObject(zh_Hans='图片ID', en_US='Image ID'),
human_description=I18nObject(zh_Hans='图片ID', en_US='Image ID'), human_description=I18nObject(zh_Hans='图片ID', en_US='Image ID'),
type=ToolParamter.ToolParameterType.STRING, type=ToolParameter.ToolParameterType.STRING,
form=ToolParamter.ToolParameterForm.LLM, form=ToolParameter.ToolParameterForm.LLM,
required=True, required=True,
default=Tool.VARIABLE_KEY.IMAGE.value default=Tool.VARIABLE_KEY.IMAGE.value
) )
...@@ -206,7 +206,7 @@ class ModelToolProviderController(ToolProviderController): ...@@ -206,7 +206,7 @@ class ModelToolProviderController(ToolProviderController):
raise ValueError(f'tool {tool_name} not found') raise ValueError(f'tool {tool_name} not found')
def get_parameters(self, tool_name: str) -> List[ToolParamter]: def get_parameters(self, tool_name: str) -> List[ToolParameter]:
""" """
returns the parameters of the tool returns the parameters of the tool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment