@@ -11,11 +11,12 @@ module ContextDev
1111 T . any ( ContextDev ::PersonSearchParams , ContextDev ::Internal ::AnyHash )
1212 end
1313
14- # Describe the people to find.
14+ # Describe the people to find. Up to 500 characters in `fast` mode and 5000 in
15+ # `ultra` mode.
1516 sig { returns ( String ) }
1617 attr_accessor :query
1718
18- # Use next_cursor with the same query and filters to fetch the next page.
19+ # Use next_cursor with the same query, mode and filters to fetch the next page.
1920 sig { returns ( T . nilable ( String ) ) }
2021 attr_reader :cursor
2122
@@ -31,6 +32,15 @@ module ContextDev
3132 end
3233 attr_writer :filters
3334
35+ # `fast` matches people on basic criteria (e.g. their role, location or
36+ # background); `ultra` plans a deeper search, judges each candidate against every
37+ # criterion in the query and explains each match.
38+ sig { returns ( T . nilable ( ContextDev ::PersonSearchParams ::Mode ::OrSymbol ) ) }
39+ attr_reader :mode
40+
41+ sig { params ( mode : ContextDev ::PersonSearchParams ::Mode ::OrSymbol ) . void }
42+ attr_writer :mode
43+
3444 # Labels for filtering usage in the dashboard.
3545 sig { returns ( T . nilable ( T ::Array [ String ] ) ) }
3646 attr_reader :tags
@@ -43,17 +53,23 @@ module ContextDev
4353 query : String ,
4454 cursor : String ,
4555 filters : ContextDev ::PersonSearchParams ::Filters ::OrHash ,
56+ mode : ContextDev ::PersonSearchParams ::Mode ::OrSymbol ,
4657 tags : T ::Array [ String ] ,
4758 request_options : ContextDev ::RequestOptions ::OrHash
4859 ) . returns ( T . attached_class )
4960 end
5061 def self . new (
51- # Describe the people to find.
62+ # Describe the people to find. Up to 500 characters in `fast` mode and 5000 in
63+ # `ultra` mode.
5264 query :,
53- # Use next_cursor with the same query and filters to fetch the next page.
65+ # Use next_cursor with the same query, mode and filters to fetch the next page.
5466 cursor : nil ,
5567 # Additional constraints every result must match.
5668 filters : nil ,
69+ # `fast` matches people on basic criteria (e.g. their role, location or
70+ # background); `ultra` plans a deeper search, judges each candidate against every
71+ # criterion in the query and explains each match.
72+ mode : nil ,
5773 # Labels for filtering usage in the dashboard.
5874 tags : nil ,
5975 request_options : { }
@@ -66,6 +82,7 @@ module ContextDev
6682 query : String ,
6783 cursor : String ,
6884 filters : ContextDev ::PersonSearchParams ::Filters ,
85+ mode : ContextDev ::PersonSearchParams ::Mode ::OrSymbol ,
6986 tags : T ::Array [ String ] ,
7087 request_options : ContextDev ::RequestOptions
7188 }
@@ -134,6 +151,29 @@ module ContextDev
134151 def to_hash
135152 end
136153 end
154+
155+ # `fast` matches people on basic criteria (e.g. their role, location or
156+ # background); `ultra` plans a deeper search, judges each candidate against every
157+ # criterion in the query and explains each match.
158+ module Mode
159+ extend ContextDev ::Internal ::Type ::Enum
160+
161+ TaggedSymbol =
162+ T . type_alias { T . all ( Symbol , ContextDev ::PersonSearchParams ::Mode ) }
163+ OrSymbol = T . type_alias { T . any ( Symbol , String ) }
164+
165+ FAST = T . let ( :fast , ContextDev ::PersonSearchParams ::Mode ::TaggedSymbol )
166+ ULTRA =
167+ T . let ( :ultra , ContextDev ::PersonSearchParams ::Mode ::TaggedSymbol )
168+
169+ sig do
170+ override . returns (
171+ T ::Array [ ContextDev ::PersonSearchParams ::Mode ::TaggedSymbol ]
172+ )
173+ end
174+ def self . values
175+ end
176+ end
137177 end
138178 end
139179end
0 commit comments