質問編集履歴
2
コードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -53,4 +53,32 @@
|
|
53
53
|
|
54
54
|
### 補足情報(FW/ツールのバージョンなど)
|
55
55
|
|
56
|
+
function gpt_3() {
|
57
|
+
var uri = 'https://api.openai.com/v1/engines/davinci/completions';
|
58
|
+
|
59
|
+
var options = {
|
60
|
+
"method":"post",
|
61
|
+
"Content-type": "application/json",
|
62
|
+
"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
63
|
+
"payload": JSON.stringify(json)
|
64
|
+
};
|
65
|
+
|
66
|
+
var json = {
|
67
|
+
"id": "cmpl-GERzeJQ4lvqPk8SkZu4XMIuR",
|
68
|
+
"object": "text_completion",
|
69
|
+
"created": 1586839808,
|
70
|
+
"model": "davinci:2020-05-03",
|
71
|
+
"choices": [{
|
72
|
+
"text": " of reading speed. You",
|
56
|
-
|
73
|
+
"index": 0,
|
74
|
+
"logprobs": null,
|
75
|
+
"finish_reason": "length"
|
76
|
+
}]
|
77
|
+
}
|
78
|
+
|
79
|
+
UrlFetchApp.fetch(uri, {"json": json, "headers": options});
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
に変更したところ、Exception: Attribute provided with invalid value: Header:null
|
84
|
+
とエラーが出て進めなくなりました。
|
1
画像の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,6 +14,12 @@
|
|
14
14
|

|
15
15
|

|
16
16
|
|
17
|
+
Node.js用のチュートリアルがありましたが、GASでの応用の仕方がわかりませんでした。
|
18
|
+
https://www.twilio.com/blog/getting-started-with-openai-s-gpt-3-in-node-js
|
19
|
+

|
20
|
+
|
21
|
+
|
22
|
+
|
17
23
|
### 該当のソースコード
|
18
24
|
|
19
25
|
```javascript
|