File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -356,15 +356,16 @@ private static V1.GenerativeProvider GetGenerativeProvider(Models.GenerativeProv
356356 result . Contextualai = new V1 . GenerativeContextualAI
357357 {
358358 Model = a . Model ?? string . Empty ,
359- Temperature = a . Temperature ?? 0 ,
360- TopP = a . TopP ?? 0 ,
361- MaxNewTokens = a . MaxNewTokens ?? 0 ,
362359 SystemPrompt = a . SystemPrompt ?? string . Empty ,
363- AvoidCommentary = a . AvoidCommentary ?? false ,
364- Knowledge = a . Knowledge != null
365- ? new V1 . TextArray { Values = { a . Knowledge } }
366- : new V1 . TextArray ( ) ,
360+ Knowledge =
361+ a . Knowledge != null
362+ ? new V1 . TextArray { Values = { a . Knowledge } }
363+ : null ,
367364 } ;
365+ SetIfNotNull ( v => result . Contextualai . Temperature = ( float ) v , a . Temperature ) ;
366+ SetIfNotNull ( v => result . Contextualai . TopP = ( float ) v , a . TopP ) ;
367+ SetIfNotNull ( v => result . Contextualai . MaxNewTokens = v , a . MaxNewTokens ) ;
368+ SetIfNotNull ( v => result . Contextualai . AvoidCommentary = v , a . AvoidCommentary ) ;
368369 break ;
369370 default :
370371 throw new NotSupportedException (
You can’t perform that action at this time.
0 commit comments