gunpal5 / Google_GenerativeAI

Unofficial C# Google Generative AI SDK (Google Gemini) with function calls support
MIT License
34 stars 4 forks source link

程式修正 #2

Closed ghost closed 6 months ago

ghost commented 7 months ago

原程式碼 public static Content FormatGenerateContentInput(string @params) { var parts = new[]{new Part(){Text = @params}}; return new Content(parts, Roles.User); } Role永遠都只有user

應該修正多加string role參數(其它引用地方也需修正) public static Content FormatGenerateContentInput(string @params,string role) { var parts = new[] { new Part() { Text = @params } }; return new Content(parts, role); } 否則會出現錯誤!

gunpal5 commented 6 months ago

Added in src/GenerativeAI/Extensions/RequestExtensions.cs