Ludovicollin commited on
Commit
61d1ad7
Β·
1 Parent(s): f8af325

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -7
main.py CHANGED
@@ -26,6 +26,14 @@ from chainlit import user_session
26
  from offres_emploi import Api
27
  from offres_emploi.utils import dt_to_str_iso
28
  import datetime
 
 
 
 
 
 
 
 
29
 
30
  @cl.author_rename
31
  def rename(orig_author: str):
@@ -128,17 +136,10 @@ async def start():
128
  if value:
129
  await cl.Message(author="🌐🌐🌐",content=settings["AgentName"]).send()
130
 
131
- index_name = os.environ['PINECONE_INDEX_NAME']
132
- embeddings = HuggingFaceEmbeddings()
133
- pinecone.init(
134
- api_key=os.environ['PINECONE_API_KEY'],
135
- environment=os.environ['PINECONE_ENVIRONMENT']
136
- )
137
  vectorstore = Pinecone.from_existing_index(
138
  index_name=index_name, embedding=embeddings
139
  )
140
 
141
- os.environ['ANTHROPIC_API_KEY'] = os.environ['ANTHROPIC_API_KEY']
142
  from langchain_core.prompts.prompt import PromptTemplate
143
 
144
  _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language.
 
26
  from offres_emploi import Api
27
  from offres_emploi.utils import dt_to_str_iso
28
  import datetime
29
+
30
+ os.environ['ANTHROPIC_API_KEY'] = os.environ['ANTHROPIC_API_KEY']
31
+ index_name = os.environ['PINECONE_INDEX_NAME']
32
+ embeddings = HuggingFaceEmbeddings()
33
+ pinecone.init(
34
+ api_key=os.environ['PINECONE_API_KEY'],
35
+ environment=os.environ['PINECONE_ENVIRONMENT']
36
+ )
37
 
38
  @cl.author_rename
39
  def rename(orig_author: str):
 
136
  if value:
137
  await cl.Message(author="🌐🌐🌐",content=settings["AgentName"]).send()
138
 
 
 
 
 
 
 
139
  vectorstore = Pinecone.from_existing_index(
140
  index_name=index_name, embedding=embeddings
141
  )
142
 
 
143
  from langchain_core.prompts.prompt import PromptTemplate
144
 
145
  _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language.