Skip to content

Commit

Permalink
Add client_config parameter documentation (#6746)
Browse files Browse the repository at this point in the history
* add client_config parameter documentation

Signed-off-by: Dhrubo Saha <[email protected]>

* added hidden agent doc

Signed-off-by: Dhrubo Saha <[email protected]>

* removing extra character

Signed-off-by: Dhrubo Saha <[email protected]>

* addressed comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressed comment

* addressed comments

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
  • Loading branch information
dhrubo-os authored Mar 21, 2024
1 parent b5cbc7e commit c5df18a
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 28 deletions.
50 changes: 48 additions & 2 deletions _ml-commons-plugin/agents-tools/agents-tools-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ To test the LLM, send the following predict request:
POST /_plugins/_ml/models/NWR9YIsBUysqmzBdifVJ/_predict
{
"parameters": {
"prompt": "\n\nHuman:hello\n\nnAssistant:"
"prompt": "\n\nHuman:hello\n\nAssistant:"
}
}
```
Expand Down Expand Up @@ -354,4 +354,50 @@ Therefore, the population increase of Seattle from 2021 to 2023 is 58,000."""
}
]
}
```
```

## Hidden agents
**Introduced 2.13**
{: .label .label-purple }

To hide agent details from end users, including the cluster admin, you can register a _hidden_ agent. If an agent is hidden, non-superadmin users don't have permission to call any [Agent APIs]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agent-apis/index/) except for the [Execute API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agent-apis/execute-agent/), on the agent.

Only superadmin users can register a hidden agent. To register a hidden agent, you first need to authenticate with an [admin certificate]({{site.url}}{{site.baseurl}}/security/configuration/tls/#configuring-admin-certificates):

```bash
curl -k --cert ./kirk.pem --key ./kirk-key.pem -XGET 'https://localhost:9200/.opendistro_security/_search'
```

All agents created by a superadmin user are automatically registered as hidden. To register a hidden agent, send a request to the `_register` endpoint:

```bash
curl -k --cert ./kirk.pem --key ./kirk-key.pem -X POST 'https://localhost:9200/_plugins/_ml/models/_register' -H 'Content-Type: application/json' -d '
{
"name": "Test_Agent_For_RAG",
"type": "flow",
"description": "this is a test agent",
"tools": [
{
"name": "vector_tool",
"type": "VectorDBTool",
"parameters": {
"model_id": "zBRyYIsBls05QaITo5ex",
"index": "my_test_data",
"embedding_field": "embedding",
"source_field": [
"text"
],
"input": "${parameters.question}"
}
},
{
"type": "MLModelTool",
"description": "A general tool to answer any question",
"parameters": {
"model_id": "NWR9YIsBUysqmzBdifVJ",
"prompt": "\n\nHuman:You are a professional data analyst. You will always answer question based on the given context first. If the answer is not directly shown in the context, you will analyze the data and find the answer. If you don't know the answer, just say don't know. \n\n Context:\n${parameters.vector_tool.output}\n\nHuman:${parameters.question}\n\nAssistant:"
}
}
]
}'
```
Loading

0 comments on commit c5df18a

Please sign in to comment.