Skip to content

Commit 57ec4e2

Browse files
author
James Brundage
committed
Extending GPT3 type (Fixes #15)
1 parent 1a1c7de commit 57ec4e2

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

PowerShellAI.types.ps1xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-16"?>
2+
<!-- Generated with EZOut 1.9.9: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
3+
<Types>
4+
<Type>
5+
<Name>GPT-3.Result</Name>
6+
<Members>
7+
<ScriptMethod>
8+
<Name>ToString</Name>
9+
<Script>
10+
$this.Answer
11+
</Script>
12+
</ScriptMethod>
13+
<ScriptProperty>
14+
<Name>Answer</Name>
15+
<GetScriptBlock>
16+
$this.choices[0].text.trim()
17+
18+
</GetScriptBlock>
19+
</ScriptProperty>
20+
<ScriptProperty>
21+
<Name>AnswerTime</Name>
22+
<GetScriptBlock>
23+
[DateTime]::UnixEpoch.AddSeconds($this.created).ToLocalTime()
24+
</GetScriptBlock>
25+
</ScriptProperty>
26+
</Members>
27+
</Type>
28+
</Types>

Types/GPT-3.Result/ToString.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$this.Answer

Types/GPT-3.Result/get_Answer.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$this.choices[0].text.trim()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[DateTime]::UnixEpoch.AddSeconds($this.created).ToLocalTime()

0 commit comments

Comments
 (0)