wingbot 3.58.0 → 3.58.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.58.0",
3
+ "version": "3.58.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -70,10 +70,10 @@ function chatgptPlugin (params, configuration = {}) {
70
70
  const useFetch = params.fetch || fetch;
71
71
 
72
72
  const apiUrl = openAiEndpoint
73
- ? `${openAiEndpoint}`
74
- : 'https://api.openai.com/v1';
73
+ ? `${openAiEndpoint}/chat/completions?api-version=2023-03-15-preview`
74
+ : 'https://api.openai.com/v1/chat/completions';
75
75
 
76
- const response = await useFetch(`${apiUrl}/chat/completions`, {
76
+ const response = await useFetch(apiUrl, {
77
77
  method: 'POST',
78
78
  headers: {
79
79
  'Content-Type': 'application/json',
@@ -90,7 +90,9 @@ function chatgptPlugin (params, configuration = {}) {
90
90
  || !Array.isArray(data.choices)) {
91
91
  const { status, statusText } = response;
92
92
  // eslint-disable-next-line no-console
93
- console.log('chat gpt error', { status, statusText, data });
93
+ console.log('chat gpt error', {
94
+ status, statusText, data, apiUrl
95
+ });
94
96
  throw new Error(`Chat GPT ${status}`);
95
97
  }
96
98