akshata29 / entaoai Goto Github PK
View Code? Open in Web Editor NEWChat and Ask on your own data. Accelerator to quickly upload your own enterprise data and use OpenAI services to chat to that uploaded data and ask questions
License: MIT License
Chat and Ask on your own data. Accelerator to quickly upload your own enterprise data and use OpenAI services to chat to that uploaded data and ask questions
License: MIT License
Do you know what I can enable to have the bot give creative answers? I tried changing the temperature, but if i ask question like "Can you create a poem based on the summary of the knowledge base" it is not able to. I changed the prompt in chatpdf/api/Python/ChatGpt/init.py but didn't get any results back.
Do I have to use a different chain from Langchain? I want chatpdf to do something like what this is doing: https://www.chatpdf.com/
Thank you so much!
I tried to proceed with the deployment today, and it returned the following error message.
{"code":"InvalidTemplateDeployment","details":[{"code":"DeploymentModelNotSupported","message":"Creating account deployment is not supported by the model 'text-davinci-003'. This is usually because there are better models available for the similar functionality."}],"message":"The template deployment 'Microsoft.Template-20230710120955' is not valid according to the validation procedure. The tracking id is 'af2ae21d-44e5-4cf7-a186-32577951880f'. See inner errors for details."}
Checked through the following link and found that there was a Model change.
https://learn.microsoft.com/en-us/azure/cognitive-services/openai/concepts/models
I'd like to ask you to change code.
In the setup the link under Test Website returns an empty page.
Following the steps, I receive the same blank page in my own deployments.
Hi, thanks for sharing your project with us. I tried to clone, and deploy the project by following commands of azd init, azd up. And I can access my app main page. But I noticed not all resources are fully deployed. For instance if I open main.bicep and go end of line, we see:
Which means only app service plan, app service, function app, cognitive search, two storage accounts, and Azure openai services are created. Is there anyway that I could make sure all resources are fully deployed?
Best
There was an error during the deployment process.
What is somthing wrong??
{"code":"DeploymentFailed","target":"/subscriptions/xxxx369f-3d6e-4c3f-87f4-83c1cca16cb5/resourceGroups/chatnanet/providers/Microsoft.Resources/deployments/Microsoft.Template-20230628194148","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"target":"/subscriptions/xxxx369f-3d6e-4c3f-87f4-83c1cca16cb5/resourceGroups/chatnanet/providers/Microsoft.Resources/deployments/Microsoft.Template-20230628194148","message":"Encountered an error (InternalServerError) from host runtime."}]}
Drill down issue.
{"code":"BadRequest","message":"Encountered an error (InternalServerError) from host runtime.","details":[{"message":"Encountered an error (InternalServerError) from host runtime."},{"code":"BadRequest"},{}]}
{
"status": "Failed",
"error": {
"code": "BadRequest",
"message": "Encountered an error (InternalServerError) from host runtime.",
"details": [
{
"message": "Encountered an error (InternalServerError) from host runtime."
},
{
"code": "BadRequest"
},
{}
]
}
}
Upon trying to redeploy after receiving the error mentioned in #26 I am now getting this validation error:
{"code":"InvalidTemplateDeployment","details":[{"code":"InsufficientQuota","message":"The specified capacity '120' of account deployment is bigger than available capacity '0' for UsageName 'Tokens Per Minute (thousands) - GPT-35-Turbo'."}],"message":"The template deployment 'Microsoft.Template-20230630090235' is not valid according to the validation procedure. The tracking id is '072a60c3-87f9-4f1e-95e3-f4a259595e09'. See inner errors for details."}
Any advice?
I am unable to access the test website, the error is shown below:
Request Id: 78953c7f-0344-4f83-b341-6518c8143001
Correlation Id: be6d5db1-d5fb-4e2a-ab79-0b4057d8e053
Timestamp: 2023-08-08T22:24:35Z
Message: AADSTS50020: User account '[email protected]' from identity provider 'live.com' does not exist in tenant 'Contoso' and cannot access the application 'cbbe9727-b1ae-4fae-a6c7-656f3643721f'(dataaipdfchatauth) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account.
Hi, I setup Form recognizer endpoint and key within local.settings.json, however I am getting the below error:
No connection adapters were found for '/formrecognizer/documentModels/prebuilt-layout:analyze?stringIndexType=unicodeCodePoint&api-version=2022-08-31'
I appreciate your support.
So I am based in Seoul, South Korea. I know Azure OpenAI/OpenAI resources are only based in US/Europe and not Asia yet, but for people in US East/US Central are you guys experiencing high latency or long time to respond?
For me i brought Azure resources that i can and Pinecone to Korea Central, but I am wondering @akshata29 what are some other things or ideas you can think of that I can do to speed things up on my end? Not taking cost into a factor. I just want chatpdf to run fast like https://chatpdf.com/
Thank you!!
Any chance to revise the codebase to upgrade the chat model/s to GPT-4?
Using the deploy script, and button in the Documentation, I cannot get a clean deploy. One to two resources fail to deploy every time. It's not always the same resources, but typically it's one of the chat model deployments.
The typical error is 'Conflict' but occasionally 'Bad Request'
Is there a best practice for getting this to deploy with the script?
Hi,
I just looked at the azure documentation, and found this : https://learn.microsoft.com/en-us/azure/ai-services/language-service/overview
it states that: This Language service unifies the following previously available Azure AI services: Text Analytics, QnA Maker, and LUIS.
I was wondering if you could please change or guide us how to refine azure deploy template.
When i deploy the template on azure, it gives the following error
{"code":"InvalidTemplateDeployment","details":[{"code":"DeploymentModelNotSupported","message":"The model 'Format: OpenAI, Name: embedding, Version: 2, Source: ' of account deployment is not supported."}],"message":"The template deployment 'Microsoft.Template-20230809000923' is not valid according to the validation procedure. The tracking id is 'd3e1e7eb-221a-4e44-a8f1-5a7583a5f191'. See inner errors for details."}
I'm receiving the following error when processing documents. This is seemingly related to Form Recognizer, regardless if I use it or not.
Exception while executing function: Functions.DocGenerator <--- Result: Failure Exception: ModuleNotFoundError: No module named 'azure.ai'. Please check the requirements.txt file for the missing module. For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 374, in _handle__function_load_request func = loader.load_function( File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 48, in call raise extend_exception_message(e, message) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 44, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py", line 132, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/site/wwwroot/DocGenerator/__init__.py", line 28, in <module> from Utilities.formrecognizer import analyze_layout, chunk_paragraphs File "/home/site/wwwroot/Utilities/formrecognizer.py", line 1, in <module> from azure.ai.formrecognizer import DocumentAnalysisClient
I can successfully upload a PDF. I can see the file in the container.
However...
In the search service no index exists and no PDFs exist in the drop down in the Developer settings.
No errors listed in AppInsights.
Any suggestions as to where to start to look?
Hi,
I have deployed the solutions with azure cli directly into Azure. Everything worked fine, but the frontend was not deployed. As described in the section on how to deploy it manually to Azure, is it necessary to build the React frontend and deploy it manually?
Cheers
It appears that when uploading multiple files using Cognitive Services only the first file is indexed. All of the uploaded files successfully make it into the chatpdf container but the index only contains references to the first document.
Hi, I had a situation when I used chat tab to have conversation with my document. After having first conversation interaction, if I ask a follow-up question, the history of chat is not being used. I think it might be due to not considering history in the override prompts section (only {summaries} and {question} are used):
Thanks for this effort! Is it okay to remove the dead code in the project so it is easier to navigate?
Thank you.
I installed the required programmes on Windows 10 21H2 x64 and executed the source code.
Everything was executed normally until the azd up command, but when accessing the Backend Endpoint created in Azure apps, the following error is returned.
"Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
C:\Users\niceysj\repo\chatgptspk\chatpdf>azd up
Packaging services (azd package)
(✓) Done: Packaging service backend
Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time
You can view detailed progress in the Azure Portal:
https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2F3e5e369f-3d6e-4c3f-87f4-83c1cca16cb5%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fchatgptspk
(✓) Done: Resource group: chatspk
(✓) Done: Application Insights: chatspkappisg
(✓) Done: App Service plan: chatspkasp
(✓) Done: Storage account: chatspkstor
(✓) Done: Storage account: chatspkfuncsa
(✓) Done: Function App: chatspkfunc
(✓) Done: Search service: chatspkazs
(✓) Done: Azure OpenAI: chatspkoai
(✓) Done: App Service: chatspkbackend
Executing predeploy hook => C:\Users\niceysj\AppData\Local\Temp\azd-predeploy-1027173797.ps1
npm WARN deprecated [email protected]: Package moved to @redux-devtools/extension.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
added 589 packages, and audited 590 packages in 1m
59 packages are looking for funding
run npm fund
for details
2 high severity vulnerabilities
To address all issues, run:
npm audit fix
Run npm audit
for details.
[email protected] build
tsc && vite build --mode prod
vite v4.1.1 building for prod...
✓ 2703 modules transformed.
../backend/static/index.html 0.46 kB
../backend/static/assets/github-fab00c2d.svg 0.96 kB
../backend/static/assets/index-d593fb67.css 16.45 kB │ gzip: 2.90 kB
../backend/static/assets/index-4215e6c8.js 1,185.83 kB │ gzip: 348.14 kB │ map: 10,008.16 kB
(!) Some chunks are larger than 500 kBs after minification. Consider:
Deploying services (azd deploy)
(✓) Done: Deploying service backend
(✓) Done: Deploying service functionapp
SUCCESS: Your Azure app has been deployed!
You can view the resources created under the resource group chatspk in Azure Portal:
https://portal.azure.com/#@/resource/subscriptions/3e5e369f-3d6e-4c3f-87f4-83c1cca16cb5/resourceGroups/chatspk/overview
C:\Users\niceysj\repo\chatgptspk\chatpdf>npm audit fix
added 93 packages, and audited 94 packages in 3s
12 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
Hello, can it be built with docker? any guide please Thank you
Hey is there a way i can ask questions and get answers back in Korean? Regardless whether the document is Korean or not?
Clade is AI by Anthropic
Receiving this, even though I do not have any of these on my account:
{"code":"InvalidTemplateDeployment","details":[{"code":"CanNotCreateMultipleFreeAccounts","message":"Operation failed. Only one free account is allowed for account type 'SpeechServices'."}],"message":"The template deployment 'Microsoft.Template-20230630082430' is not valid according to the validation procedure. The tracking id is '33b77277-8d6f-4e4d-9f05-b37eb40b9d98'. See inner errors for details."}
Any thoughts on how to pursue?
Hello @akshata29
Thanks share your repo
When i tested it, it show two error like below.
In "LLMOps with Promptflow"
Run pushd './Workshop'
~/work/entaoai/entaoai/Workshop ~/work/entaoai/entaoai
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/promptflow/azure/_restclient/flow_service_caller.py", line 447, in submit_bulk_run
return self.caller.bulk_runs.submit_bulk_run(
File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
return func(*args, **kwargs)
File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/promptflow/azure/_restclient/flow/operations/_bulk_runs_operations.py", line 402, in submit_bulk_run
raise HttpResponseError(response=response, model=error)
azure.core.exceptions.HttpResponseError: (UserError) Flow Runtime operation failed with Forbidden: User with objectId(83668576-fa46-4741-95a2-14aa89fa3604) is not authorized to invoke this runtime as the runtime compute instance entaoai is assigned to 18e9cadb-9f0e-449d-997f-ca14e7edf65d.
Code: UserError
Message: Flow Runtime operation failed with Forbidden: User with objectId(83668576-fa46-4741-95a2-14aa89fa3604) is not authorized to invoke this runtime as the runtime compute instance entaoai is assigned to 18e9cadb-9f0e-449d-997f-ca14e7edf65d.
In "LLMOps Deploy with Promptflow"
Run pushd './Workshop'
~/work///Workshop ~/work//
ERROR: (LinkedInvalidPropertyId) Property id '' at path '' is invalid. Expect fully qualified resource Id that start with '/subscriptions/subscriptionId' or '/providers/resourceProviderNamespace/'.
Code: LinkedInvalidPropertyId
Message: Property id '' at path '' is invalid. Expect fully qualified resource Id that start with '/subscriptions/subscriptionId' or '/providers/resourceProviderNamespace/'.
Error: Process completed with exit code 1.
Sorry bother you
Hi @akshata29,
I see litellm got merged here #39
But I see it got removed here - 04c45e5.
What was missing for it to be useful? Any feedback here would be helpful.
Hi @akshata29,
Thanks for using LiteLLM.
I'm one of the co-maintainers. How can we make it better for you?
Can I please ask for a support how to solve it?
I tried with north europe and east US, for both regions I get the same error.
Best
How can i upload my person PDF files to test this? When I go to the upload feature, it is asking me for a password
2.error message: Another operation is being performed on the parent resource '/subscriptions/9dabf3b5-95af-489f-8423-ae43e4b1707c/resourceGroups/rg-aoai-chatpdf/providers/Microsoft.CognitiveServices/accounts/kevingptaoai'. Please try again later. (Code: RequestConflict)
it seems can not deploy the 3 model: chat, davinci and text-embedding-ada-002 in parallel.
refer to this blog: https://techcommunity.microsoft.com/t5/azure-database-support-blog/add-wait-operation-to-arm-template-deployment/ba-p/2915342#:~:text=How%20can%20an%20ARM%20JSON%20template%20be%20forced,to%20set%20the%20dependencies%20of%20the%20steps%20correctly
I can fix this error such as:
{ "type": "Microsoft.CognitiveServices/accounts/deployments", "apiVersion": "2022-12-01", "name": "[concat(variables('aoaiSvcName'), '/chat')]", "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', variables('aoaiSvcName'))]" ], "properties": { "model": { "format": "OpenAI", "name": "gpt-35-turbo", "version": "0301" }, "scaleSettings": { "scaleType": "Standard" }, "raiPolicyName": "Microsoft.Default" } }, { "type": "Microsoft.Resources/deploymentScripts", "apiVersion": "2020-10-01", "kind": "AzurePowerShell", "name": "Wait5s", "location": "[parameters('location')]", "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', variables('aoaiSvcName'))]" ], "properties": { "azPowerShellVersion": "9.7", "scriptContent": "start-sleep -Seconds 5", "cleanupPreference": "Always", "retentionInterval": "PT1H" } }, { "type": "Microsoft.CognitiveServices/accounts/deployments", "apiVersion": "2022-12-01", "name": "[concat(variables('aoaiSvcName'), '/davinci')]", "dependsOn": [ "[resourceId('Microsoft.Resources/deploymentScripts','Wait5s')]" ], "properties": { "model": { "format": "OpenAI", "name": "text-davinci-003", "version": "1" }, "scaleSettings": { "scaleType": "Standard" }, "raiPolicyName": "Microsoft.Default" } }, { "type": "Microsoft.Resources/deploymentScripts", "apiVersion": "2020-10-01", "kind": "AzurePowerShell", "name": "Wait10s", "location": "[parameters('location')]", "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', variables('aoaiSvcName'))]" ], "properties": { "azPowerShellVersion": "9.7", "scriptContent": "start-sleep -Seconds 10", "cleanupPreference": "Always", "retentionInterval": "PT1H" } }, { "type": "Microsoft.CognitiveServices/accounts/deployments", "apiVersion": "2022-12-01", "name": "[concat(variables('aoaiSvcName'), '/text-embedding-ada-002')]", "dependsOn": [ "[resourceId('Microsoft.Resources/deploymentScripts','Wait10s')]" ], "properties": { "model": { "format": "OpenAI", "name": "text-embedding-ada-002", "version": "2" }, "scaleSettings": { "scaleType": "Standard" }, "raiPolicyName": "Microsoft.Default" } }
Thanks!
Kevin
Running locally and then uploading the document does not upload the file to Azure Blob storage.
I modified the following values in the "local.setting.json" file as guided.
"OpenAiDocStorName": "chatspkstor", // Storage name
"OpenAiDocStorKey": "AzureStorageAccount Access Key value", // Storage doc
"OpenAiDocContainer": "chatpdf", // Storage Container
Also modified .env file.
I tried replacing the Connection String with the value generated by the Blob Shared Access Key policy, but it doesn't work the same.
BLOB_CONNECTION_STRING="https://chatspkstor.blob.core.windows.net/" # Name of your Blob connection string where you will upload PDF to
BLOB_CONTAINER_NAME="chatpdf" # Name of your container to host uploaded files
===============================================================================
Traceback (most recent call last):
File "c:\Users\niceysj\repo\chatgptspk\chatpdf\app\backend\app.py", line 234, in uploadBinaryFile
blobServiceClient = BlobServiceClient.from_connection_string(url)
File "C:\Users\niceysj\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\storage\blob_blob_service_client.py", line 181, in from_connection_string account_url, secondary, credential = parse_connection_str(conn_str, credential, 'blob')
File "C:\Users\niceysj\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\storage\blob_shared\base_client.py", line 406, in parse_connection_str
raise ValueError("Connection string missing required connection details.")
ValueError: Connection string missing required connection details.
127.0.0.1 - - [15/Apr/2023 15:21:55] "POST /uploadBinaryFile HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [15/Apr/2023 15:21:55] "POST /uploadBinaryFile HTTP/1.1" 500 -
ERROR:root:Exception in /processDoc
Traceback (most recent call last):
File "c:\Users\niceysj\repo\chatgptspk\chatpdf\app\backend\app.py", line 163, in processDoc
jsonDict = json.loads(resp.text)
File "C:\Users\niceysj\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\niceysj\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\niceysj\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
127.0.0.1 - - [15/Apr/2023 15:21:58] "POST /processDoc HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [15/Apr/2023 15:21:58] "POST /processDoc HTTP/1.1" 500 -
I've done a few deploys with the automation scripts previously, however all of a sudden I'm getting the following when attempting to run:
{"code":"InvalidTemplate","message":"Deployment template validation failed: 'Circular dependency detected on resource: '/subscriptions/MYSUBSCRIPTIONID/resourceGroups/rcshrchatdemo/providers/Microsoft.Web/sites/rcshrchatfunc'. Please see https://aka.ms/arm-syntax-resources for usage details.'."}
I've tried numerous Resource Group Name and Prefix combinations. I've ensured all my other deploys where cleanly deleted. And have updated my fork with the latest here.
Not sure what else to try.
Could you please add an environment variable to enable switching between the Azure and OpenAI APIs? Thank you.
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.