Skip to content

Commit

Permalink
attr checker
Browse files Browse the repository at this point in the history
  • Loading branch information
areibman committed Jan 3, 2024
1 parent 08e433d commit 02ae95a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions agentops/llm_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ def override_api(self, api):

# If openai 1.0.0+ is specified, patch the completions methods
if api == 'openai':
module_version = parse(module.__version__)
if module_version >= parse('1.0.0'):
self.override_openai_v1_completion()
self.override_openai_v1_async_completion()
if hasattr(module, '__version__'):
module_version = parse(module.__version__)
if module_version >= parse('1.0.0'):
self.override_openai_v1_completion()
self.override_openai_v1_async_completion()

# Patch all methods in every API
if hasattr(module, '__version__'):
Expand Down

0 comments on commit 02ae95a

Please sign in to comment.