Module: Gemini::FunctionCallingHelper
- Defined in:
- lib/gemini/function_calling_helper.rb
Class Method Summary collapse
-
.build_continuation(original_contents:, model_response:, function_responses:) ⇒ Array
Function Callレスポンスから継続用のcontentsを構築 Gemini 3では関数呼び出しの継続時にThought Signatureが必須.
Class Method Details
.build_continuation(original_contents:, model_response:, function_responses:) ⇒ Array
Function Callレスポンスから継続用のcontentsを構築Gemini 3では関数呼び出しの継続時にThought Signatureが必須
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/gemini/function_calling_helper.rb', line 22 def self.build_continuation(original_contents:, model_response:, function_responses:) # 元の会話履歴 contents = original_contents.dup # モデルの応答(Signature付き) contents << { role: "model", parts: model_response.build_function_call_parts_with_signature } # 関数の結果 function_response_parts = function_responses.map do |fr| { functionResponse: fr } end contents << { role: "user", parts: function_response_parts } contents end |