Closed LLMR-boringtao closed 4 months ago
Hey there, @LLMR-boringtao! Fancy seeing you here again. How's everything going on your end?
Based on the information you've provided, it seems like you're having trouble previewing your Dify agent locally after building it. To better assist you, I'll need a bit more information about the issue you're experiencing.
Could you please provide the exact error message or behavior you're observing when trying to preview the agent at the provided localhost URL? This will help me understand what might be going wrong.
What version of Dify are you currently using? This is important as different versions might have different requirements or known issues.
Could you confirm that you've followed the correct process to build the agent in Dify? Based on the repository, the process should involve choosing the application type, accessing Dify, navigating to Prompt Engineering, setting up prefix prompts, using variables, adjusting model parameters, and finally publishing the application. You can find more details about this process in the Dify documentation.
Have you executed the necessary steps and commands to preview the agent locally? This includes cloning the repository, starting middleware services, setting up the Python environment, navigating to the "api" directory, starting the Worker service for asynchronous tasks, deploying the frontend page, and accessing the locally deployed Dify. More details about these steps can be found in the Dify documentation.
Lastly, are there any specific error logs or console outputs that can provide more information about the issue? The error_code
and description
fields in each class can give a clear indication of what went wrong. You can find more details about this in the Dify source code.
Once I have this information, I'll be better equipped to help you troubleshoot the issue.
Please provide more information, such as why and what did you get, better with some information from the web console.
Hi, Craztwoola @crazywoola
I followed exactly the same steps as I built on the Dify platform, on which once I build the agent, I click on the preview button, such as https://udify.app/chat/oFSTZX2eKGBAFSR, I can chat with the agent. On the other hand, on my local Mac, after the agent has been built and running successfully, I click on the preview, which is http://localhost/chat/sg52MLhzqyztDjKj, it open a webpage showing "cannot connect to server", nothing shown on the docker terminal.
Thanks!
@crazywoola
Then I try customising steps using the following parameters:
NEXT_PUBLIC_APP_ID='2546cdfa-7d77-4748-a287-82acd37fe12b'
NEXT_PUBLIC_APP_KEY='app-ZAuvFOZL2ZNKuVA77NAyAngt'
NEXT_PUBLIC_API_URL='http://localhost/v1'
Then after I nom run dev, and open localhost:3000, it shows: 500 App is unavailable. I confirm the DIFY backend is up running and working properly.
@crazywoola
Then I try customising steps using the following parameters:
APP ID
NEXT_PUBLIC_APP_ID='2546cdfa-7d77-4748-a287-82acd37fe12b'
APP API key
NEXT_PUBLIC_APP_KEY='app-ZAuvFOZL2ZNKuVA77NAyAngt'
API url prefix
NEXT_PUBLIC_API_URL='http://localhost/v1'
Then after I nom run dev, and open localhost:3000, it shows: 500 App is unavailable. I confirm the DIFY backend is up running and working properly.
"cannot connect to server" this means there is something wrong in your configuration file. And above codes are not relevant at all.
Hi, Craztwoola @crazywoola
I followed exactly the same steps as I built on the Dify platform, on which once I build the agent, I click on the preview button, such as https://udify.app/chat/oFSTZX2eKGBAFSR, I can chat with the agent. On the other hand, on my local Mac, after the agent has been built and running successfully, I click on the preview, which is http://localhost/chat/sg52MLhzqyztDjKj, it open a webpage showing "cannot connect to server", nothing shown on the docker terminal.
Thanks!
And this should be a frontend error, in this case, you need paste the information from the web console.
Self Checks
Provide a description of the help you need
Dify admin planner works properly on local. However, once I built an agent. I cannot preview it, such as using http://localhost/chat/sg52MLhzqyztDjKj
Anyone can help? Thanks!