Spaces:
Sleeping
Sleeping
bradartigue
commited on
Commit
•
db3f69e
1
Parent(s):
7ec5535
Update app.py
Browse files
app.py
CHANGED
@@ -8,14 +8,14 @@ import openai
|
|
8 |
import langchain
|
9 |
import random
|
10 |
from langchain_openai import ChatOpenAI
|
11 |
-
from
|
12 |
from langchain.prompts import PromptTemplate
|
13 |
from langchain.chains import LLMChain
|
14 |
|
15 |
# Set environment variables and OpenAI configurations
|
16 |
api_keys = os.environ
|
17 |
openai.api_key = os.environ['OPENAI_API_KEY']
|
18 |
-
|
19 |
langchain.llm_cache = InMemoryCache()
|
20 |
|
21 |
app = Flask(__name__)
|
@@ -198,4 +198,4 @@ def hello():
|
|
198 |
|
199 |
|
200 |
if __name__ == '__main__':
|
201 |
-
app.run(
|
|
|
8 |
import langchain
|
9 |
import random
|
10 |
from langchain_openai import ChatOpenAI
|
11 |
+
from langchain_community.cache import InMemoryCache
|
12 |
from langchain.prompts import PromptTemplate
|
13 |
from langchain.chains import LLMChain
|
14 |
|
15 |
# Set environment variables and OpenAI configurations
|
16 |
api_keys = os.environ
|
17 |
openai.api_key = os.environ['OPENAI_API_KEY']
|
18 |
+
print(os.environ['OPENAI_API_KEY'])
|
19 |
langchain.llm_cache = InMemoryCache()
|
20 |
|
21 |
app = Flask(__name__)
|
|
|
198 |
|
199 |
|
200 |
if __name__ == '__main__':
|
201 |
+
app.run()
|