@@ -47,7 +47,7 @@ async def _test_model_completion(
4747 "model" : model_id ,
4848 "messages" : [{"role" : "user" , "content" : test_prompt }],
4949 "max_tokens" : model .max_tokens ,
50- "temperature" : model .max_tokens ,
50+ "temperature" : model .temperature ,
5151 }
5252 send_func = client .send_chat_completion
5353 else :
@@ -86,7 +86,6 @@ async def filter_working_models(
8686 Asynchronously tests each model in free_models with the given test
8787 prompt and API endpoint returning only those models that respond
8888 without an error.
89-
9089 :param client: An instance of AsyncOpenRouterClient.
9190 :param free_models: A list of model dictionaries.
9291 :param test_prompt: The prompt to test.
@@ -97,16 +96,17 @@ async def filter_working_models(
9796 _test_model_completion (client , model , test_prompt , api_endpoint , delay = i * 3 )
9897 for i , model in enumerate (free_models )
9998 ]
100- results = await asyncio .gather (* tasks )
99+ results = await asyncio .gather (* tasks , return_exceptions = True )
101100
102- valid_models = []
101+ working_models = []
103102 for result in results :
104103 if isinstance (result , Exception ):
105104 continue
106- model , works = result
105+ model , works = result # pyright: ignore [reportGeneralTypeIssues]
107106 if works :
108- valid_models .append (model )
109- return valid_models
107+ working_models .append (model )
108+
109+ return working_models
110110
111111
112112async def main () -> None :
0 commit comments