Vikalp026var commited on
Commit
ad96115
1 Parent(s): d07bc79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -10,7 +10,10 @@ load_dotenv()
10
  # Initialize the OpenAI object with your API key
11
  api_key = os.getenv('OPEN_API_KEY') # Make sure you have this in your .env file
12
  llm = OpenAI(api_key=api_key)
13
-
 
 
 
14
  def get_openai_response(question):
15
  model_id = "gpt-3.5-turbo" # Ensure this is a valid model ID
16
  # response = llm.create_completion(prompt=question, model=model_id) # Adjust according to actual method signature
@@ -19,7 +22,7 @@ def get_openai_response(question):
19
  return response
20
 
21
  st.set_page_config(page_title="Q&A Demo")
22
- st.header("Langchain Application")
23
  user_input = st.text_input("Input:", key="input") # Changed variable name from 'input' to 'user_input'
24
  submit = st.button("Ask the question")
25
 
 
10
  # Initialize the OpenAI object with your API key
11
  api_key = os.getenv('OPEN_API_KEY') # Make sure you have this in your .env file
12
  llm = OpenAI(api_key=api_key)
13
+ os.environ["OPENAI_API_KEY"]=os.getenv("OPENAI_API_KEY")
14
+ ##LAngsmith Tracking
15
+ os.environ['LANGCHAIN_TRACING_V2']="true"
16
+ os.environ['LANGCHAIN_API_KEY']=os.getenv("LANGCHAIN_API_KEY")
17
  def get_openai_response(question):
18
  model_id = "gpt-3.5-turbo" # Ensure this is a valid model ID
19
  # response = llm.create_completion(prompt=question, model=model_id) # Adjust according to actual method signature
 
22
  return response
23
 
24
  st.set_page_config(page_title="Q&A Demo")
25
+ st.header("Chat Open For All")
26
  user_input = st.text_input("Input:", key="input") # Changed variable name from 'input' to 'user_input'
27
  submit = st.button("Ask the question")
28