-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JS] feat: Updates to OpenAIModel and OpenAIEmbeddings classes. (#1541)
## Linked issues closes: #1201 ## Details These changes update the `OpenAIModel` and `OpenAIEmbeddings` classes to support recent parameter changes by OpenAI. They also add support for calling other OpenAI compliant services like [LLaMA.cpp](https://github.com/ggerganov/llama.cpp/blob/master/examples/server/README.md). #### Change details - Added new `OpenAILikeModelOptions` interface and updated `OpenAIModel` class to conditionally send an Authorization header to the model server. - Updated `BaseOpenAIModelOptions` interface and `OpenAIModel` class to support OpenAI's `response_format` parameter. - Updated `BaseOpenAIModelOptions` interface and `OpenAIModel` class to support OpenAI's `seed` parameter. - Added new `OpenAILikeEmbeddingOptions` interface and updated `OpenAIEmbeddingl` class to conditionally send an Authorization header to the model server. - Updated `BaseOpenAIEmbeddingOptions` interface and `OpenAIEmbeddings` class to support OpenAI's new `dimension` parameter. - Tweaked documentation comment for embeddings class. ## Attestation Checklist - [ x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes --------- Co-authored-by: Corina <[email protected]>
- Loading branch information
Showing
3 changed files
with
105 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters