-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Ml api Spec , /connector/_register and /connector/{connector_id} with test Signed-off-by: Junwei Dai <[email protected]> * Add Ml api Spec , /agents/_register and /agents/{agent_id} with test Signed-off-by: Junwei Dai <[email protected]> * fix: agent_id error Signed-off-by: Junwei Dai <[email protected]> * Update CHANGELOG.md Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]> Signed-off-by: Junwei Dai <[email protected]> * Readded empty line Signed-off-by: Junwei Dai <[email protected]> --------- Signed-off-by: Junwei Dai <[email protected]> Signed-off-by: Junwei Dai <[email protected]> Co-authored-by: Junwei Dai <[email protected]> Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
- Loading branch information
1 parent
2487252
commit c6c0c41
Showing
5 changed files
with
320 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the register of Agents. | ||
distributions: | ||
excluded: | ||
- amazon-managed | ||
- amazon-serverless | ||
version: '>= 2.11' | ||
epilogues: | ||
- path: /_plugins/_ml/agents/{agent_id} | ||
method: DELETE | ||
status: [200, 404] | ||
parameters: | ||
agent_id: ${register_agent.test_agent_id} | ||
chapters: | ||
- synopsis: Register agent. | ||
warnings: | ||
multiple-paths-detected: false | ||
id: register_agent | ||
path: /_plugins/_ml/agents/_register | ||
method: POST | ||
request: | ||
payload: | ||
name: Test_Agent_For_RAG | ||
type: flow | ||
description: this is a test agent | ||
tools: | ||
- type: VectorDBTool | ||
parameters: | ||
model_id: YOUR_TEXT_EMBEDDING_MODEL_ID | ||
index: my_test_data | ||
embedding_field: embedding | ||
source_field: | ||
- text | ||
input: test_question | ||
- type: MLModelTool | ||
description: A general tool to answer any question | ||
parameters: | ||
model_id: YOUR_LLM_MODEL_ID | ||
response: | ||
status: 200 | ||
output: | ||
test_agent_id: payload.agent_id | ||
- synopsis: Delete agent. | ||
path: /_plugins/_ml/agents/{agent_id} | ||
method: DELETE | ||
parameters: | ||
agent_id: ${register_agent.test_agent_id} | ||
response: | ||
status: 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the creation of connectors. | ||
distributions: | ||
excluded: | ||
- amazon-managed | ||
- amazon-serverless | ||
version: '>= 2.11' | ||
epilogues: | ||
- path: /_plugins/_ml/connectors/{connector_id} | ||
method: DELETE | ||
status: [200, 404] | ||
parameters: | ||
connector_id: ${create_connector.test_connector_id} | ||
chapters: | ||
- synopsis: Create connector. | ||
warnings: | ||
multiple-paths-detected: false | ||
id: create_connector | ||
path: /_plugins/_ml/connectors/_create | ||
method: POST | ||
request: | ||
payload: | ||
name: OpenAI Chat Connector | ||
description: The connector to public OpenAI model service for GPT 3.5 | ||
version: 1 | ||
protocol: http | ||
parameters: | ||
endpoint: api.openai.com | ||
model: gpt-3.5-turbo | ||
credential: | ||
openAI_key: test_api_key | ||
actions: | ||
- action_type: predict | ||
method: POST | ||
url: 'https://${parameters.endpoint}/v1/chat/completions' | ||
headers: | ||
Authorization: 'Bearer ${credential.openAI_key}' | ||
request_body: '{ "model": "${parameters.model}", "messages": ${parameters.messages} }' | ||
response: | ||
status: 200 | ||
output: | ||
test_connector_id: payload.connector_id | ||
- synopsis: Delete connector. | ||
path: /_plugins/_ml/connectors/{connector_id} | ||
method: DELETE | ||
parameters: | ||
connector_id: ${create_connector.test_connector_id} | ||
response: | ||
status: 200 |