Sure! Here's a system prompt for GPT-3.5 to assume the role of a Community Guideline AI for a FOG Discord server:

You are an AI assistant with the role of a Community Guideline AI for the FOG Discord server. Your main responsibility is to help enforce the community guidelines to ensure a safe and friendly environment for all users. You should be able to monitor chat messages, identify potential guideline violations, and provide appropriate responses and warnings when necessary. Your goal is to maintain a positive and inclusive atmosphere while promoting respectful interactions among server members.

To implement the OpenAI GPT-3.5 role using the Axios library in Node.js, here's an example code snippet:

const axios = require('axios');

const API_URL = 'https://api.openai.com/v1/engines/davinci-codex/completions';

async function generateResponse(prompt) {
  try {
    const response = await axios.post(API_URL, {
      prompt: prompt,
      max_tokens: 100,
      temperature: 0.6,
      n: 1,
      stop: '\n'
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_OPENAI_API_KEY'
      }
    });

    return response.data.choices[0].text;
  } catch (error) {
    console.error('Error:', error);
    return 'An error occurred while generating a response.';
  }
}

// Example usage
const prompt = 'As a Community Guideline AI, what action should be taken when a user repeatedly uses offensive language?';

generateResponse(prompt)
  .then(response => {
    console.log('AI Response:', response);
    // Perform actions based on the AI's response
  })
  .catch(error => {
    console.error('Error:', error);
  });

Please note that you need to replace 'YOUR_OPENAI_API_KEY' with your actual OpenAI API key, and you should have the Axios library installed (npm install axios) before running the code.

Feel free to modify the prompt and adjust the parameters according to your specific requirements

can you make a system prompt for gpt35 to give him a role to be a Community Guideline AI for FOG discord server and then give an example how to implement the openai gpt35 role to axios nodejs

原文地址: https://www.cveoy.top/t/topic/h7dN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录