diff --git a/common/changes/@visactor/vmind/docs-demo-openai-header_2024-06-03-08-17.json b/common/changes/@visactor/vmind/docs-demo-openai-header_2024-06-03-08-17.json new file mode 100644 index 00000000..9f9d6260 --- /dev/null +++ b/common/changes/@visactor/vmind/docs-demo-openai-header_2024-06-03-08-17.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vmind", + "comment": "send authorization header when use openai models", + "type": "none" + } + ], + "packageName": "@visactor/vmind" +} \ No newline at end of file diff --git a/common/changes/@visactor/vmind/docs-demo-openai-header_2024-07-03-02-55.json b/common/changes/@visactor/vmind/docs-demo-openai-header_2024-07-03-02-55.json new file mode 100644 index 00000000..0945a5c3 --- /dev/null +++ b/common/changes/@visactor/vmind/docs-demo-openai-header_2024-07-03-02-55.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vmind", + "comment": "set all headers in all cases", + "type": "none" + } + ], + "packageName": "@visactor/vmind" +} \ No newline at end of file diff --git a/common/changes/@visactor/vmind/docs-demo-openai-header_2024-07-03-03-05.json b/common/changes/@visactor/vmind/docs-demo-openai-header_2024-07-03-03-05.json new file mode 100644 index 00000000..3ef3b3d9 --- /dev/null +++ b/common/changes/@visactor/vmind/docs-demo-openai-header_2024-07-03-03-05.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vmind", + "comment": "add bearer header in smart insight page", + "type": "none" + } + ], + "packageName": "@visactor/vmind" +} \ No newline at end of file diff --git a/packages/vmind/__tests__/browser/src/pages/ChartGeneration/DataInput.tsx b/packages/vmind/__tests__/browser/src/pages/ChartGeneration/DataInput.tsx index 0616c943..50bd9c9a 100644 --- a/packages/vmind/__tests__/browser/src/pages/ChartGeneration/DataInput.tsx +++ b/packages/vmind/__tests__/browser/src/pages/ChartGeneration/DataInput.tsx @@ -122,6 +122,8 @@ export function DataInput(props: IPropsType) { cache, showThoughts: showThoughts, headers: { + //must has Authorization: `Bearer ${openAIKey}` if use openai api + Authorization: `Bearer ${apiKey}`, 'api-key': apiKey } }); diff --git a/packages/vmind/__tests__/browser/src/pages/Insight/DataInput.tsx b/packages/vmind/__tests__/browser/src/pages/Insight/DataInput.tsx index 8b89b781..d20d6e98 100644 --- a/packages/vmind/__tests__/browser/src/pages/Insight/DataInput.tsx +++ b/packages/vmind/__tests__/browser/src/pages/Insight/DataInput.tsx @@ -90,6 +90,7 @@ export function DataInput(props: IPropsType) { cache, showThoughts: showThoughts, headers: { + Authorization: `Bearer ${apiKey}`, 'api-key': apiKey } });