File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ class OpenAiDefinition:
6262 type : str
6363 sync : bool
6464 min_version : Optional [str ] = None
65+ max_version : Optional [str ] = None
6566
6667
6768OPENAI_METHODS_V0 = [
@@ -118,6 +119,7 @@ class OpenAiDefinition:
118119 type = "chat" ,
119120 sync = True ,
120121 min_version = "1.50.0" ,
122+ max_version = "1.92.0" ,
121123 ),
122124 OpenAiDefinition (
123125 module = "openai.resources.beta.chat.completions" ,
@@ -126,6 +128,23 @@ class OpenAiDefinition:
126128 type = "chat" ,
127129 sync = False ,
128130 min_version = "1.50.0" ,
131+ max_version = "1.92.0" ,
132+ ),
133+ OpenAiDefinition (
134+ module = "openai.resources.chat.completions" ,
135+ object = "Completions" ,
136+ method = "parse" ,
137+ type = "chat" ,
138+ sync = True ,
139+ min_version = "1.92.0" ,
140+ ),
141+ OpenAiDefinition (
142+ module = "openai.resources.chat.completions" ,
143+ object = "AsyncCompletions" ,
144+ method = "parse" ,
145+ type = "chat" ,
146+ sync = False ,
147+ min_version = "1.92.0" ,
129148 ),
130149 OpenAiDefinition (
131150 module = "openai.resources.responses" ,
@@ -876,6 +895,11 @@ def register_tracing(self):
876895 ) < Version (resource .min_version ):
877896 continue
878897
898+ if resource .max_version is not None and Version (
899+ openai .__version__
900+ ) >= Version (resource .max_version ):
901+ continue
902+
879903 wrap_function_wrapper (
880904 resource .module ,
881905 f"{ resource .object } .{ resource .method } " ,
You can’t perform that action at this time.
0 commit comments