generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update Azure OpenAI types (#141)
* update types * zod generated schema * fix: Changes from lint * fix type test * adjust public api check * remove zod * Revert "remove zod" This reverts commit d4ecd6c. * fix test + zod for embedding * fix: Changes from lint * regenerate with discriminator * temp fix to skip linting * import apiVersion in tests * add missing error types --------- Co-authored-by: cloud-sdk-js <[email protected]>
- Loading branch information
Showing
113 changed files
with
4,211 additions
and
1,040 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
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
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
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
2 changes: 1 addition & 1 deletion
2
packages/foundation-models/src/azure-openai/azure-openai-embedding-response.test.ts
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
4 changes: 2 additions & 2 deletions
4
packages/foundation-models/src/azure-openai/azure-openai-embedding-response.ts
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
59 changes: 59 additions & 0 deletions
59
packages/foundation-models/src/azure-openai/azure-openai-embedding-types.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Azure OpenAI embedding input parameters. | ||
*/ | ||
export interface AzureOpenAiEmbeddingParameters { | ||
/** | ||
* Input text to get embeddings for, encoded as a string. The number of input tokens varies depending on what model you are using. Unless you're embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present. | ||
*/ | ||
input: string[] | string; | ||
/** | ||
* A unique identifier representing for your end-user. This will help Azure OpenAI monitor and detect abuse. Do not pass PII identifiers instead use pseudoanonymized values such as GUIDs. | ||
*/ | ||
user?: string; | ||
} | ||
|
||
/** | ||
* Azure OpenAI embedding output. | ||
*/ | ||
export interface AzureOpenAiEmbeddingOutput { | ||
/** | ||
* List object. | ||
*/ | ||
object: 'list'; | ||
/** | ||
* Model used for embedding. | ||
*/ | ||
model: string; | ||
/** | ||
* Array of result candidates. | ||
*/ | ||
data: [ | ||
{ | ||
/** | ||
* Embedding object. | ||
*/ | ||
object: 'embedding'; | ||
/** | ||
* Array of size `1536` (Azure OpenAI's embedding size) containing embedding vector. | ||
*/ | ||
embedding: number[]; | ||
/** | ||
* Index of choice. | ||
*/ | ||
index: number; | ||
} | ||
]; | ||
/** | ||
* Token Usage. | ||
*/ | ||
usage: { | ||
/** | ||
* Tokens consumed for input prompt tokens. | ||
*/ | ||
prompt_tokens: number; | ||
/** | ||
* Total tokens consumed. | ||
*/ | ||
total_tokens: number; | ||
}; | ||
} |
Oops, something went wrong.