File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- __version__ = "0.53.1 "
1+ __version__ = "0.53.2 "
22
33
44def get_sdk_version ():
Original file line number Diff line number Diff line change @@ -95,18 +95,18 @@ def complete(
9595 try :
9696 response : CompletionResponse = self ._llm_instance .complete (prompt , ** kwargs )
9797 process_text_output = {}
98+ if extract_json :
99+ match = LLM .json_regex .search (response .text )
100+ if match :
101+ response .text = match .group (0 )
98102 if process_text :
99103 try :
100- process_text_output = process_text (response , LLM . json_regex )
104+ process_text_output = process_text (response , extract_json )
101105 if not isinstance (process_text_output , dict ):
102106 process_text_output = {}
103107 except Exception as e :
104108 logger .error (f"Error occured inside function 'process_text': { e } " )
105109 process_text_output = {}
106- if extract_json :
107- match = LLM .json_regex .search (response .text )
108- if match :
109- response .text = match .group (0 )
110110 return {LLM .RESPONSE : response , ** process_text_output }
111111 except Exception as e :
112112 raise parse_llm_err (e ) from e
You can’t perform that action at this time.
0 commit comments