File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
openhands-sdk/openhands/sdk/llm Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -756,11 +756,12 @@ def _init_model_info_and_caps(self) -> None:
756756 if not base_url .startswith (("http://" , "https://" )):
757757 base_url = "http://" + base_url
758758 try :
759+ headers = {}
759760 api_key = self .api_key .get_secret_value () if self .api_key else ""
760- response = httpx . get (
761- f" { base_url } /v1/model/info" ,
762- headers = { "Authorization" : f"Bearer { api_key } " },
763- )
761+ if api_key :
762+ headers [ "Authorization" ] = f"Bearer { api_key } "
763+
764+ response = httpx . get ( f" { base_url } /v1/model/info" , headers = headers )
764765 data = response .json ().get ("data" , [])
765766 current = next (
766767 (
@@ -777,7 +778,11 @@ def _init_model_info_and_caps(self) -> None:
777778 f"Got model info from litellm proxy: { self ._model_info } "
778779 )
779780 except Exception as e :
780- logger .debug (f"Error fetching model info from proxy: { e } " )
781+ logger .debug (
782+ f"Error fetching model info from proxy: { e } " ,
783+ exc_info = True ,
784+ stack_info = True ,
785+ )
781786
782787 # Fallbacks: try base name variants
783788 if not self ._model_info :
You can’t perform that action at this time.
0 commit comments