Skip to content

Commit

Permalink
Change to use OpenAI connector
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <wonglam@amazon.com>
  • Loading branch information
wanglam committed Mar 19, 2024
1 parent b52e911 commit a98ed5d
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions cypress/integration/plugins/ml-commons-dashboards/overview_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,28 +143,35 @@ if (Cypress.env('ML_COMMONS_DASHBOARDS_ENABLED')) {
version: '1.0.0',
description: 'test model',
connector: {
name: 'sagemaker: embedding',
description: 'Test connector for Sagemaker embedding model',
name: 'OpenAI embedding Connector',
description:
'The connector to public OpenAI model service for GPT 3.5',
version: 1,
protocol: 'aws_sigv4',
credential: {
access_key: '...',
secret_key: '...',
session_token: '...',
},
protocol: 'http',
parameters: {
region: 'us-west-2',
service_name: 'sagemaker',
endpoint: 'api.openai.com',
auth: 'API_Key',
content_type: 'application/json',
max_tokens: 7,
temperature: 0,
model: 'text-embedding-ada-002',
},
credential: {
openAI_key: 'xxx',
},
actions: [
{
action_type: 'predict',
method: 'POST',
url: 'https://${parameters.endpoint}/v1/embeddings',
pre_process_function: 'connector.pre_process.openai.embedding',
post_process_function:
'connector.post_process.openai.embedding',
headers: {
'content-type': 'application/json',
Authorization: 'Bearer ${credential.openAI_key}',

Check failure

Code scanning / CodeQL

Hard-coded credentials Critical

The hard-coded value "Bearer ${credential.openAI_key}" is used as
authorization header
.
},
url: 'https://runtime.sagemaker.us-west-2.amazonaws.com/endpoints/lmi-model-2023-06-24-01-35-32-275/invocations',
request_body: '["${parameters.inputs}"]',
request_body:
'{ "model": "${parameters.model}", "input": ${parameters.input}}',
},
],
},
Expand Down

0 comments on commit a98ed5d

Please sign in to comment.