pablomarin / gpt-azure-search-engine Goto Github PK
View Code? Open in Web Editor NEWAzure Cognitive Search + Azure OpenAI Accelerator
Home Page: https://gptsmartsearchapp.azurewebsites.net
License: MIT License
Azure Cognitive Search + Azure OpenAI Accelerator
Home Page: https://gptsmartsearchapp.azurewebsites.net
License: MIT License
I tried to follow the guide, did the pip install based on the requirements file and ran the "streamlit Home.py" command. However, I am getting this error: Traceback (most recent call last):
File "/home/linuxbrew/.linuxbrew/bin/streamlit", line 8, in
sys.exit(main())
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/streamlit/web/cli.py", line 177, in main_run
bootstrap.load_config_options(flag_options=kwargs)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/streamlit/web/bootstrap.py", line 342, in load_config_options
config.get_config_options(force_reparse=True, options_from_flags=options_from_flags)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/streamlit/config.py", line 1144, in get_config_options
_update_config_with_toml(file_contents, filename)
File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.9/site-packages/streamlit/config.py", line 1025, in _update_config_with_toml
for name, value in options.items():
AttributeError: 'str' object has no attribute 'items'
Playing with the Streamlit model, I was asking the recommended question "list the authors that talk about Boosting Algorithms" and I got (what I assume) is the expected response - "The authors that talk about Boosting Algorithms are Ninan Sajeeth Philip and K. Babu Joseph, and Schapire.". However, if I start asking about dates, it doesn't return anything... such as: "How do Ninan Sajeeth Philip papers relate to booting algorithms?" or "when did Ninan Sajeeth Philip write papers relating to booting algorithms?".
The model doesn't seem to know anything about dates. Does this have to do with how the data model was built?
Is there any plan to update apps code to implement using langGraph with streaming api?
Hello,
Tested all notebooks and ran fine, deployed the backend web app with no errors but when testing it i get 'To continue to run this bot, please fix the bot source code. ' WHen i look at the Bot channels, both direct line & web chat have the same message for healthy status(issues): 'There was an error sending this message to your bot: HTTP status code GatewayTimeout' & when i do inspect in browser i see the POST call https://directline.botframework.com/v3/directline/conversations/XYZ-eu/activities with response:
{
"error": {
"code": "BotError",
"message": "Failed to send activity: bot timed out"
},
"httpStatusCode": 504
}
The same bot works in teams, but not in the frontend app, i also looked at all the backend webapp & frontend webapp configuration and checked all the values, including the BOT_DIRECTLINE_SECRET_KEY and it`s correct
Excellent architecture and description on the work flow / Read me. Thanks for providing details and quick resolutions I have a quick question.
I am trying to do a bing search in the demo link provided.
I am getting the following information. Can you please let me know how to test the demo link for bing search
I am getting the following attached answers for bing search. Looks like it does Cognitive search alone on the internal data and hence does not provide the answer from the internet
I'm using Serve.py to run, I use the internal document search function (https://github.com/docsearch). For questions that are not in the document, I expect it to answer that I don't know or that I don't have the information, but currently it returns results according to its knowledge. Can you help me solve this problem
Hello,
I'm trying to develop the following Python program that would hit the created Bot Service programmatically
import requests
import time
direct_line_secret = "XXXXX"
base_url = "https://directline.botframework.com/v3/directline"
# Start a conversation
start_conversation_url = f"{base_url}/conversations"
headers = {
"Authorization": f"Bearer {direct_line_secret}"
}
response = requests.post(start_conversation_url, headers=headers)
conversation_id = response.json()["conversationId"]
print('Converstion id:', conversation_id)
# Send a message to the bot
send_message_url = f"{base_url}/conversations/{conversation_id}/activities"
message = {
"type": "message",
"from": {"id": "user"},
"text": "what is Reinforcement Learning?"
}
response = requests.post(send_message_url, headers=headers, json=message)
print(response.status_code)
print(response.text)
# Poll for the bot's response
get_activities_url = f"{base_url}/conversations/{conversation_id}/activities"
while True:
response = requests.get(get_activities_url, headers=headers)
activities = response.json()["activities"]
print(activities)
for activity in activities[::-1]:
if activity["from"]["id"] == "bot_id": # Replace "your_bot_id" with the actual bot's ID
print("Bot's response:", activity["text"])
exit() # or break the loop if you only want the latest message
# Wait for a while before polling again
time.sleep(1)
However, it gives me Bot's response: To continue to run this bot, please fix the bot source code.
but Test in Web Chat works just fine. Also checking the logs I saw the following:
File "/tmp/8dbd09dbf228fa9/antenv/lib/python3.10/site-packages/botbuilder/core/middleware_set.py", line 79, in receive_activity_internal
return await callback(context)
File "/tmp/8dbd09dbf228fa9/antenv/lib/python3.10/site-packages/botbuilder/core/activity_handler.py", line 70, in on_turn
await self.on_message_activity(turn_context)
File "/tmp/8dbd09dbf228fa9/bot.py", line 74, in on_message_activity
input_text_metadata["local_timestamp"] = turn_context.activity.local_timestamp.strftime("%I:%M:%S %p, %A, %B %d of %Y")
AttributeError: 'NoneType' object has no attribute 'strftime'
Is there anything I'm doing wrong in the code and I do not pass the parameters correctly or there is an issue in bot's code?
On 01-Load-Data-ACogSearch.ypynb it mentions a credentials.py on the directory app:
"Create a data source
You should already have a blob container that contains the sample data, see app/credentials.py"
That file doesn't seem to be present anywhere.
Rest API call to create indexer in 01-Load-Data-ACogSearch.ipynb with the default arxivcs container with:
"error":{"code":"","message":"Error with data source: Credentials provided in the connection string are invalid or have expired.\r\nFor more information on troubleshooting connection issues to Azure Storage accounts, please see https://go.microsoft.com/fwlink/?linkid=2049388 Please adjust your data source definition in order to proceed."
Potentially a firewall issue but couldn't troubleshoot locally. SAS Token Auth also fails in Storage Explorer.
Hi,
I tried to deploy with the custom template to create all the Azure Infrastructure needed to run the Notebooks (Azure Cognitive Search, Cognitive Services, SQL Database, CosmosDB, Bing Search API), but I got the following error message.
"InvalidTemplateDeployment: The template deployment 'MicrosoftTemplate' is not valid according to the validation procedure. The tracking id is '2d765e2c-4e79-4062-a78a-c26e02d13xxx. See inner errors for details.
Does anyone have the same problem before? Thanks
Documentation says to update the /app/credentials.py file, but it is not there.
Can I run only note book 7 and deploy to check bing API.
What are the steps to do it.
As per ReadmMe it says it is built on running all the notebooks in order. Is it possible to deploy only notebook 7 features.
Please let me know what are the steps
I am able to run Notebook 7 on visual studio notebook.
But for testing purposes it need to be deployed right ? What is the procedure ?
Hi All,
Running 01-Lod-Data-AcogSearch.ipynb
AZURE_SEARCH_ENDPOINT = "" <= URL of Search Service
AZURE_SEARCH_KEY = " " <= Keys Manage admin keys
COG_SERVICES_NAME = "" <= name of search service, e.g cog-search-xxxx
COG_SERVICES_KEY = "" <= cog-search-xxxx , this is manage query keys
I have added like the above and
AttributeError Traceback (most recent call last)
Cell In[27], line 6
4 # pprint(json.dumps(r.json(), indent=1))
5 print(r.status_code)
----> 6 print("Status:",r.json().get('lastResult').get('status'))
7 print("Items Processed:",r.json().get('lastResult').get('itemsProcessed'))
8 print(r.ok)
AttributeError: 'NoneType' object has no attribute 'get'. anyone seen this erro ?
Trial 1: az webapp deployment, Git Actions, Local git
==> Got azure deploy deployment conflict (code: 409)
Trial 2: create template on portal
==> Got timeout
Test commit hash: 2c10f7b
:( Application Error
If you are the application administrator, you can access the diagnostic resources.
Hi Pablo, can you provide any guidance around how you configured the web app to structure and citate the URL for the sites in the ncbi data set? Also, if you have any guidance on how you built the CSV from the ncbi website. Looking to do something similar for ServiceNow KB articles. Any input would be greatly appreciated! Awesome project.
Hello Pablo ,
The demo app is down and doesnt open.
Thanks
While deploying earlier backend webapp was failing with container crash issue being exception: ModuleNotFoundError: No Module named ‘aiohttp’. When I redeployed again with python 3.10 this issue is resolved.
As of now container is not crashing and getting following warning:
File "/tmp/8db6d8a271372eb/antenv/lib/python3.10/site-packages/botbuilder/core/integration/aiohttp_channel_service_exception_middleware.py", line 20, in aiohttp_error_middleware
response = await handler(request)
File "/tmp/8db6d8a271372eb/antenv/lib/python3.10/site-packages/aiohttp/web_urldispatcher.py", line 931, in _handle
raise self._http_exception
aiohttp.web_exceptions.HTTPNotFound: Not Found
Task exception was never retrieved
future: exception=KeyError('access_token')>. These exceptions are coming from application. Any help in this regard would be much apprciated..Thanks:-)
Can you place add the slide deck in the link. It does not display any slides now
Hi can you please assist here where to make required change to make the POC functional for Audio file processing and recursive URL
I'm trying to deploy my backend and fronted webiste to Azure App Services and Bot Service, however, the frontend website was successfully deployed but the backend doesn't. The bakend is not wokring with error There was an error sending this message to your bot: HTTP status code NotFound
, it's both not working with Web Chat and Direct Line.
I've passed all the notebook files successfully but troubled while deploying to App Service, please help and thanks.
Great service, but looks like you're exposing your keys checking in credentials.py
Not data returned from Azure Search, check connection..
name 'content' is not defined
KeyError: 'chunk'
Traceback:
File "/tmp/8dbb8b7be883dca/antenv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/tmp/8dbb8b7be883dca/pages/1_Search.py", line 130, in
top_docs.append(Document(page_content=value["chunk"], metadata={"source": location+os.environ['BLOB_SAS_TOKEN']}))
When running notebook in my macbook pro locally, the code cell in notebook failed due to missing odbc driver. Suggest install driver up front prior to executing any cells.
I'm having an issue where the bot's answer is cut off even though it's not enough due to max_tokens being reached. I wanting the answer to only have max_tokens = 800. Please Can you support me in solving this problem?
Hey there 👋 Just wanted to let you know that your app on Streamlit Cloud deployed from this repo has gone over its resource limits. Access to the app is temporarily limited. Visit the app to see more details and possible solutions.
In the architecture diagram Bing search in added in the picture. Can you please point out where the code is included for Bing search
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.