forked from gaomar/node-red-contrib-simple-gpt-vision
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnode.html
66 lines (64 loc) · 2.52 KB
/
node.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<script type="text/javascript">
RED.nodes.registerType('simple-gpt-vision',{
category: 'function',
color: '#FDD0A2',
defaults: {
name: {value: ""},
prompt:{value: "", validate: RED.validators.typedInput("promptType")},
promptType: {value: "str"},
Token:{value: "", required:true},
},
inputs:1,
outputs:1,
icon: "arrow-in.png",
label: function() {
return this.name||"simple-gpt-vision";
},
oneditprepare: function () {
$('#node-input-prompt').typedInput({
default: 'msg',
typeField: $("#node-input-promptType"),
types: ['msg', 'flow', 'global', 'str', 'jsonata']
});
}
});
</script>
<script type="text/html" data-template-name="simple-gpt-vision">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label style="padding-top: 8px" for="node-input-prompt"><i class="fa fa-ellipsis-h"></i> Prompt</label>
<input type="text" id="node-input-prompt">
<input type="hidden" id="node-input-promptType">
</div>
<div class="form-row">
<label for="node-input-Token">
<i class="icon-tag"></i>
OpenAI API Key
</label>
<input type="password" id="node-input-Token" placeholder="OpenAI API Key">
</div>
</script>
<script type="text/html" data-help-name="simple-gpt-vision">
<p>入力した画像の解析を行います。プロンプトに解析したい言葉を入力してください。</p>
<h3>入力</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">string</span>
</dt>
<dd> 解析する画像のURLかbase64形式を指定してください。</dd>
<dt class="optional">prompt <span class="property-type">string</span></dt>
<dd> 解析したいプロンプトを入力してください。<br/>例)何が写っている?</dd>
<dt class="optional">OpenAI API Key <span class="property-type">string</span></dt>
<dd> OpenAIのAPIキーです。</dd>
</dl>
<h3>出力</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">string</span>
</dt>
<dd> プロンプト内容に従って解析した結果を返します。 </dd>
</dl>
</script>