@@ -44,8 +44,7 @@ def encode_json(
4444 if isinstance (obj , io .IOBase ):
4545 if file_encoding_strategy == "base64" :
4646 return base64_encode_file (obj )
47- else :
48- return client .files .create (obj ).urls ["get" ]
47+ return client .files .create (obj ).urls ["get" ]
4948 if HAS_NUMPY :
5049 if isinstance (obj , np .integer ): # type: ignore
5150 return int (obj )
@@ -82,8 +81,7 @@ async def async_encode_json(
8281 if file_encoding_strategy == "base64" :
8382 # TODO: This should ideally use an async based file reader path.
8483 return base64_encode_file (obj )
85- else :
86- return (await client .files .async_create (obj )).urls ["get" ]
84+ return (await client .files .async_create (obj )).urls ["get" ]
8785 if HAS_NUMPY :
8886 if isinstance (obj , np .integer ): # type: ignore
8987 return int (obj )
@@ -183,9 +181,9 @@ def transform_output(value: Any, client: "Client") -> Any:
183181 def transform (obj : Any ) -> Any :
184182 if isinstance (obj , Mapping ):
185183 return {k : transform (v ) for k , v in obj .items ()}
186- elif isinstance (obj , Sequence ) and not isinstance (obj , str ):
184+ if isinstance (obj , Sequence ) and not isinstance (obj , str ):
187185 return [transform (item ) for item in obj ]
188- elif isinstance (obj , str ) and (
186+ if isinstance (obj , str ) and (
189187 obj .startswith ("https:" ) or obj .startswith ("data:" )
190188 ):
191189 return FileOutput (obj , client )
0 commit comments