mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-03-31 09:52:44 -04:00
refactor: Replace plugin tools manager to client api tools manager
This commit is contained in:
@ -36,12 +36,12 @@ CreateNewFileTool::CreateNewFileTool(QObject *parent)
|
||||
: BaseTool(parent)
|
||||
{}
|
||||
|
||||
QString CreateNewFileTool::name() const
|
||||
QString CreateNewFileTool::id() const
|
||||
{
|
||||
return "create_new_file";
|
||||
}
|
||||
|
||||
QString CreateNewFileTool::stringName() const
|
||||
QString CreateNewFileTool::displayName() const
|
||||
{
|
||||
return {"Creating new file"};
|
||||
}
|
||||
@ -54,7 +54,7 @@ QString CreateNewFileTool::description() const
|
||||
"to the project file";
|
||||
}
|
||||
|
||||
QJsonObject CreateNewFileTool::getDefinition(PluginLLMCore::ToolSchemaFormat format) const
|
||||
QJsonObject CreateNewFileTool::parametersSchema() const
|
||||
{
|
||||
QJsonObject properties;
|
||||
|
||||
@ -70,25 +70,9 @@ QJsonObject CreateNewFileTool::getDefinition(PluginLLMCore::ToolSchemaFormat for
|
||||
required.append("filepath");
|
||||
definition["required"] = required;
|
||||
|
||||
switch (format) {
|
||||
case PluginLLMCore::ToolSchemaFormat::OpenAI:
|
||||
return customizeForOpenAI(definition);
|
||||
case PluginLLMCore::ToolSchemaFormat::Claude:
|
||||
return customizeForClaude(definition);
|
||||
case PluginLLMCore::ToolSchemaFormat::Ollama:
|
||||
return customizeForOllama(definition);
|
||||
case PluginLLMCore::ToolSchemaFormat::Google:
|
||||
return customizeForGoogle(definition);
|
||||
}
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
PluginLLMCore::ToolPermissions CreateNewFileTool::requiredPermissions() const
|
||||
{
|
||||
return PluginLLMCore::ToolPermission::FileSystemWrite;
|
||||
}
|
||||
|
||||
QFuture<QString> CreateNewFileTool::executeAsync(const QJsonObject &input)
|
||||
{
|
||||
return QtConcurrent::run([this, input]() -> QString {
|
||||
|
||||
Reference in New Issue
Block a user