Exception Handling in a Web Project
Exception handling is a common function in a web project. In this post, I will cover the basic principles of how to do exception handling in a web project.
Exception handling is a common function in a web project. In this post, I will cover the basic principles of how to do exception handling in a web project.
Preventing duplicate submissions is a common function in a web project. In this post, I will cover the principle of the implementation of preventing duplicate submissions.
java.util.Date is in core java API since Java 1.0. And it is not recommended for use. If you are using Java 8 or a later version, it is better to use java.time.LocalDate and java.time.Instant, which were introduced in Java 8.
In this post, I will cover common operations related to datetime.
In this post, I will cover the performance optimization for the entire process of web applications, including the frontend, backend, networking, and web server.
Add watermark
document.getElementsByTagName('body')[0].style.backgroundImage = 'url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' version=\'1.1\' height=\'100px\' width=\'100px\'><text transform=\'translate(20, 100) rotate(-30)\' fill=\'rgba(128,128,128, 0.3)\' font-size=\'20\' >watermark</text></svg>")'; |
const div = document.createElement("div"); |
Docker has been blocked in China since June 6, 2024. In this post, I will cover how to use docker in China.
lobe-chat is a open-source project for build an AI client. It supports multiple AI providers, such as OpenAI, Claude 3, Gemini and more. It offers several useful features, including Local Large Language Model (LLM) support, Model Visual Recognition, TTS & STT Voice Conversation, Text to Image Generation, Plugin System (Function Calling), Agent Market (GPTs), Progressive Web App (PWA), Mobile Device Adaptation, and Custom Themes.
# Always pull the latest Docker image before running |
You can also fork the lobe-chat project and deploy it to Vercel.
The API key is a required property that must be set.
If you set the OPENAI_API_KEY environment variable when you start the project, you can use the chatbot application directly. lobe-chat will not show an error or prompt you to set an API key. If you want to authenticate users, you can set the ACCESS_CODE environment variable.
If you don’t set the environment variables OPENAI_API_KEY and ACCESS_CODE when you start the project, lobe-chat will show an error on the web page and prompt you to set an API key. You can also set an API key in the settings page before using the chatbot.
Set Default Agent
Model Settings
Set an API proxy
If you need to use the OpenAI service through a proxy, you can configure the proxy address using the OPENAI_PROXY_URL environment variable:
-e OPENAI_PROXY_URL=https://my-api-proxy.com/v1 |
If you want to use a localhost proxy
-e OPENAI_PROXY_URL=http://localhost:18080/v1 \ |
or
# connect to proxy Docker container |