This video is quite insightful, Pamela. I appreciate the clear demonstration of Azure AI Search. It's similar in aim to tools like Myko Assistant, which can streamline information gathering significantly. I find its email-based request system makes the process so much more efficient.
when i type in chatbot it shows me following and can you tell me how it will be solve TypeError: Cannot read properties of undefined (reading 'content')
When I load >5 documents into the context, I get this error: openai.BadRequestError: Error code: 400 - {'error': {'message': "This model's maximum context length is 4096 tokens. However, you requested 5014 tokens (3514 in the messages, 1500 in the completion). Please reduce the length of the messages or completion.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}} I am using gpt-4o and do not understand this behaviour or how to fix tit. Can you help me?
Hi Pamel. What if we have millions of records each having vector of 1024 embeddings. How can we insert all these records efficiently in postgres. And how to keep table updated when embeddings change, i.e upsert operation on the table. A real life example might help your viewers more. Something like a table with vector(1024) column and inserting 10 million records in it and keeping it upto date with every run of the pipeline.
It depends on the SQL driver that I'm using. Django has a particular way to do token refresh, and SQLAlchemy has its own way. Django way: github.com/pamelafox/django-quiz-app/blob/main/src/quizsite/postgresql/base.py SQLALchemy way: github.com/Azure-Samples/rag-postgres-openai-python/blob/3c3d0d1d59ee4341d09e67e5f06dc38648e7ff5a/src/fastapi_app/postgres_engine.py#L37 I need to write this up in a blog post!
@@kalamkarsaurabh3 I think this article helps to explain when get_connections_params is called medium.com/django-unleashed/how-does-django-manage-db-connections-4c1a009cec91 I'm afraid I haven't found the original resource I was using when I implemented it.
Hey Pamela, is there a way to have indexes in vector DB (Search AI) for several pdfs so that users can choose which document it should search that info in?
You can have multiple indexes, but for users to select a document, I'd probably just use a field on the index, and use a AI Search filter expression to filter by the document's filename.
I am able to see deployment logs but unable to see python flask logs in app service. I am able to see print statement in the kudu logs. Application logging is enabled. I am able to see logs when I run locally. Could you please advice ?
@@PamelaFox Thank you for your reply. I read about this in a GitHub thread on AzureML, and this solution worked for me as well. " The issue is likely due to AzureML calling the "module level" logger during import, which creates the root logger and causes subsequent calls to logging.basicConfig to be ignored. To resolve this, you can: Run basicConfig before importing any AzureML library (e.g., any member of azureml.core). Alternatively, create a local logger with its own handler that does not propagate to the root logger created by AzureML. This is necessary if you want to change the formatting. " I tried running basicConfig before importing any Azure library and was able to see the logs in Kudu.
@@PamelaFox Thank you for your reply. I read about this in a GitHub thread on AzureML, and this solution worked for me as well. The issue is likely due to AzureML calling the "module level" logger during import, which creates the root logger and causes subsequent calls to logging.basicConfig to be ignored. To resolve this, you can: Run basicConfig before importing any AzureML library (e.g., any member of azureml.core). Alternatively, create a local logger with its own handler that does not propagate to the root logger created by AzureML. This is necessary if you want to change the formatting. I tried running basicConfig before importing any Azure library and was able to see the logs in Kudu.
@@PamelaFox Thank you for your reply. I read about this in a GitHub thread on AzureML, and this solution worked for me as well. The issue is likely due to AzureML calling the "module level" logger during import, which creates the root logger and causes subsequent calls to logging.basicConfig to be ignored. To resolve this, you can: Run basicConfig before importing any AzureML library (e.g., any member of azureml.core). Alternatively, create a local logger with its own handler that does not propagate to the root logger created by AzureML. This is necessary if you want to change the formatting. Otherwise, simply setting the logger level (e.g., logger.setLevel(logging.DEBUG)) should suffice. I tried running basicConfig before importing any Azure library and was able to see the logs in Kudu.
Very useful tips. Instead of LogStream in the Portal, I recommend using "az webapp log tail" and I also recommend "az webapp log download" instead of navigating to advanced tools.
Thank you sooo much!!! I did search for that so much but didn't find anything other than mocks. Yes, exactly that's why I didn't prefer lots of mocking.
Lol thats fine, theres a fine line between teaching/learning/doing. I figure lots of folks watching wont actually be teaching, given how few teachers there are in the world!
We just use the browser's built-in PDF viewing functionality. There was a PR once that added a specific package for viewing PDFs, but it added too much bloat to our bundle.
Thanks for the video. I've a question, how can I configure the project to use the gpt-35-turbo-instruct model? I tried to do it but it gives me a chatCompletion error, not a valid operation.
The gpt-35-turbo-instruct model does not support function calling, as far as I understand, so I'm guessing that's the error you're seeing. You can remove "tools" and "tool_choice" from the chat completion call and see if that fixes the error.
Hello Pamela, while searching for a pgvector tutorial, I came across your video recommendation. Typically, I rapidly scroll through content, seeking specific answers to my questions. However, your video proved so engaging that I watched it in its entirety, from start to finish. Thank you for your dedication and for creating such compelling content. Please continue to share your amazing videos!
great video! any thoughts on how we can convert the web app to an API? we would like to integrate it with other system that would feed prompt to API instead of web app. or is there a way to feed prompt to search service directly?
This app is structured to output a JSON API. You can see a description of the output format here: github.com/Azure-Samples/ai-chat-app-protocol The frontend sends user messages to that API, but you can send requests to it directly as well.
I've struggled to explain to folks about how vector semantic is different from text search.. finally found somone who explained this so clearly. Thanks, enjoyed this highly informative session.
Hi @PamelaFox is there a way to use this app with Azure AI api and not open AI. I do have an deployment of the Turbo GPT 3.5 and Ada002 in Azure and would like to use this with those api. Can you recommend how I can do this. This blocks me from using this app. I followed your other video on setting up the chat but it only shows Azure AI. Please recommend any alternative I only see these entries in setting for low cost Thanks for your help. . azd env set OPENAI_HOST openai azd env set OPENAI_ORGANIZATION {Your OpenAI organization} azd env set OPENAI_API_KEY {Your OpenAI API key}
Hm, I'm confused as to whether you're trying to use it with OpenAI.com or Azure OpenAI? We do support both. If it's not working, please file an issue in the repo where we have better support for code sharing.