Commit 7abbaf0
[8.x] [Inference API] Add unified api for chat completions (elastic#117589) (elastic#118772)
* [Inference API] Add unified api for chat completions (elastic#117589)
* Adding some shell classes
* modeling the request objects
* Writeable changes to schema
* Working parsing tests
* Creating a new action
* Add outbound request writing (WIP)
* Improvements to request serialization
* Adding separate transport classes
* separate out unified request and combine inputs
* Reworking unified inputs
* Adding unsupported operation calls
* Fixing parsing logic
* get the build working
* Update docs/changelog/117589.yaml
* Fixing injection issue
* Allowing model to be overridden but not working yet
* Fixing issues
* Switch field name for tool
* Add suport for toolCalls and refusal in streaming completion
* Working tool call response
* Separate unified and legacy code paths
* Updated the parser, but there are some class cast exceptions to fix
* Refactoring tests and request entities
* Parse response from OpenAI
* Removing unused request classes
* precommit
* Adding tests for UnifiedCompletionAction Request
* Refactoring stop to be a list of strings
* Testing for OpenAI response parsing
* Refactoring transport action tests to test unified validation code
* Fixing various tests
* Fixing license header
* Reformat streaming results
* Finalize response format
* remove debug logs
* remove changes for debugging
* Task type and base inference action tests
* Adding openai service tests
* Adding model tests
* tests for StreamingUnifiedChatCompletionResultsTests toXContentChunked
* Fixing change log and removing commented out code
* Switch usage to accept null
* Adding test for TestStreamingCompletionServiceExtension
* Avoid serializing empty lists + request entity tests
* Register named writeables from UnifiedCompletionRequest
* Removing commented code
* Clean up and add more of an explination
* remove duplicate test
* remove old todos
* Refactoring some duplication
* Adding javadoc
* Addressing feedback
---------
Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Jonathan Buttner <[email protected]>
(cherry picked from commit 467fdb8)
# Conflicts:
# x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceCrudIT.java
# x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportInferenceAction.java
* fix merge conflicts
* formatting
* Remove tests - retain feature flag
* [CI] Auto commit changes from spotless
---------
Co-authored-by: elasticsearchmachine <[email protected]>1 parent 0a599f9 commit 7abbaf0
File tree
106 files changed
+5500
-875
lines changed- docs/changelog
- server/src/main/java/org/elasticsearch
- common/xcontent
- inference
- test
- framework/src/main/java/org/elasticsearch/test
- test-clusters/src/main/java/org/elasticsearch/test/cluster
- x-pack/plugin
- core/src
- main/java/org/elasticsearch/xpack/core/inference
- action
- results
- test/java/org/elasticsearch/xpack/core
- inference
- action
- results
- security/authz/store
- inference
- qa
- inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference
- test-service-plugin/src/main/java/org/elasticsearch/xpack/inference/mock
- src
- main/java/org/elasticsearch/xpack/inference
- action
- common
- external
- action
- openai
- http/sender
- openai
- request
- googleaistudio
- openai
- rest
- services
- alibabacloudsearch
- amazonbedrock
- anthropic
- azureaistudio
- azureopenai
- cohere
- elasticsearch
- elastic
- googleaistudio
- googlevertexai
- huggingface
- elser
- ibmwatsonx
- mistral
- openai
- completion
- test/java/org/elasticsearch/xpack/inference
- action
- external
- action
- amazonbedrock
- anthropic
- azureaistudio
- azureopenai
- cohere
- googleaistudio
- openai
- amazonbedrock
- http/sender
- openai
- request
- googleaistudio/completion
- openai
- rest
- services
- openai
- completion
- security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
106 files changed
+5500
-875
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
115 | 132 | | |
116 | 133 | | |
117 | 134 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
0 commit comments