@@ -293,6 +293,12 @@ def invoke(
293293 instructions: Additional run instructions.
294294 model: Override Assistant model for this run.
295295 tools: Override Assistant tools for this run.
296+ parallel_tool_calls: Allow Assistant to set parallel_tool_calls
297+ for this run.
298+ top_p: Override Assistant top_p for this run.
299+ temperature: Override Assistant temperature for this run.
300+ max_completion_tokens: Allow setting max_completion_tokens for this run.
301+ max_prompt_tokens: Allow setting max_prompt_tokens for this run.
296302 run_metadata: Metadata to associate with new run.
297303 config: Runnable config. Defaults to None.
298304
@@ -412,6 +418,12 @@ async def ainvoke(
412418 additional_instructions: Appends additional instructions.
413419 model: Override Assistant model for this run.
414420 tools: Override Assistant tools for this run.
421+ parallel_tool_calls: Allow Assistant to set parallel_tool_calls
422+ for this run.
423+ top_p: Override Assistant top_p for this run.
424+ temperature: Override Assistant temperature for this run.
425+ max_completion_tokens: Allow setting max_completion_tokens for this run.
426+ max_prompt_tokens: Allow setting max_prompt_tokens for this run.
415427 run_metadata: Metadata to associate with new run.
416428 config: Runnable config. Defaults to None.
417429 kwargs: Additional arguments.
@@ -514,6 +526,11 @@ def _create_run(self, input: dict) -> Any:
514526 "model" ,
515527 "tools" ,
516528 "additional_instructions" ,
529+ "parallel_tool_calls" ,
530+ "top_p" ,
531+ "temperature" ,
532+ "max_completion_tokens" ,
533+ "max_prompt_tokens" ,
517534 "run_metadata" ,
518535 )
519536 }
@@ -527,7 +544,18 @@ def _create_thread_and_run(self, input: dict, thread: dict) -> Any:
527544 params = {
528545 k : v
529546 for k , v in input .items ()
530- if k in ("instructions" , "model" , "tools" , "run_metadata" )
547+ if k
548+ in (
549+ "instructions" ,
550+ "model" ,
551+ "tools" ,
552+ "parallel_tool_calls" ,
553+ "top_p" ,
554+ "temperature" ,
555+ "max_completion_tokens" ,
556+ "max_prompt_tokens" ,
557+ "run_metadata" ,
558+ )
531559 }
532560 run = self .client .beta .threads .create_and_run (
533561 assistant_id = self .assistant_id ,
@@ -651,6 +679,11 @@ async def _acreate_run(self, input: dict) -> Any:
651679 "model" ,
652680 "tools" ,
653681 "additional_instructions" ,
682+ "parallel_tool_calls" ,
683+ "top_p" ,
684+ "temperature" ,
685+ "max_completion_tokens" ,
686+ "max_prompt_tokens" ,
654687 "run_metadata" ,
655688 )
656689 }
@@ -664,7 +697,18 @@ async def _acreate_thread_and_run(self, input: dict, thread: dict) -> Any:
664697 params = {
665698 k : v
666699 for k , v in input .items ()
667- if k in ("instructions" , "model" , "tools" , "run_metadata" )
700+ if k
701+ in (
702+ "instructions" ,
703+ "model" ,
704+ "tools" ,
705+ "parallel_tool_calls" ,
706+ "top_p" ,
707+ "temperature" ,
708+ "max_completion_tokens" ,
709+ "max_prompt_tokens" ,
710+ "run_metadata" ,
711+ )
668712 }
669713 run = await self .async_client .beta .threads .create_and_run (
670714 assistant_id = self .assistant_id ,
0 commit comments