Next, in the previous article, we create a new agent in dify.
We open our deployed dify homepage and click to create a blank application.
We randomly select one, defaulting to the first, the chat assistant.
Fill in the relevant information, then click create.
Next, we make relevant settings for this demo, such as prompts, llm configuration, etc.
We directly choose ollama, but you can also choose others, such as chatgpt, grok, etc.
Set up ollama by selecting llm, filling in the url, adding the model, and then clicking save.
At this point, there may be a brief lag, but it’s fine; just wait for it to add successfully. Does that url look familiar? Port 8434, yes, that's right after opening it.
The url that prompts "Ollama is running"
On the successful addition page, a model list will appear.
Close the dialog box; at this point, it prompts that there is a problem with the model.
Click 1, then click 2, and select the ollama model we just added.
Modify parameters according to your needs; I set the temperature to the default 0.8.
Then proceed to debug.
I used the official prompts from deepseek.
After debugging, we can make some functional settings; the functions are in the bottom right corner.
Which functions to enable depends on personal needs.
After completing the settings, we click the close button in the top right corner.
Once done, we click the publish button in the top right corner to publish.
After successful publishing, how do we embed it into a webpage?
Click the small arrow next to the publish button and select "Embed on Website."
Based on the style layout, we choose the appropriate layout.
Note the URL here; they are actually incorrect and need to be modified to:
http://80.app.cloudstudio.work/
Change to:
https://evwewc-tzfevj-80.app.cloudstudio.work/
For example, the original web page.
Let's see the effect by embedding it into this page; we click to start chatting.
Look at the prompt.
At this point, the first dify application has been successfully set up.
Note here, the api address recognized by dify is incorrect.
Dify recognizes: http://80.app.cloudstudio.work/v1
While the actual address is the one in the red box above: https://evwewc-tzfevj-80.app.cloudstudio.work/v1