top of page

Long-term benefits of clean energy sources

Kim Jennings

2023年3月20日

This is placeholder text. To change this content, double-click on the element and click Change Content.

This is placeholder text. To change this content, double-click on the element and click Change Content. Want to view and manage all your collections? Click on the Content Manager button in the Add panel on the left. Here, you can make changes to your content, add new fields, create dynamic pages and more.

Your collection is already set up for you with fields and content. Add your own content or import it from a CSV file. Add fields for any type of content you want to display, such as rich text, images, and videos. Be sure to click Sync after making changes in a collection, so visitors can see your newest content on your live site.

bottom of page
import { fetch } from 'wix-fetch'; // OpenAI APIのエンドポイントとAPIキーを設定します const API_KEY = 'YOUR_API_KEY'; // OpenAIから取得したAPIキーを入力してください const API_URL = 'https://api.openai.com/v1/engines/davinci/completions'; // GPT-3 APIリクエストを処理する関数 export function getGPTResponse(prompt) { return fetch(API_URL, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${API_KEY}` }, body: JSON.stringify({ prompt: prompt, max_tokens: 100 // 必要に応じてトークンの数を調整します }) }) .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); }) .then(data => data.choices[0].text) .catch(error => { console.error('There was a problem with the fetch operation:', error); return 'Error occurred while fetching response.'; }); }