Skip to content

Commit a1da2f6

Browse files
committed
Add docs to InferenceContext
1 parent 2c12778 commit a1da2f6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/InferenceContext.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
import java.io.IOException;
1717

18-
// TODO: docs
18+
/**
19+
* Record for storing context alongside an inference request, typically used for metadata.
20+
* This is mainly used to pass along inference context on the transport layer without relying on {@link org.elasticsearch.common.util.concurrent.ThreadContext},
21+
* which depending on the internal {@link org.elasticsearch.client.internal.Client} throws away parts of the context, when passed along the transport layer.
22+
*
23+
* @param productUseCase - metadata for now mainly interesting for the Elastic Inference Service
24+
*/
1925
public record InferenceContext(String productUseCase) implements Writeable, ToXContent {
2026

2127
public InferenceContext(StreamInput in) throws IOException {

0 commit comments

Comments
 (0)