This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.talk10 { | |
margin-bottom: 10px; | |
} | |
.talk10 figure img { | |
width: 100%; | |
height: 100%; | |
border: 2px solid #9ce191; /* 円の線の太さと色の設定 */ | |
border-radius: 50%; | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OpenAI = require('openai') | |
const API_KEY = 'YOUR_OPENAPI_TOKEN' | |
const openai = new OpenAI({ | |
apiKey: API_KEY | |
}); | |
const getChatResponse = async (text) => { | |
const chatCompletion = await openai.chat.completions.create({ | |
model: "gpt-3.5-turbo", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OpenAI = require('openai') | |
const API_KEY = 'YOUR_OPENAPI_TOKEN' | |
const openai = new OpenAI({ | |
apiKey: API_KEY | |
}); | |
const getChatResponse = async (text) => { | |
const chatCompletion = await openai.chat.completions.create({ | |
model: "gpt-3.5-turbo", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
import time | |
from botocore.exceptions import ClientError | |
# DynamoDBテーブル名 | |
table_name = 'PageViews' | |
# DynamoDBクライアントのセットアップ | |
dynamodb = boto3.client('dynamodb') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//ここのurlをlambda関数URLに書き換える | |
let lambdaUrl = 'https://yourlambdaurlcomeshere.lambda-url.ap-northeast-1.on.aws/' | |
//ページの表示回数を数える | |
fetch(lambdaUrl, { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'text/plain', | |
}, |