@@ -11,14 +11,14 @@ import { sleep, check } from 'k6'
11
11
const staging = 'http://gptwrapper.toska.svc.cluster.local:8000/api/ai/stream'
12
12
const local = 'http://172.17.0.1:3000/api//ai/stream'
13
13
14
+ // k6 will pickup the options object internally.
14
15
const vusit = 50
15
-
16
16
export const options = {
17
17
vus : vusit ,
18
18
iterations : vusit ,
19
19
}
20
20
21
- const headerParams = {
21
+ const headers = {
22
22
headers : {
23
23
'Content-Type' : 'application/json' ,
24
24
uid : 'testUser' ,
@@ -29,8 +29,6 @@ const headerParams = {
29
29
} ,
30
30
}
31
31
32
- const messages = [ 'listaa viisi esinettä' , 'kerro niistä jotain' , 'anna esimerkki jokaisesta esineestä' , 'kerro yksityiskohtaisemmin' , 'tiivistä kertomasi' ]
33
-
34
32
const data = {
35
33
options : {
36
34
messages : [ ] ,
@@ -44,6 +42,8 @@ const data = {
44
42
courseId : 'sandbox' ,
45
43
}
46
44
45
+ const messages = [ 'listaa viisi esinettä' , 'kerro niistä jotain' , 'anna esimerkki jokaisesta esineestä' , 'kerro yksityiskohtaisemmin' , 'tiivistä kertomasi' ]
46
+
47
47
function handleTokens ( tokenizedStr ) {
48
48
let texts = [ ]
49
49
let responseId = ''
@@ -83,7 +83,7 @@ export default function () {
83
83
data : JSON . stringify ( newData ) ,
84
84
} )
85
85
86
- let res = http . post ( url , payload , headerParams )
86
+ let res = http . post ( url , payload , headers )
87
87
const { response, responseId } = handleTokens ( res . body )
88
88
prevResponseId = responseId
89
89
0 commit comments