We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0927f0b commit f80fdbbCopy full SHA for f80fdbb
backend/files/system/openai/magic.startup/magic.ai.get-context.hl
@@ -31,6 +31,17 @@ slots.create:magic.ai.get-context
31
convert:x:@.arguments/*/threshold
32
type:double
33
34
+ // Making sure we don't overflow model's context window.
35
+ if
36
+ mt
37
+ openai.tokenize:x:@.arguments/*/prompt
38
+ .:int:8100
39
+ .lambda
40
+ set-value:x:@.arguments/*/prompt
41
+ strings.substring:x:@.arguments/*/prompt
42
+ .:int:0
43
+ .:int:16000
44
+
45
// Retrieving embeddings.
46
.token
47
set-value:x:@.token
0 commit comments