-
Notifications
You must be signed in to change notification settings - Fork 186
Accept passthrough headers in agent execute #4364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Accept passthrough headers in agent execute #4364
Conversation
Zhangxunmt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spotless needs to apply
55ee4c9 to
856c4fa
Compare
856c4fa to
acac26b
Compare
4327051 to
c14d0c5
Compare
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/AgentUtils.java
Outdated
Show resolved
Hide resolved
...lgorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/McpConnectorExecutor.java
Outdated
Show resolved
Hide resolved
...main/java/org/opensearch/ml/engine/algorithms/remote/McpStreamableHttpConnectorExecutor.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jiaping Zeng <[email protected]>
Signed-off-by: Jiaping Zeng <[email protected]>
c14d0c5 to
d4c2179
Compare
Signed-off-by: Jiaping Zeng <[email protected]>
Signed-off-by: Jiaping Zeng <[email protected]>
Signed-off-by: Jiaping Zeng <[email protected]>
| public static final String DEFAULT_DATETIME_PREFIX = "Current date and time: "; | ||
| private static final ZoneId UTC_ZONE = ZoneId.of("UTC"); | ||
|
|
||
| public static Map<String, String> extractRequestHeaders(Client client) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Are we planning to extract any other headers than MCP_REQUEST_HEADERS_THREAD_CONTEXT_KEY in this method if future? If not, suggest to rename the name to be more specific to this use case.
| private static final String HEADER_FAS_SECRET_KEY = "x-amzn-fas-secretkey"; | ||
| private static final String HEADER_FAS_SESSION_TOKEN = "x-amzn-fas-sessiontoken"; | ||
| private static final String HEADER_DATASOURCES = "x-amzn-datasources"; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change it to x-amzn-datasource-endpoint and add a new header x-amzn-datasource-type
Description
Create MCP client on each execute request + forward headers to MCP connector
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Accepted headers:
Sample request:
Response: