rajrakeshdr commited on
Commit
4b5e010
·
verified ·
1 Parent(s): 449328a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -42,7 +42,7 @@ prompt_template = PromptTemplate(
42
  chain = LLMChain(llm=llm, prompt=prompt_template)
43
 
44
  # URL of the external API
45
- EXTERNAL_API_URL = "https://api.example.com/process-input" # Replace with the actual URL
46
 
47
  @app.post("/search")
48
  async def process_search(search_query: SearchQuery):
@@ -58,6 +58,7 @@ async def process_search(search_query: SearchQuery):
58
  await client.post(
59
  EXTERNAL_API_URL,
60
  json={"input": search_query.query}, # Send the user input
 
61
  timeout=5 # Set a timeout to avoid hanging
62
  )
63
 
 
42
  chain = LLMChain(llm=llm, prompt=prompt_template)
43
 
44
  # URL of the external API
45
+ EXTERNAL_API_URL = "https://rajrakeshdr-intelliSOC-suggestions.hf.space/process-input" # Replace with the actual URL rajrakeshdr/intelliSOC-suggestions
46
 
47
  @app.post("/search")
48
  async def process_search(search_query: SearchQuery):
 
58
  await client.post(
59
  EXTERNAL_API_URL,
60
  json={"input": search_query.query}, # Send the user input
61
+ headers={"Authorization": f"Bearer {HUGGING_FACE_API_TOKEN}"}, # Add authentication
62
  timeout=5 # Set a timeout to avoid hanging
63
  )
64