File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1- __version__ = "v0.73.1 "
1+ __version__ = "v0.73.2 "
22
33
44def get_sdk_version () -> str :
Original file line number Diff line number Diff line change 11import logging
2+ import os
23import re
34from collections .abc import Callable
45from typing import Any
@@ -31,6 +32,7 @@ class LLM:
3132 llm_adapters = adapters
3233 MAX_TOKENS = 1024 * 4
3334 RESPONSE = "response"
35+ JSON_SELECTION_MARKER = os .environ .get ("JSON_SELECTION_MARKER" , "§§§" )
3436
3537 def __init__ (
3638 self ,
@@ -101,10 +103,12 @@ def complete(
101103 process_text_output = {}
102104 if extract_json :
103105 response_text = response .text
104- start = response_text .find ("###" )
106+ start = response_text .find (self . JSON_SELECTION_MARKER )
105107 if start != - 1 :
106- response_text = response_text [start + 3 :].lstrip ()
107- end = response_text .rfind ("###" )
108+ response_text = response_text [
109+ start + len (self .JSON_SELECTION_MARKER ) :
110+ ].lstrip ()
111+ end = response_text .rfind (self .JSON_SELECTION_MARKER )
108112 if end != - 1 :
109113 response_text = response_text [:end ].rstrip ()
110114 match = LLM .json_regex .search (response_text )
You can’t perform that action at this time.
0 commit comments