Skip to content

Commit

Permalink
b
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Dec 25, 2023
1 parent 44cea56 commit 133c96f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 180 deletions.
94 changes: 0 additions & 94 deletions backend/files/misc/workflows/actions/chatgpt-context.hl

This file was deleted.

86 changes: 0 additions & 86 deletions backend/files/misc/workflows/actions/chatgpt-instructions.hl

This file was deleted.

30 changes: 30 additions & 0 deletions backend/files/misc/workflows/actions/chatgpt.hl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
type:int
mandatory:bool:true
default:int:1500
instruction
type:textarea
mandatory:bool:false
context
type:textarea
mandatory:bool:false
prompt
type:textarea
mandatory:bool:true
Expand All @@ -36,6 +42,30 @@ set-value:x:@.token
.:"Bearer "
config.get:"magic:openai:key"

// Checking if caller provided a [context].
if
exists:x:@.arguments/*/context
.lambda

// Adding [context].
insert-before:x:../*/http.post/*/payload/*/messages/0
.
.
role:user
content:x:@.arguments/*/context

// Checking if caller provided an [instruction].
if
exists:x:@.arguments/*/instruction
.lambda

// Adding [instruction].
insert-before:x:../*/http.post/*/payload/*/messages/0
.
.
role:system
content:x:@.arguments/*/instruction

// Invokes OpenAI.
http.post:"https://api.openai.com/v1/chat/completions"
convert:bool:true
Expand Down

0 comments on commit 133c96f

Please sign in to comment.