llama-stack/llama_stack/providers/inline/ios/inference/LocalInferenceImpl/PromptTemplate.swift
2024-11-06 14:54:05 -08:00

12 lines
268 B
Swift

import Foundation
import Stencil
public struct PromptTemplate {
let template: String
let data: [String: Any]
public func render() throws -> String {
let template = Template(templateString: self.template)
return try template.render(self.data)
}
}