File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed 
guardrails/utils/openai_utils Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 66    is_static_openai_chat_acreate_func ,
77    is_static_openai_chat_create_func ,
88    is_static_openai_create_func ,
9+     get_static_openai_create_func ,
10+     get_static_openai_chat_create_func ,
11+     get_static_openai_acreate_func ,
12+     get_static_openai_chat_acreate_func ,
913)
1014
1115__all__  =  [
1620    "is_static_openai_acreate_func" ,
1721    "is_static_openai_chat_acreate_func" ,
1822    "OpenAIServiceUnavailableError" ,
23+     "get_static_openai_create_func" ,
24+     "get_static_openai_chat_create_func" ,
25+     "get_static_openai_acreate_func" ,
26+     "get_static_openai_chat_acreate_func" ,
1927]
Original file line number Diff line number Diff line change 22
33import  openai 
44
5+ import  warnings 
56from  guardrails .classes .llm .llm_response  import  LLMResponse 
67from  guardrails .utils .openai_utils .base  import  BaseOpenAIClient 
78from  guardrails .utils .openai_utils .streaming_utils  import  (
1213from  guardrails .telemetry  import  trace_llm_call , trace_operation 
1314
1415
16+ def  get_static_openai_create_func ():
17+     warnings .warn (
18+         "This function is deprecated. "  " and will be removed in 0.6.0" ,
19+         DeprecationWarning ,
20+     )
21+     return  openai .completions .create 
22+ 
23+ 
24+ def  get_static_openai_chat_create_func ():
25+     warnings .warn (
26+         "This function is deprecated and will be removed in 0.6.0" ,
27+         DeprecationWarning ,
28+     )
29+     return  openai .chat .completions .create 
30+ 
31+ 
32+ def  get_static_openai_acreate_func ():
33+     warnings .warn (
34+         "This function is deprecated and will be removed in 0.6.0" ,
35+         DeprecationWarning ,
36+     )
37+     return  None 
38+ 
39+ 
40+ def  get_static_openai_chat_acreate_func ():
41+     warnings .warn (
42+         "This function is deprecated and will be removed in 0.6.0" ,
43+         DeprecationWarning ,
44+     )
45+     return  None 
46+ 
47+ 
1548def  is_static_openai_create_func (llm_api : Optional [Callable ]) ->  bool :
1649    try :
1750        return  llm_api  ==  openai .completions .create 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments