Skip to content

Commit

Permalink
updated client
Browse files Browse the repository at this point in the history
  • Loading branch information
Nweaver412 committed Jan 16, 2025
1 parent c92eadb commit f56c281
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ def init_openai_client(self):
self.client = OpenAI(api_key=self._configuration.pswd_apiKey)


def get_embedding(text, model="text-embedding-3-small"):
def get_embedding(self, text, model="text-embedding-3-small"):
if not text or not isinstance(text, str) or text.strip() == "":
return []
text = text.replace("\n", " ")
return OpenAI.embeddings.create(input = [text], model=model).data[0].embedding
return self.client.embeddings.create(input = [text], model=model).data[0].embedding


def _get_input_table(self):
Expand Down

0 comments on commit f56c281

Please sign in to comment.