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

update openai smoke test #2682

Merged
merged 11 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export interface CreateFineTuneRequest {
* "davinci", or a fine-tuned model created after 2022-04-21 and before 2023-08-22. To learn more
* about these models, see the [Models](/docs/models) documentation.
*/
model?: string;
model?: string | null;
qiaozha marked this conversation as resolved.
Show resolved Hide resolved
/**
* The number of epochs to train the model for. An epoch refers to one full cycle through the
* training dataset.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ import { OperationOptions } from '@azure-rest/core-client';
import { Pipeline } from '@azure/core-rest-pipeline';
import { TokenCredential } from '@azure/core-auth';

// @public
export interface AudioSpeechOptions {
input: string;
responseFormat?: AudioSpeechOutputFormat;
speed?: number;
voice: AudioSpeechVoice;
}

// @public
export type AudioSpeechOutputFormat = "mp3" | "opus" | "aac" | "flac";

// @public
export type AudioSpeechVoice = "alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer";

// @public
export type AudioTaskLabel = "transcribe" | "translate";

Expand All @@ -35,6 +21,7 @@ export interface AudioTranscription {
segments?: AudioTranscriptionSegment[];
task?: AudioTaskLabel;
text: string;
words?: AudioTranscriptionWord[];
}

// @public
Expand All @@ -49,6 +36,7 @@ export interface AudioTranscriptionOptions {
prompt?: string;
responseFormat?: AudioTranscriptionFormat;
temperature?: number;
timestampGranularities?: AudioTranscriptionTimestampGranularity[];
}

// @public
Expand All @@ -65,6 +53,16 @@ export interface AudioTranscriptionSegment {
tokens: number[];
}

// @public
export type AudioTranscriptionTimestampGranularity = "word" | "segment";

// @public
export interface AudioTranscriptionWord {
end: number;
start: number;
word: string;
}

// @public
export interface AudioTranslation {
duration?: number;
Expand Down Expand Up @@ -129,14 +127,32 @@ export interface AzureChatExtensionDataSourceResponseCitation {
url?: string;
}

// @public
export interface AzureChatExtensionRetrievedDocument {
chunkId?: string;
content: string;
dataSourceIndex: number;
filepath?: string;
filterReason?: AzureChatExtensionRetrieveDocumentFilterReason;
originalSearchScore?: number;
rerankScore?: number;
searchQueries: string[];
title?: string;
url?: string;
}

// @public
export type AzureChatExtensionRetrieveDocumentFilterReason = "score" | "rerank";

// @public
export interface AzureChatExtensionsMessageContext {
allRetrievedDocuments?: AzureChatExtensionRetrievedDocument[];
citations?: AzureChatExtensionDataSourceResponseCitation[];
intent?: string;
}

// @public
export type AzureChatExtensionType = "azure_search" | "azure_ml_index" | "azure_cosmos_db" | "elasticsearch" | "Pinecone";
export type AzureChatExtensionType = "azure_search" | "azure_ml_index" | "azure_cosmos_db" | "elasticsearch" | "pinecone";

// @public
export interface AzureChatGroundingEnhancementConfiguration {
Expand All @@ -156,13 +172,16 @@ export interface AzureCosmosDBChatExtensionConfiguration extends AzureChatExtens

// @public
export interface AzureCosmosDBChatExtensionParameters {
allowPartialResult?: boolean;
authentication?: OnYourDataAuthenticationOptionsUnion;
containerName: string;
databaseName: string;
embeddingDependency: OnYourDataVectorizationSourceUnion;
fieldsMapping: AzureCosmosDBFieldMappingOptions;
includeContexts?: OnYourDataContextProperty[];
indexName: string;
inScope?: boolean;
maxSearchQueries?: number;
roleInformation?: string;
strictness?: number;
topNDocuments?: number;
Expand Down Expand Up @@ -211,9 +230,12 @@ export interface AzureMachineLearningIndexChatExtensionConfiguration extends Azu

// @public
export interface AzureMachineLearningIndexChatExtensionParameters {
allowPartialResult?: boolean;
authentication?: OnYourDataAuthenticationOptionsUnion;
filter?: string;
includeContexts?: OnYourDataContextProperty[];
inScope?: boolean;
maxSearchQueries?: number;
name: string;
projectResourceId: string;
roleInformation?: string;
Expand All @@ -230,13 +252,16 @@ export interface AzureSearchChatExtensionConfiguration extends AzureChatExtensio

// @public
export interface AzureSearchChatExtensionParameters {
allowPartialResult?: boolean;
authentication?: OnYourDataAuthenticationOptionsUnion;
embeddingDependency?: OnYourDataVectorizationSourceUnion;
endpoint: string;
fieldsMapping?: AzureSearchIndexFieldMappingOptions;
filter?: string;
includeContexts?: OnYourDataContextProperty[];
indexName: string;
inScope?: boolean;
maxSearchQueries?: number;
queryType?: AzureSearchQueryType;
roleInformation?: string;
semanticConfiguration?: string;
Expand Down Expand Up @@ -280,6 +305,7 @@ export interface ChatCompletions {
choices: ChatChoice[];
created: Date;
id: string;
model?: string;
promptFilterResults?: ContentFilterResultsForPrompt[];
systemFingerprint?: string;
usage: CompletionsUsage;
Expand Down Expand Up @@ -532,6 +558,7 @@ export interface CompletionsOptions {
prompt: string[];
stop?: string[];
stream?: boolean;
suffix?: string;
temperature?: number;
topP?: number;
user?: string;
Expand All @@ -558,6 +585,12 @@ export interface ContentFilterCitedDetectionResult {
url?: string;
}

// @public
export interface ContentFilterDetailedResults {
details: ContentFilterBlocklistIdResult[];
filtered: boolean;
}

// @public
export interface ContentFilterDetectionResult {
detected: boolean;
Expand All @@ -572,9 +605,10 @@ export interface ContentFilterResult {

// @public
export interface ContentFilterResultDetailsForPrompt {
customBlocklists?: ContentFilterBlocklistIdResult[];
customBlocklists?: ContentFilterDetailedResults;
error?: ErrorModel;
hate?: ContentFilterResult;
indirectAttack?: ContentFilterDetectionResult;
jailbreak?: ContentFilterDetectionResult;
profanity?: ContentFilterDetectionResult;
selfHarm?: ContentFilterResult;
Expand All @@ -584,7 +618,7 @@ export interface ContentFilterResultDetailsForPrompt {

// @public
export interface ContentFilterResultsForChoice {
customBlocklists?: ContentFilterBlocklistIdResult[];
customBlocklists?: ContentFilterDetailedResults;
error?: ErrorModel;
hate?: ContentFilterResult;
profanity?: ContentFilterDetectionResult;
Expand Down Expand Up @@ -612,12 +646,15 @@ export interface ElasticsearchChatExtensionConfiguration extends AzureChatExtens

// @public
export interface ElasticsearchChatExtensionParameters {
allowPartialResult?: boolean;
authentication?: OnYourDataAuthenticationOptionsUnion;
embeddingDependency?: OnYourDataVectorizationSourceUnion;
endpoint: string;
fieldsMapping?: ElasticsearchIndexFieldMappingOptions;
includeContexts?: OnYourDataContextProperty[];
indexName: string;
inScope?: boolean;
maxSearchQueries?: number;
queryType?: ElasticsearchQueryType;
roleInformation?: string;
strictness?: number;
Expand All @@ -637,6 +674,9 @@ export interface ElasticsearchIndexFieldMappingOptions {
// @public
export type ElasticsearchQueryType = "simple" | "vector";

// @public
export type EmbeddingEncodingFormat = "float" | "base64";

// @public
export interface EmbeddingItem {
embedding: number[];
Expand All @@ -651,6 +691,8 @@ export interface Embeddings {

// @public
export interface EmbeddingsOptions {
dimensions?: number;
encodingFormat?: EmbeddingEncodingFormat;
input: string[];
inputType?: string;
model?: string;
Expand Down Expand Up @@ -685,7 +727,7 @@ export interface FunctionName {
}

// @public
export interface GetAudioSpeechOptionalParams extends OperationOptions {
export interface GenerateSpeechFromTextOptionalParams extends OperationOptions {
}

// @public
Expand Down Expand Up @@ -724,9 +766,19 @@ export interface GetEmbeddingsOptionalParams extends OperationOptions {
export interface GetImageGenerationsOptionalParams extends OperationOptions {
}

// @public
export interface ImageGenerationContentFilterResults {
hate?: ContentFilterResult;
selfHarm?: ContentFilterResult;
sexual?: ContentFilterResult;
violence?: ContentFilterResult;
}

// @public
export interface ImageGenerationData {
base64Data?: string;
contentFilterResults?: ImageGenerationContentFilterResults;
promptFilterResults?: ImageGenerationPromptFilterResults;
revisedPrompt?: string;
url?: string;
}
Expand All @@ -743,6 +795,17 @@ export interface ImageGenerationOptions {
user?: string;
}

// @public
export interface ImageGenerationPromptFilterResults {
customBlocklists?: ContentFilterDetailedResults;
hate?: ContentFilterResult;
jailbreak?: ContentFilterDetectionResult;
profanity?: ContentFilterDetectionResult;
selfHarm?: ContentFilterResult;
sexual?: ContentFilterResult;
violence?: ContentFilterResult;
}

// @public
export type ImageGenerationQuality = "standard" | "hd";

Expand Down Expand Up @@ -795,9 +858,13 @@ export interface OnYourDataConnectionStringAuthenticationOptions extends OnYourD
type: "connection_string";
}

// @public
export type OnYourDataContextProperty = "citations" | "intent" | "all_retrieved_documents";

// @public
export interface OnYourDataDeploymentNameVectorizationSource extends OnYourDataVectorizationSource {
deploymentName: string;
dimensions?: number;
type: "deployment_name";
}

Expand All @@ -809,7 +876,7 @@ export interface OnYourDataEncodedApiKeyAuthenticationOptions extends OnYourData

// @public
export interface OnYourDataEndpointVectorizationSource extends OnYourDataVectorizationSource {
authentication: OnYourDataAuthenticationOptionsUnion;
authentication: OnYourDataVectorSearchAuthenticationOptionsUnion;
endpoint: string;
type: "endpoint";
}
Expand Down Expand Up @@ -849,10 +916,33 @@ export type OnYourDataVectorizationSourceType = "endpoint" | "deployment_name" |
// @public
export type OnYourDataVectorizationSourceUnion = OnYourDataEndpointVectorizationSource | OnYourDataDeploymentNameVectorizationSource | OnYourDataModelIdVectorizationSource | OnYourDataVectorizationSource;

// @public
export interface OnYourDataVectorSearchAccessTokenAuthenticationOptions extends OnYourDataVectorSearchAuthenticationOptions {
accessToken: string;
type: "access_token";
}

// @public
export interface OnYourDataVectorSearchApiKeyAuthenticationOptions extends OnYourDataVectorSearchAuthenticationOptions {
key: string;
type: "api_key";
}

// @public
export interface OnYourDataVectorSearchAuthenticationOptions {
type: OnYourDataVectorSearchAuthenticationType;
}

// @public
export type OnYourDataVectorSearchAuthenticationOptionsUnion = OnYourDataVectorSearchApiKeyAuthenticationOptions | OnYourDataVectorSearchAccessTokenAuthenticationOptions | OnYourDataVectorSearchAuthenticationOptions;

// @public
export type OnYourDataVectorSearchAuthenticationType = "api_key" | "access_token";

// @public (undocumented)
export class OpenAIClient {
constructor(endpointParam: string, credential: KeyCredential | TokenCredential, options?: OpenAIClientOptionalParams);
getAudioSpeech(deploymentId: string, body: AudioSpeechOptions, options?: GetAudioSpeechOptionalParams): Promise<Uint8Array>;
generateSpeechFromText(deploymentId: string, body: SpeechGenerationOptions, options?: GenerateSpeechFromTextOptionalParams): Promise<Uint8Array>;
getAudioTranscriptionAsPlainText(deploymentId: string, body: AudioTranscriptionOptions, options?: GetAudioTranscriptionAsPlainTextOptionalParams): Promise<string>;
getAudioTranscriptionAsResponseObject(deploymentId: string, body: AudioTranscriptionOptions, options?: GetAudioTranscriptionAsResponseObjectOptionalParams): Promise<AudioTranscription>;
getAudioTranslationAsPlainText(deploymentId: string, body: AudioTranslationOptions, options?: GetAudioTranslationAsPlainTextOptionalParams): Promise<string>;
Expand All @@ -872,17 +962,20 @@ export interface OpenAIClientOptionalParams extends ClientOptions {
// @public
export interface PineconeChatExtensionConfiguration extends AzureChatExtensionConfiguration {
parameters: PineconeChatExtensionParameters;
type: "Pinecone";
type: "pinecone";
}

// @public
export interface PineconeChatExtensionParameters {
allowPartialResult?: boolean;
authentication?: OnYourDataAuthenticationOptionsUnion;
embeddingDependency: OnYourDataVectorizationSourceUnion;
environment: string;
fieldsMapping: PineconeFieldMappingOptions;
includeContexts?: OnYourDataContextProperty[];
indexName: string;
inScope?: boolean;
maxSearchQueries?: number;
roleInformation?: string;
strictness?: number;
topNDocuments?: number;
Expand All @@ -898,7 +991,22 @@ export interface PineconeFieldMappingOptions {
}

// @public
export type ServiceApiVersions = "2022-12-01" | "2023-05-15" | "2023-06-01-preview" | "2023-07-01-preview" | "2024-02-15-preview";
export type ServiceApiVersions = "2022-12-01" | "2023-05-15" | "2023-06-01-preview" | "2023-07-01-preview" | "2024-02-01" | "2024-02-15-preview" | "2024-03-01-preview" | "2024-04-01-preview" | "2024-05-01-preview" | "2024-06-01";

// @public
export interface SpeechGenerationOptions {
input: string;
model?: string;
responseFormat?: SpeechGenerationResponseFormat;
speed?: number;
voice: SpeechVoice;
}

// @public
export type SpeechGenerationResponseFormat = "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";

// @public
export type SpeechVoice = "alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer";

// @public
export interface StopFinishDetails extends ChatFinishDetails {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export {
getCompletions,
getChatCompletions,
getImageGenerations,
getAudioSpeech,
generateSpeechFromText,
getEmbeddings,
} from "./operations.js";
Loading
Loading