File size: 1,346 Bytes
fa0d88a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
async function query(data) {
    const response = await fetch(
        "https://cloud.flowiseai.com/api/v1/prediction/a5bdff45-1ec4-4ab0-a58b-f39b423f1a05",
        {
            headers: {
                Authorization: "Bearer 3yPns_cUcWpdEGc9bXZ4iA2JM-ZxZZVH8MLf1DuztS8",
                "Content-Type": "application/json"
            },
            method: "POST",
            body: JSON.stringify(data)
        }
    );
    const result = await response.json();
    return result;
}

query({"question": "Hey, how are you?"}).then((response) => {
    console.log(response);
});
async function query(data) {
    const response = await fetch(
        "https://cloud.flowiseai.com/api/v1/prediction/a5bdff45-1ec4-4ab0-a58b-f39b423f1a05",
        {
            headers: {
                Authorization: "Bearer 3yPns_cUcWpdEGc9bXZ4iA2JM-ZxZZVH8MLf1DuztS8",
                "Content-Type": "application/json"
            },
            method: "POST",
            body: JSON.stringify(data)
        }
    );
    const result = await response.json();
    return result;
}

query({
  "question": "Hey, how are you?",
  "overrideConfig": {
      "aiName": "example",
      "aiRole": "example",
      "maxLoop": 1,
      "openAIApiKey": "example",
  }
}).then((response) => {
    console.log(response);
});