File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
src/Documents/Operations/AI/ConnectionStrings/Settings Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export class AzureOpenAiSettings extends OpenAiBaseSettings {
2222 public validate ( errors : string [ ] ) : void {
2323 super . validate ( errors ) ;
2424
25- if ( StringUtil . isNullOrEmpty ( this . deploymentName . trim ( ) ) ) {
25+ if ( StringUtil . isNullOrEmpty ( this . deploymentName ? .trim ( ) ) ) {
2626 errors . push ( "Value for 'deploymentName' field cannot be empty." ) ;
2727 }
2828 }
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export class GoogleSettings extends AbstractAiSettings {
5555 errors . push ( "Value of 'apiKey' field cannot be empty." ) ;
5656 }
5757
58- if ( this . dimensions !== undefined && this . dimensions <= 0 ) {
58+ if ( this . dimensions != null && this . dimensions <= 0 ) {
5959 errors . push ( "Value of 'dimensions' field must be positive." ) ;
6060 }
6161 }
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export class OllamaSettings extends AbstractAiSettings {
4747 errors . push ( "Value of 'model' field cannot be empty." ) ;
4848 }
4949
50- if ( this . temperature !== undefined && this . temperature < 0 ) {
50+ if ( this . temperature != null && this . temperature < 0 ) {
5151 errors . push ( "Value of 'temperature' field must be non-negative." ) ;
5252 }
5353 }
@@ -71,12 +71,12 @@ export class OllamaSettings extends AbstractAiSettings {
7171 differences |= AiSettingsCompareDifferences . EndpointConfiguration ;
7272 }
7373
74- const hasTemperature = this . temperature !== undefined ;
75- const otherHasTemperature = other . temperature !== undefined ;
74+ const hasTemperature = this . temperature != null ;
75+ const otherHasTemperature = other . temperature != null ;
7676
7777 if ( hasTemperature !== otherHasTemperature ||
7878 ( hasTemperature && otherHasTemperature &&
79- Math . abs ( this . temperature ! - other . temperature ! ) > 0.0001 ) ) {
79+ Math . abs ( this . temperature - other . temperature ) > 0.0001 ) ) {
8080 differences |= AiSettingsCompareDifferences . EndpointConfiguration ;
8181 }
8282
Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ export abstract class OpenAiBaseSettings extends AbstractAiSettings implements I
7171 errors . push ( "Value of 'model' field cannot be empty." ) ;
7272 }
7373
74- if ( this . dimensions !== undefined && this . dimensions <= 0 ) {
74+ if ( this . dimensions != null && this . dimensions <= 0 ) {
7575 errors . push ( "Value of 'dimensions' field must be positive." ) ;
7676 }
7777
78- if ( this . temperature !== undefined && this . temperature < 0 ) {
78+ if ( this . temperature != null && this . temperature < 0 ) {
7979 errors . push ( "Value of 'temperature' field must be non-negative." ) ;
8080 }
8181 }
@@ -103,12 +103,12 @@ export abstract class OpenAiBaseSettings extends AbstractAiSettings implements I
103103 differences |= AiSettingsCompareDifferences . EmbeddingDimensions ;
104104 }
105105
106- const hasTemperature = this . temperature !== undefined ;
107- const otherHasTemperature = other . temperature !== undefined ;
106+ const hasTemperature = this . temperature != null ;
107+ const otherHasTemperature = other . temperature != null ;
108108
109109 if ( hasTemperature !== otherHasTemperature ||
110110 ( hasTemperature && otherHasTemperature &&
111- Math . abs ( this . temperature ! - other . temperature ! ) > 0.0001 ) ) {
111+ Math . abs ( this . temperature - other . temperature ) > 0.0001 ) ) {
112112 differences |= AiSettingsCompareDifferences . EndpointConfiguration ;
113113 }
114114
You can’t perform that action at this time.
0 commit comments