File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ class OpenAiDefinition:
6060 type : str
6161 sync : bool
6262 min_version : Optional [str ] = None
63+ max_version : Optional [str ] = None
6364
6465
6566OPENAI_METHODS_V0 = [
@@ -116,6 +117,7 @@ class OpenAiDefinition:
116117 type = "chat" ,
117118 sync = True ,
118119 min_version = "1.50.0" ,
120+ max_version = "1.92.0" ,
119121 ),
120122 OpenAiDefinition (
121123 module = "openai.resources.beta.chat.completions" ,
@@ -124,6 +126,23 @@ class OpenAiDefinition:
124126 type = "chat" ,
125127 sync = False ,
126128 min_version = "1.50.0" ,
129+ max_version = "1.92.0" ,
130+ ),
131+ OpenAiDefinition (
132+ module = "openai.resources.chat.completions" ,
133+ object = "Completions" ,
134+ method = "parse" ,
135+ type = "chat" ,
136+ sync = True ,
137+ min_version = "1.92.0" ,
138+ ),
139+ OpenAiDefinition (
140+ module = "openai.resources.chat.completions" ,
141+ object = "AsyncCompletions" ,
142+ method = "parse" ,
143+ type = "chat" ,
144+ sync = False ,
145+ min_version = "1.92.0" ,
127146 ),
128147 OpenAiDefinition (
129148 module = "openai.resources.responses" ,
@@ -799,6 +818,11 @@ def register_tracing():
799818 ):
800819 continue
801820
821+ if resource .max_version is not None and Version (openai .__version__ ) >= Version (
822+ resource .max_version
823+ ):
824+ continue
825+
802826 wrap_function_wrapper (
803827 resource .module ,
804828 f"{ resource .object } .{ resource .method } " ,
You can’t perform that action at this time.
0 commit comments