@@ -528,7 +528,7 @@ def stream(
528
528
else :
529
529
prompt = self ._convert_input (input ).to_string ()
530
530
config = ensure_config (config )
531
- params = self .dict ()
531
+ params = self .model_dump ()
532
532
params ["stop" ] = stop
533
533
params = {** params , ** kwargs }
534
534
options = {"stop" : stop }
@@ -598,7 +598,7 @@ async def astream(
598
598
599
599
prompt = self ._convert_input (input ).to_string ()
600
600
config = ensure_config (config )
601
- params = self .dict ()
601
+ params = self .model_dump ()
602
602
params ["stop" ] = stop
603
603
params = {** params , ** kwargs }
604
604
options = {"stop" : stop }
@@ -941,7 +941,7 @@ def generate(
941
941
] * len (prompts )
942
942
run_name_list = [cast ("Optional[str]" , run_name )] * len (prompts )
943
943
run_ids_list = self ._get_run_ids_list (run_id , prompts )
944
- params = self .dict ()
944
+ params = self .model_dump ()
945
945
params ["stop" ] = stop
946
946
options = {"stop" : stop }
947
947
(
@@ -1193,7 +1193,7 @@ async def agenerate(
1193
1193
] * len (prompts )
1194
1194
run_name_list = [cast ("Optional[str]" , run_name )] * len (prompts )
1195
1195
run_ids_list = self ._get_run_ids_list (run_id , prompts )
1196
- params = self .dict ()
1196
+ params = self .model_dump ()
1197
1197
params ["stop" ] = stop
1198
1198
options = {"stop" : stop }
1199
1199
(
@@ -1400,7 +1400,7 @@ def _llm_type(self) -> str:
1400
1400
"""Return type of llm."""
1401
1401
1402
1402
@override
1403
- def dict (self , ** kwargs : Any ) -> dict :
1403
+ def model_dump (self , ** kwargs : Any ) -> dict :
1404
1404
"""Return a dictionary of the LLM."""
1405
1405
starter_dict = dict (self ._identifying_params )
1406
1406
starter_dict ["_type" ] = self ._llm_type
@@ -1427,7 +1427,7 @@ def save(self, file_path: Union[Path, str]) -> None:
1427
1427
directory_path .mkdir (parents = True , exist_ok = True )
1428
1428
1429
1429
# Fetch dictionary to save
1430
- prompt_dict = self .dict ()
1430
+ prompt_dict = self .model_dump ()
1431
1431
1432
1432
if save_path .suffix == ".json" :
1433
1433
with save_path .open ("w" ) as f :
0 commit comments