Spaces:
Running
Running
Update app.py
Browse files
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://
|
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 |
|