赞
踩
将英文文本翻译成法文、西班牙文和日文。
将其翻译成 1. 法语,2. 西班牙语和 3. 日语:你们有哪些房间可用?1.
示例响应
Quels sont les chambres que vous avez disponibles?2. Qué habitaciones tienes disponibles?3.どの部屋ガ利用可能ですか?
Python
- import os
- import openai
-
- openai.api_key = os.getenv("OPENAI_API_KEY")
-
- response = openai.Completion.create(
- model="text-davinci-003",
- prompt="Translate this into 1. French, 2. Spanish and 3. Japanese:\n\nWhat rooms do you have available?\n\n1.",
- temperature=0.3,
- max_tokens=100,
- top_p=1.0,
- frequency_penalty=0.0,
- presence_penalty=0.0
- )
JavaScript
- const { Configuration, OpenAIApi } = require("openai");
-
- const configuration = new Configuration({
- apiKey: process.env.OPENAI_API_KEY,
- });
- const openai = new OpenAIApi(configuration);
-
- const response = await openai.createCompletion({
- model: "text-davinci-003",
- prompt: "Translate this into 1. French, 2. Spanish and 3. Japanese:\n\nWhat rooms do you have available?\n\n1.",
- temperature: 0.3,
- max_tokens: 100,
- top_p: 1.0,
- frequency_penalty: 0.0,
- presence_penalty: 0.0,
- });
- curl https://api.openai.com/v1/completions \
- -H "Content-Type: application/json" \
- -H "Authorization: Bearer $OPENAI_API_KEY" \
- -d '{
- "model": "text-davinci-003",
- "prompt": "Translate this into 1. French, 2. Spanish and 3. Japanese:\n\nWhat rooms do you have available?\n\n1.",
- "temperature": 0.3,
- "max_tokens": 100,
- "top_p": 1.0,
- "frequency_penalty": 0.0,
- "presence_penalty": 0.0
- }'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。