blob: 85d610a7d915ee7621738ef9d40b59843311ff25 [file]
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "RunLlamaCppInference.h"
#include "api/core/Resource.h"
#include "api/utils/minifi-c-utils.h"
#define MKSOC(x) #x
#define MAKESTRING(x) MKSOC(x) // NOLINT(cppcoreguidelines-macro-usage)
namespace minifi = org::apache::nifi::minifi;
CEXTENSIONAPI const uint32_t MinifiApiVersion = MINIFI_API_VERSION;
CEXTENSIONAPI void MinifiInitExtension(MinifiExtensionContext* extension_context) {
MinifiExtensionDefinition extension_definition{
.name = minifi::api::utils::toStringView(MAKESTRING(EXTENSION_NAME)),
.version = minifi::api::utils::toStringView(MAKESTRING(EXTENSION_VERSION)),
.deinit = nullptr,
.user_data = nullptr
};
auto* extension = MinifiRegisterExtension(extension_context, &extension_definition);
minifi::api::core::useProcessorClassDefinition<minifi::extensions::llamacpp::processors::RunLlamaCppInference>([&] (const MinifiProcessorClassDefinition& definition) {
MinifiRegisterProcessor(extension, &definition);
});
}