GPT4Free auf Deutsch stellen?
import discord
from discord.ext import commands
from g4f.client import Client
import nest_asyncio
nest_asyncio.apply()
client = Client()
intents = discord.Intents.all()
intents.messages = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'Angemeldet als {bot.user}')
@bot.command()
async def ask(ctx, *, question):
try:
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": question}],
)
await ctx.send(response.choices[0].message.content.strip())
except Exception as e:
await ctx.send(f"An error occurred: {e}")
Das ist mein Code und ich bekomme ihn ihrgendwie nicht auf Deutsch die Antworten auf AI sind alle Auf Chinesisch.. kann mir da jemand helfen?
1 Antwort
![](https://images.gutefrage.net/media/user/MasterFAQ/1719096606429_nmmslarge__0_0_1024_1024_3ee6d102f9fff3b8eb89a9336cca61ab.webp?v=1719096606000)
import discord
from discord.ext import commands
from g4f.client import Client
import nest_asyncio
nest_asyncio.apply()
client = Client()
intents = discord.Intents.all()
intents.messages = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'Angemeldet als {bot.user}')
@bot.command()
async def ask(ctx, *, question):
try:
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": f"Antwort auf Deutsch: {question}"}],
)
await ctx.send(response.choices[0].message.content.strip())
except Exception as e:
await ctx.send(f"Ein Fehler ist aufgetreten: {e}")
bot.run('DEIN DISCORD TOKEN ')