mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
feat: LM Studio response API and Ollama OpenAI API
This commit is contained in:
@@ -27,7 +27,7 @@ OpenAIResponsesProvider::OpenAIResponsesProvider(QObject *parent)
|
||||
|
||||
QString OpenAIResponsesProvider::name() const
|
||||
{
|
||||
return "OpenAI Responses";
|
||||
return "OpenAI (Responses API)";
|
||||
}
|
||||
|
||||
QString OpenAIResponsesProvider::apiKey() const
|
||||
@@ -98,24 +98,11 @@ void OpenAIResponsesProvider::prepareRequest(
|
||||
}
|
||||
|
||||
if (isToolsEnabled) {
|
||||
const auto toolsDefinitions
|
||||
= m_client->tools()->getToolsDefinitions();
|
||||
const auto toolsDefinitions = m_client->tools()->getToolsDefinitions();
|
||||
if (!toolsDefinitions.isEmpty()) {
|
||||
QJsonArray responsesTools;
|
||||
|
||||
for (const QJsonValue &toolValue : toolsDefinitions) {
|
||||
const QJsonObject tool = toolValue.toObject();
|
||||
if (tool.contains("function")) {
|
||||
const QJsonObject functionObj = tool["function"].toObject();
|
||||
QJsonObject responsesTool;
|
||||
responsesTool["type"] = "function";
|
||||
responsesTool["name"] = functionObj["name"];
|
||||
responsesTool["description"] = functionObj["description"];
|
||||
responsesTool["parameters"] = functionObj["parameters"];
|
||||
responsesTools.append(responsesTool);
|
||||
}
|
||||
}
|
||||
request["tools"] = responsesTools;
|
||||
request["tools"] = toolsDefinitions;
|
||||
LOG_MESSAGE(QString("Added %1 tools to OpenAI Responses request")
|
||||
.arg(toolsDefinitions.size()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user