mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 10:54:19 +00:00
12 lines
268 B
Swift
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)
|
|
}
|
|
}
|