Override the tool parameter list, we can dynamically generate the parameter list based on the actual situation in the current variable pool, so that the LLM can generate the form based on the parameter list
"""
defis_tool_avaliable(self)->bool:
defis_tool_available(self)->bool:
"""
Whether the current tool is available, if there is no image in the current variable pool, then we don't need to display this tool, just return False here
"""
...
...
@@ -194,7 +194,7 @@ Next, let's implement these three functions
# Here, we override the tool parameter list, define the image_id, and set its option list to all images in the current variable pool. The configuration here is consistent with the configuration in yaml.
return[
ToolParamter.get_simple_instance(
ToolParameter.get_simple_instance(
name='image_id',
llm_description=f'the image id that you want to vectorize, \
and the image id should be specified in \
{[i.name for i in self.list_default_image_variables()]}',
@@ -163,7 +163,7 @@ class GoogleSearchTool(BuiltinTool):
```
### Parameters
The overall logic of the tool is in the `_invoke` method, this method accepts two parameters: `user_id` and `tool_paramters`, which represent the user ID and tool parameters respectively
The overall logic of the tool is in the `_invoke` method, this method accepts two parameters: `user_id` and `tool_parameters`, which represent the user ID and tool parameters respectively
### Return Data
When the tool returns, you can choose to return one message or multiple messages, here we return one message, using `create_text_message` and `create_link_message` can create a text message or a link message.
...
...
@@ -195,7 +195,7 @@ class GoogleProvider(BuiltinToolProviderController):
en_US:DALL-E 3 is a powerful drawing tool that can draw the image you want based on your prompt, compared to DallE 2, DallE 3 has stronger drawing ability, but it will consume more resources
zh_Hans:DALL-E 3 是一个强大的绘画工具,它可以根据您的提示词绘制出您想要的图像,相比于DallE 2, DallE 3拥有更强的绘画能力,但会消耗更多的资源
pt_BR:DALL-E 3 is a powerful drawing tool that can draw the image you want based on your prompt, compared to DallE 2, DallE 3 has stronger drawing ability, but it will consume more resources
pt_BR:DALL-E 3 é uma poderosa ferramenta de desenho que pode desenhar a imagem que você deseja com base em seu prompt, em comparação com DallE 2, DallE 3 tem uma capacidade de desenho mais forte, mas consumirá mais recursos
description:
human:
en_US:DALL-E is a text to image tool
zh_Hans:DALL-E 是一个文本到图像的工具
pt_BR:DALL-E is a text to image tool
pt_BR:DALL-E é uma ferramenta de texto para imagem
llm:DALL-E is a tool used to generate images from text
parameters:
-name:prompt
...
...
@@ -26,7 +26,7 @@ parameters:
human_description:
en_US:Image prompt, you can check the official documentation of DallE 3
zh_Hans:图像提示词,您可以查看DallE 3 的官方文档
pt_BR:Image prompt, you can check the official documentation of DallE 3
pt_BR:Imagem prompt, você pode verificar a documentação oficial do DallE 3
llm_description:Image prompt of DallE 3, you should describe the image you want to generate as a list of words as possible as detailed
en_US:You want to find the project development language, keywords, For example. Find 10 Python developed PDF document parsing projects.
zh_Hans:你想要找的项目开发语言、关键字,如:找10个Python开发的PDF文档解析项目。
pt_BR:Você deseja encontrar a linguagem de desenvolvimento do projeto, palavras-chave, Por exemplo. Encontre 10 projetos de análise de documentos PDF desenvolvidos em Python.
llm_description:The query of you want to search, format query condition like "keywords+language:js", language can be other dev languages, por exemplo. Procuro um projeto de análise de documentos PDF desenvolvido em Python.
llm_description:The query of you want to search, format query condition like "keywords+language:js", language can be other dev languages.
en_US='Image prompt, you can check the official documentation of Stable Diffusion',
zh_Hans='图像提示词,您可以查看 Stable Diffusion 的官方文档',
),
type=ToolParamter.ToolParameterType.STRING,
form=ToolParamter.ToolParameterForm.LLM,
type=ToolParameter.ToolParameterType.STRING,
form=ToolParameter.ToolParameterForm.LLM,
llm_description='Image prompt of Stable Diffusion, you should describe the image you want to generate as a list of words as possible as detailed, the prompt must be written in English.',
en_US='Image id of the image you want to generate based on, if you want to generate image based on the default image, you can leave this field empty.',