olaf-bu commited on
Commit
6ce07e5
·
1 Parent(s): ccb83a2

fixed variable name

Browse files
Files changed (1) hide show
  1. tools.py +2 -2
tools.py CHANGED
@@ -151,7 +151,7 @@ class DescribeImageTool(Tool):
151
  """ensure, that the super class is instantiated properly and creat an OpenAI client (if not already done)."""
152
  super().__init__()
153
 
154
- if not self.cls.client:
155
  openai_api_key = os.environ.get('REAL_OPENAI_API_KEY', # just in case we run with other openAI compatibel providers
156
  os.environ.get('OPENAI_API_KEY')
157
  )
@@ -198,7 +198,7 @@ class DescribeImageTool(Tool):
198
  prompt = self.get_prompt(description_type, custom_prompt)
199
 
200
  # Make the API call
201
- response = client.chat.completions.create(
202
  model='gpt-4.1',
203
  messages=[{'role': 'user',
204
  'content': [{'type': 'text',
 
151
  """ensure, that the super class is instantiated properly and creat an OpenAI client (if not already done)."""
152
  super().__init__()
153
 
154
+ if not self.__class__.client:
155
  openai_api_key = os.environ.get('REAL_OPENAI_API_KEY', # just in case we run with other openAI compatibel providers
156
  os.environ.get('OPENAI_API_KEY')
157
  )
 
198
  prompt = self.get_prompt(description_type, custom_prompt)
199
 
200
  # Make the API call
201
+ response = self.__class__._client.chat.completions.create(
202
  model='gpt-4.1',
203
  messages=[{'role': 'user',
204
  'content': [{'type': 'text',