@@ -112,7 +112,7 @@ public class FileSearchTool
112112
113113 /// <summary>
114114 /// Use comparison filters to compare a specific key in a file's attributes with a given value,
115- /// and compound filters to combine multiple filters using and and or .
115+ /// and compound filters to combine multiple filters using ` and` and `or` .
116116 /// <see href="https://platform.openai.com/docs/guides/retrieval#attribute-filtering">Attribute filtering</see>
117117 /// </summary>
118118 [ JsonPropertyName ( "filters" ) ]
@@ -139,12 +139,21 @@ public class FileSearchFilter
139139 [ JsonPropertyName ( "type" ) ]
140140 public string Type { get ; set ; }
141141
142+ /// <summary>
143+ /// The key to compare against the value.
144+ /// </summary>
142145 [ JsonPropertyName ( "key" ) ]
143146 public string ? Key { get ; set ; }
144147
148+ /// <summary>
149+ /// The value to compare against the attribute key; supports string, number, or boolean types.
150+ /// </summary>
145151 [ JsonPropertyName ( "value" ) ]
146152 public object ? Value { get ; set ; }
147153
154+ /// <summary>
155+ /// Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
156+ /// </summary>
148157 [ JsonPropertyName ( "filters" ) ]
149158 public List < FileSearchFilter > ? Filters { get ; set ; }
150159
@@ -155,7 +164,7 @@ public FileSearchFilter(string type)
155164
156165 public static FileSearchFilter DefineComparisonFilter ( string property , string condition , object value )
157166 {
158- return new FileSearchFilter ( condition )
167+ return new ( condition )
159168 {
160169 Key = property ,
161170 Value = value
@@ -164,7 +173,7 @@ public static FileSearchFilter DefineComparisonFilter(string property, string co
164173
165174 public static FileSearchFilter DefineCompoundFilter ( List < FileSearchFilter > filters , string condition )
166175 {
167- return new FileSearchFilter ( condition )
176+ return new ( condition )
168177 {
169178 Filters = filters
170179 } ;
@@ -174,17 +183,17 @@ public static FileSearchFilter DefineCompoundFilter(List<FileSearchFilter> filte
174183public static class ComparisonFilter
175184{
176185 //Types
177- public static string Equal = "eq" ;
178- public static string NotEqual = "ne" ;
179- public static string Greater = "gt" ;
180- public static string GreaterOrEqual = "gte" ;
181- public static string Less = "lt" ;
182- public static string LessOrEqual = "lte" ;
186+ public const string Equal = "eq" ;
187+ public const string NotEqual = "ne" ;
188+ public const string Greater = "gt" ;
189+ public const string GreaterOrEqual = "gte" ;
190+ public const string Less = "lt" ;
191+ public const string LessOrEqual = "lte" ;
183192}
184193
185194public static class CompoundFilter
186195{
187196 //Types
188- public static string And = "and" ;
189- public static string Or = "or" ;
197+ public const string And = "and" ;
198+ public const string Or = "or" ;
190199}
0 commit comments