mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-10-23 12:24:38 -04:00
feat: Add tooling support to google provider (#237)
This commit is contained in:
@ -54,4 +54,20 @@ QJsonObject BaseTool::customizeForOllama(const QJsonObject &baseDefinition) cons
|
||||
return customizeForOpenAI(baseDefinition);
|
||||
}
|
||||
|
||||
QJsonObject BaseTool::customizeForGoogle(const QJsonObject &baseDefinition) const
|
||||
{
|
||||
QJsonObject functionDeclaration;
|
||||
functionDeclaration["name"] = name();
|
||||
functionDeclaration["description"] = description();
|
||||
functionDeclaration["parameters"] = baseDefinition;
|
||||
|
||||
QJsonArray functionDeclarations;
|
||||
functionDeclarations.append(functionDeclaration);
|
||||
|
||||
QJsonObject tool;
|
||||
tool["function_declarations"] = functionDeclarations;
|
||||
|
||||
return tool;
|
||||
}
|
||||
|
||||
} // namespace QodeAssist::LLMCore
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace QodeAssist::LLMCore {
|
||||
|
||||
enum class ToolSchemaFormat { OpenAI, Claude, Ollama };
|
||||
enum class ToolSchemaFormat { OpenAI, Claude, Ollama, Google };
|
||||
|
||||
class BaseTool : public QObject
|
||||
{
|
||||
@ -47,6 +47,7 @@ protected:
|
||||
virtual QJsonObject customizeForOpenAI(const QJsonObject &baseDefinition) const;
|
||||
virtual QJsonObject customizeForClaude(const QJsonObject &baseDefinition) const;
|
||||
virtual QJsonObject customizeForOllama(const QJsonObject &baseDefinition) const;
|
||||
virtual QJsonObject customizeForGoogle(const QJsonObject &baseDefinition) const;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::LLMCore
|
||||
|
Reference in New Issue
Block a user