Skip to content
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

Inference task type endpoints #3545

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
1,709 changes: 1,072 additions & 637 deletions output/schema/schema.json

Large diffs are not rendered by default.

192 changes: 116 additions & 76 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions specification/_json_spec/inference.chat_completion_inference.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"inference.chat_completion_unified": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/chat-completion-inference.html",
"description": "Perform chat completion inference"
},
"stability": "stable",
"visibility": "public",
"headers": {
"accept": ["text/event-stream"],
"content_type": ["application/json"]
},
"url": {
"paths": [
{
"path": "/_inference/chat_completion/{inference_id}/_unified",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be _stream

Suggested change
"path": "/_inference/chat_completion/{inference_id}/_unified",
"path": "/_inference/chat_completion/{inference_id}/_stream",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it does have _unified at the end. I think technically we could remove it since the client code doesn't need the results to be in a specific format for SSE.

"methods": ["POST"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
}
]
},
"body": {
"description": "The inference payload"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.inference": {
"inference.completion": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
"description": "Perform inference"
"description": "Perform completion inference"
},
"stability": "stable",
"visibility": "public",
Expand All @@ -13,28 +13,14 @@
"url": {
"paths": [
{
"path": "/_inference/{inference_id}",
"path": "/_inference/completion/{inference_id}",
"methods": ["POST"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
},
{
"path": "/_inference/{task_type}/{inference_id}",
"methods": ["POST"],
"parts": {
"task_type": {
"type": "string",
"description": "The task type"
},
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
}
]
},
Expand Down
31 changes: 31 additions & 0 deletions specification/_json_spec/inference.rerank.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"inference.rerank": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
"description": "Perform reranking inference"
},
"stability": "stable",
"visibility": "public",
"headers": {
"accept": ["application/json"],
"content_type": ["application/json"]
},
"url": {
"paths": [
{
"path": "/_inference/rerank/{inference_id}",
"methods": ["POST"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
}
]
},
"body": {
"description": "The inference payload"
}
}
}
Loading
Loading