File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -505,6 +505,9 @@ def parse_response(
505
505
result = schema .model_validate (response .function_results [0 ].arguments , from_attributes = True )
506
506
result ._set_values_from_response (response , name = self .name if include_name else None )
507
507
return result
508
+ except IndexError as e :
509
+ self .autologger .error (f"[{ self .name } - { response .model } - { response .usage } ] No function results found: { e } \n { response .text } " )
510
+ return None
508
511
except Exception as e :
509
512
self .autologger .error (f"[{ self .name } - { response .model } - { response .usage } ] Failed to parse object: { e } \n { response .text } \n { response .function_results [0 ].arguments } " )
510
513
try :
@@ -688,6 +691,7 @@ def run_function_loop(
688
691
chat = chat ,
689
692
messages = messages ,
690
693
model = model ,
694
+ cachable = False ,
691
695
** kwargs ,
692
696
)
693
697
result = self .parse_response (response , include_name = True )
@@ -698,7 +702,8 @@ def run_function_loop(
698
702
name = self .name ,
699
703
func_name = self .name ,
700
704
model = model ,
701
- attempts = self .max_attempts ,
705
+ attempts = attempts ,
706
+ max_attempts = self .max_attempts ,
702
707
)
703
708
return None
704
709
@@ -732,6 +737,7 @@ async def arun_function_loop(
732
737
chat = chat ,
733
738
messages = messages ,
734
739
model = model ,
740
+ cachable = False ,
735
741
** kwargs ,
736
742
)
737
743
result = self .parse_response (response , include_name = True )
@@ -742,7 +748,8 @@ async def arun_function_loop(
742
748
name = self .name ,
743
749
func_name = self .name ,
744
750
model = model ,
745
- attempts = self .max_attempts ,
751
+ attempts = attempts ,
752
+ max_attempts = self .max_attempts ,
746
753
)
747
754
return None
748
755
You can’t perform that action at this time.
0 commit comments