Omartificial-Intelligence-Space commited on
Commit
1683c72
·
verified ·
1 Parent(s): 3715692

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ from sentence_transformers import SentenceTransformer
3
  from wikipediaapi import Wikipedia
4
  import textwrap
5
  import numpy as np
6
- import openai
7
 
8
  # Function to process the input and generate the output
9
  def process_query(wiki_page, model_name, embed_dim, query, api_key):
@@ -43,8 +43,8 @@ def process_query(wiki_page, model_name, embed_dim, query, api_key):
43
  QUESTION: {query}
44
  """
45
 
46
- client = openai.OpenAI(api_key=api_key)
47
- response = client.chat_completions.create(
48
  model="gpt-4o",
49
  messages=[
50
  {"role": "user", "content": prompt},
 
3
  from wikipediaapi import Wikipedia
4
  import textwrap
5
  import numpy as np
6
+ from openai import OpenAI
7
 
8
  # Function to process the input and generate the output
9
  def process_query(wiki_page, model_name, embed_dim, query, api_key):
 
43
  QUESTION: {query}
44
  """
45
 
46
+ client = OpenAI(api_key=api_key)
47
+ response = client.chat.completions.create(
48
  model="gpt-4o",
49
  messages=[
50
  {"role": "user", "content": prompt},