File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 22
33import logging
44import time
5- from typing import Dict , List
5+ import warnings
6+ from typing import Dict , List , Optional
67
78import openai
89
@@ -62,8 +63,36 @@ class OpenAIMonitor:
6263 def __init__ (
6364 self ,
6465 client = None ,
66+ publish : Optional [bool ] = None ,
6567 ) -> None :
6668 self ._initialize_openai (client )
69+ if publish is not None :
70+ warnings .warn (
71+ "The `publish` parameter is deprecated and will be removed in a future"
72+ " version. All traces are now automatically published to Openlayer." ,
73+ DeprecationWarning ,
74+ stacklevel = 2 ,
75+ )
76+
77+ def start_monitoring (self ) -> None :
78+ """Start monitoring the OpenAI assistant."""
79+ warnings .warn (
80+ "The `start_monitoring` method is deprecated and will be removed in a future"
81+ " version. Monitoring is now automatically enabled once the OpenAIMonitor"
82+ " is instantiated." ,
83+ DeprecationWarning ,
84+ stacklevel = 2 ,
85+ )
86+
87+ def stop_monitoring (self ) -> None :
88+ """Stop monitoring the OpenAI assistant."""
89+ warnings .warn (
90+ "The `stop_monitoring` method is deprecated and will be removed in a future"
91+ " version. Monitoring is now automatically enabled once the OpenAIMonitor"
92+ " is instantiated." ,
93+ DeprecationWarning ,
94+ stacklevel = 2 ,
95+ )
6796
6897 def _initialize_openai (self , client ) -> None :
6998 """Initializes the OpenAI attributes."""
You can’t perform that action at this time.
0 commit comments