To use the AssistDesk Worker, you need to install the dependencies and configure the environment variables.
Install the required dependencies using npm:
npm install
Set the following environment variables. Refer to sample.env for example values:
TZ: Timezone (e.g., Asia/Hong_Kong)PORT: Port number (e.g., 8080)APP: Application name (e.g., assistdesk-worker)APP_ID: Application ID (e.g., assistdesk-worker)APP_NAME: Application full name (e.g., Assistdesk Worker)HOST: Base URL (e.g., )NAMESPACE: Kubernetes namespace (e.g., system)IMAGE: Docker image tag (e.g., )ASSISTDESK_URL: AssistDesk server URL (e.g., )ASSISTANT_API_KEY: Assistant API key (e.g., )ASSISTANT_NAME: Assistant name (e.g., )LIVESERVER_URL: LiveServer URL (e.g., )CLIENT_ID: Client ID (e.g., )CLIENT_SECRET: Client secret (e.g., )CLIENT_ORIGIN: Client origin (e.g., )OPENWEBUI_API_KEY: OpenWebUI API key (e.g., )OPENWEBUI_ENDPOINT: OpenWebUI endpoint (e.g., )OPENWEBUI_MODEL: OpenWebUI model (e.g., gemma2:9b)LITELLM_API_KEY: LiteLLM API key (e.g., )LITELLM_ENDPOINT: LiteLLM endpoint (e.g., )LITELLM_MODEL: LiteLLM model (e.g., gemini-flash)OPENWEATHERMAP_API_KEY: OpenWeatherMap API key (e.g., )PYTHON_ENDPOINT: Local Python API endpoint (e.g., http://127.0.0.1:8001)UPLOAD_KEY: Upload key (e.g., )VERSIONNUMBER: Version number (e.g., 1.0.0)Once the dependencies are installed and the environment variables are configured, start the worker using the following command:
npm start
The AssistDesk Worker automatically subscribes to relevant channels on the LiveServer and handles incoming messages. It uses the Ollama API to generate responses and sends them back to the AssistDesk server.
To extend the chatbot's capabilities, you can modify the following:
Customize the OLLAMA_REQUEST_TEMPLATE environment variable to provide specific instructions or context to the Ollama API. This allows you to fine-tune the chatbot's behavior and responses.
Modify the convertToChatContext function in ollama.ts to include additional information or context that the chatbot should consider when generating responses. This could include user profiles, past conversations, or specific knowledge bases.
Extend the processMessage function in worker.ts to handle different message types or formats. This allows you to integrate new features like image recognition, sentiment analysis, or other advanced functionalities.
Contributions are welcome! Please open an issue or submit a pull request.
This software is proprietary and is the property of New Modern Technology. All rights reserved.