@@ -10,14 +10,14 @@ pub struct RequestOptions {
1010}
1111
1212impl RequestOptions {
13- pub fn new ( ) -> Self {
13+ pub ( crate ) fn new ( ) -> Self {
1414 Self {
1515 query : None ,
1616 headers : None ,
1717 }
1818 }
1919
20- pub fn with_headers ( & mut self , headers : HeaderMap ) {
20+ pub ( crate ) fn with_headers ( & mut self , headers : HeaderMap ) {
2121 // merge with existing headers or update with new headers
2222 if let Some ( existing_headers) = & mut self . headers {
2323 existing_headers. extend ( headers) ;
@@ -26,7 +26,7 @@ impl RequestOptions {
2626 }
2727 }
2828
29- pub fn with_header < K , V > ( & mut self , key : K , value : V ) -> Result < ( ) , OpenAIError >
29+ pub ( crate ) fn with_header < K , V > ( & mut self , key : K , value : V ) -> Result < ( ) , OpenAIError >
3030 where
3131 K : reqwest:: header:: IntoHeaderName ,
3232 V : TryInto < reqwest:: header:: HeaderValue > ,
@@ -45,7 +45,10 @@ impl RequestOptions {
4545 Ok ( ( ) )
4646 }
4747
48- pub fn with_query < Q : Serialize + ?Sized > ( & mut self , query : & Q ) -> Result < ( ) , OpenAIError > {
48+ pub ( crate ) fn with_query < Q : Serialize + ?Sized > (
49+ & mut self ,
50+ query : & Q ,
51+ ) -> Result < ( ) , OpenAIError > {
4952 let new_query = serde_urlencoded:: to_string ( query)
5053 . map_err ( |e| OpenAIError :: InvalidArgument ( format ! ( "Invalid query: {}" , e) ) ) ?;
5154 if let Some ( existing_query) = & self . query {
@@ -56,11 +59,11 @@ impl RequestOptions {
5659 Ok ( ( ) )
5760 }
5861
59- pub fn query ( & self ) -> Option < & str > {
62+ pub ( crate ) fn query ( & self ) -> Option < & str > {
6063 self . query . as_deref ( )
6164 }
6265
63- pub fn headers ( & self ) -> Option < & HeaderMap > {
66+ pub ( crate ) fn headers ( & self ) -> Option < & HeaderMap > {
6467 self . headers . as_ref ( )
6568 }
6669}
0 commit comments