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

[ML] Adding docs for the unified inference API #118696

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jonathan-buttner
Copy link
Contributor

This PR adds docs for the new unified inference API. I tried to cover the more complicated objects with examples.

@jonathan-buttner jonathan-buttner added >docs General docs changes :ml Machine learning Team:ML Meta label for the ML team v9.0.0 v8.18.0 labels Dec 13, 2024
Copy link
Contributor

Documentation preview:

@@ -63,4 +63,44 @@ Specifies the chunking strategy.
It could be either `sentence` or `word`.
end::chunking-settings-strategy[]

tag::unified-schema-content-with-examples[]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I import this a couple times for each of the messages since they all have the same format (string or an array of objects).

The text content.
+
Object representation:::
`text`::::
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We get lucky that each of the messages has content:: so the colons work out here to nest it correctly.

(Optional, array of objects)
A list of tools that the model can call.
+
.Structure
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm open to other names here? Maybe Format?

(Required unless `tool_calls` is specified, string or array of objects)
The contents of the message.
+
include::inference-shared.asciidoc[tag=unified-schema-content-with-examples]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I personally find it helpful if examples are sprinkled throughout the docs as we're reading instead of just include complete ones at the bottom. I'm open to other suggestions here.

------------------------------------------------------------
// TEST[skip:TBD]

<1> Each tool call needs a corresponding Tool message.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this is too OpenAI specific to include?

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/docs

@jonathan-buttner jonathan-buttner marked this pull request as ready for review December 13, 2024 21:22
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine elasticsearchmachine added the Team:Docs Meta label for docs team label Dec 13, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/docs

@jonathan-buttner jonathan-buttner added the auto-backport Automatically create backport pull requests when merged label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >docs General docs changes :ml Machine learning Team:Docs Meta label for docs team Team:ML Meta label for the ML team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants