Skip to content

Commit

Permalink
feat: add bedrock runtime agent for knowledge base (opensearch-projec…
Browse files Browse the repository at this point in the history
…t#2651) (opensearch-project#2669)

* add bedrock runtime agent for knowledge base

Signed-off-by: yuye-aws <[email protected]>

* update unit test

Signed-off-by: yuye-aws <[email protected]>

---------

Signed-off-by: yuye-aws <[email protected]>
(cherry picked from commit 226e53f)

Co-authored-by: yuye-aws <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and yuye-aws authored Jul 18, 2024
1 parent 71296b1 commit c8545e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ public void validateConnectorURL_Invalid() {
HttpConnector connector = createHttpConnector();
connector.validateConnectorURL(Arrays.asList("^https://runtime\\.sagemaker\\..*[a-z0-9-]\\.amazonaws\\.com/.*$",
"^https://api\\.openai\\.com/.*$",
"^https://api\\.cohere\\.ai/.*$"));
"^https://api\\.cohere\\.ai/.*$",
"^https://bedrock-agent-runtime\\\\..*[a-z0-9-]\\\\.amazonaws\\\\.com/.*$"
));
}

@Test
public void validateConnectorURL() {
HttpConnector connector = createHttpConnector();
connector.validateConnectorURL(Arrays.asList("^https://runtime\\.sagemaker\\..*[a-z0-9-]\\.amazonaws\\.com/.*$",
"^https://api\\.openai\\.com/.*$",
"^https://bedrock-agent-runtime\\\\..*[a-z0-9-]\\\\.amazonaws\\\\.com/.*$",
"^" + connector.getActions().get(0).getUrl()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ private MLCommonsSettings() {}
"^https://runtime\\.sagemaker\\..*[a-z0-9-]\\.amazonaws\\.com/.*$",
"^https://api\\.openai\\.com/.*$",
"^https://api\\.cohere\\.ai/.*$",
"^https://bedrock-runtime\\..*[a-z0-9-]\\.amazonaws\\.com/.*$"
"^https://bedrock-runtime\\..*[a-z0-9-]\\.amazonaws\\.com/.*$",
"^https://bedrock-agent-runtime\\..*[a-z0-9-]\\.amazonaws\\.com/.*$"
),
Function.identity(),
Setting.Property.NodeScope,
Expand Down

0 comments on commit c8545e5

Please sign in to comment.