Reward Loyaltyドキュメント

AI Support Documentation

The script provides AI capabilities for users with the Partner role. For supported text fields, an AI button is available:

AI Support

Supported API Providers

The system supports multiple AI providers:

  • OpenAI API (GPT models)
  • DeepSeek API
  • Local LM Studio Server

Configuration

To enable AI features, modify the .env file in your website's root directory.

OpenAI Configuration

# OpenAI configuration
OPENAI_ENABLED=true
OPENAI_API_KEY="your-api-key"
OPENAI_MODEL="gpt-3.5-turbo"
OPENAI_BASE_URL="https://api.openai.com/v1"

DeepSeek Configuration

# DeepSeek configuration
OPENAI_ENABLED=true
OPENAI_API_KEY="DeepSeek-API-key"
OPENAI_MODEL="deepseek-chat"
OPENAI_BASE_URL="https://api.deepseek.com"
OPENAI_API_URL="https://api.deepseek.com"

Local LM Studio Configuration

# LM Studio local server configuration
OPENAI_ENABLED=true
OPENAI_API_KEY="lm-studio"
OPENAI_BASE_URL="http://localhost:1234/v1"

OpenAI API Setup

To obtain an OpenAI API key:

  1. Create Account: Visit OpenAI and create an account or sign in
  2. Access API Section: Navigate to the API section in your account dashboard
  3. Generate Key: Create a new API key and name it for your reference
  4. Save Key: Copy and securely store your API key
  5. Configure: Add the key to your .env file as shown in the configuration section

Available OpenAI Models

OpenAI provides several models with different capabilities and pricing:

  1. GPT Models

    • gpt-4o: Latest flagship model with 128k context window
    • gpt-4: Legacy GPT-4 model with 8k context window
    • gpt-3.5-turbo: Legacy model (recommended to use gpt-4o-mini instead)
    • Best for: Various use cases from complex reasoning to everyday tasks
  2. GPT-3.5 Series

    • gpt-3.5-turbo: Balanced model for general use
    • Best for: Most general applications and day-to-day tasks

LM Studio Setup

LM Studio enables local AI model deployment for testing and development.

Installation Steps

  1. Download: Get LM Studio from lmstudio.ai
  2. Install: Run the installer for your operating system
  3. Launch: Start LM Studio after installation

Configuration Steps

  1. Select Model: Download your preferred language model (e.g., Meta-Llama-3-8B-Instruct-Q4_K_M.gguf)
  2. Start Server:
    • Open LM Studio
    • Navigate to 'Local Server' tab
    • Click "Start Server"
  3. Configure Environment: Update your .env file with the LM Studio configuration shown above

DeepSeek Integration

DeepSeek provides an alternative API compatible with the OpenAI format.

Key Features

  • Compatible with OpenAI-style prompts
  • Alternative pricing structure
  • Different model specializations

Setup Steps

  1. Register: Create an account at DeepSeek's platform
  2. Generate API Key: Obtain your DeepSeek API key
  3. Configure: Add the DeepSeek configuration to your .env file as shown above

Troubleshooting

Common issues and solutions:

  1. API Connection Errors

    • Verify API key is correctly copied
    • Check network connectivity
    • Ensure BASE_URL is correctly formatted
  2. Model Loading Issues

    • Confirm model name matches exactly
    • Verify API provider supports the selected model
    • Check for sufficient system resources
  3. LM Studio Connection

    • Verify local server is running
    • Check port 1234 is available
    • Ensure no firewall blocking