@@ -26,27 +26,27 @@ public final class TemplateGenerativeModel: Sendable {
2626 self . apiConfig = apiConfig
2727 }
2828
29- /// Generates content from a prompt template and variables .
29+ /// Generates content from a prompt template and inputs .
3030 ///
3131 /// - Parameters:
3232 /// - template: The prompt template to use.
3333 /// - variables: A dictionary of variables to substitute into the template.
3434 /// - Returns: The content generated by the model.
3535 /// - Throws: A ``GenerateContentError`` if the request failed.
3636 public func generateContent( template: String ,
37- variables : [ String : Any ] ,
37+ inputs : [ String : Any ] ,
3838 options: RequestOptions = RequestOptions ( ) ) async throws
3939 -> GenerateContentResponse {
40- let templateVariables = try variables . mapValues { try TemplateVariable ( value: $0) }
40+ let templateInputs = try inputs . mapValues { try TemplateInput ( value: $0) }
4141 return try await generateContentWithHistory (
4242 history: [ ] ,
4343 template: template,
44- variables : templateVariables ,
44+ inputs : templateInputs ,
4545 options: options
4646 )
4747 }
4848
49- /// Generates content from a prompt template, variables , and history.
49+ /// Generates content from a prompt template, inputs , and history.
5050 ///
5151 /// - Parameters:
5252 /// - history: The conversation history to use.
@@ -55,12 +55,12 @@ public final class TemplateGenerativeModel: Sendable {
5555 /// - Returns: The content generated by the model.
5656 /// - Throws: A ``GenerateContentError`` if the request failed.
5757 func generateContentWithHistory( history: [ ModelContent ] , template: String ,
58- variables : [ String : TemplateVariable ] ,
58+ inputs : [ String : TemplateInput ] ,
5959 options: RequestOptions = RequestOptions ( ) ) async throws
6060 -> GenerateContentResponse {
6161 let request = TemplateGenerateContentRequest (
6262 template: template,
63- variables : variables ,
63+ inputs : inputs ,
6464 history: history,
6565 projectID: generativeAIService. firebaseInfo. projectID,
6666 stream: false ,
@@ -73,13 +73,13 @@ public final class TemplateGenerativeModel: Sendable {
7373 }
7474
7575 public func generateContentStream( template: String ,
76- variables : [ String : Any ] ,
76+ inputs : [ String : Any ] ,
7777 options: RequestOptions = RequestOptions ( ) ) throws
7878 -> AsyncThrowingStream < GenerateContentResponse , Error > {
79- let templateVariables = try variables . mapValues { try TemplateVariable ( value: $0) }
79+ let templateInputs = try inputs . mapValues { try TemplateInput ( value: $0) }
8080 let request = TemplateGenerateContentRequest (
8181 template: template,
82- variables : templateVariables ,
82+ inputs : templateInputs ,
8383 history: [ ] ,
8484 projectID: generativeAIService. firebaseInfo. projectID,
8585 stream: true ,
@@ -90,12 +90,12 @@ public final class TemplateGenerativeModel: Sendable {
9090 }
9191
9292 func generateContentStreamWithHistory( history: [ ModelContent ] , template: String ,
93- variables : [ String : TemplateVariable ] ,
93+ inputs : [ String : TemplateInput ] ,
9494 options: RequestOptions = RequestOptions ( ) ) throws
9595 -> AsyncThrowingStream < GenerateContentResponse , Error > {
9696 let request = TemplateGenerateContentRequest (
9797 template: template,
98- variables : variables ,
98+ inputs : inputs ,
9999 history: history,
100100 projectID: generativeAIService. firebaseInfo. projectID,
101101 stream: true ,
0 commit comments