@@ -141,8 +141,8 @@ impl ChatWorkspaceSettings {
141141 self
142142 }
143143
144- pub fn set_prompts ( & mut self , prompts : ChatPrompts ) -> & mut Self {
145- self . prompts = Some ( prompts) ;
144+ pub fn set_prompts ( & mut self , prompts : impl Into < ChatPrompts > ) -> & mut Self {
145+ self . prompts = Some ( prompts. into ( ) ) ;
146146 self
147147 }
148148}
@@ -275,34 +275,13 @@ impl Client<crate::reqwest::ReqwestClient> {
275275 uid : impl AsRef < str > ,
276276 body : & S ,
277277 ) -> Result < reqwest:: Response , Error > {
278- use reqwest:: {
279- header:: { self , HeaderValue , ACCEPT , CONTENT_TYPE } ,
280- Client as HttpClient ,
281- } ;
278+ use reqwest:: header:: { HeaderValue , ACCEPT , CONTENT_TYPE } ;
282279
283280 let payload = to_vec ( body) . map_err ( Error :: ParseError ) ?;
284281
285- let mut headers = header:: HeaderMap :: new ( ) ;
286- #[ cfg( not( target_arch = "wasm32" ) ) ]
287- headers. insert (
288- header:: USER_AGENT ,
289- header:: HeaderValue :: from_str ( & crate :: reqwest:: qualified_version ( ) ) . unwrap ( ) ,
290- ) ;
291- #[ cfg( target_arch = "wasm32" ) ]
292- headers. insert (
293- header:: HeaderName :: from_static ( "x-meilisearch-client" ) ,
294- header:: HeaderValue :: from_str ( & crate :: reqwest:: qualified_version ( ) ) . unwrap ( ) ,
295- ) ;
296- if let Some ( api_key) = self . api_key . as_deref ( ) {
297- headers. insert (
298- header:: AUTHORIZATION ,
299- header:: HeaderValue :: from_str ( & format ! ( "Bearer {api_key}" ) ) . unwrap ( ) ,
300- ) ;
301- }
302-
303- let http = HttpClient :: builder ( ) . default_headers ( headers) . build ( ) ?;
304-
305- let response = http
282+ let response = self
283+ . http_client
284+ . inner ( )
306285 . post ( format ! (
307286 "{}/chats/{}/chat/completions" ,
308287 self . host,
0 commit comments