open ai api

This commit is contained in:
2025-09-16 09:38:01 +08:00
parent c71c3ab417
commit 5f9a2bc78c
7168 changed files with 352600 additions and 209 deletions

5
node_modules/@azure/openai/dist/browser/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export {};
/**
* @packageDocumentation https://learn.microsoft.com/azure/cognitive-services/openai/overview
*/
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAGA;;GAEG"}

7
node_modules/@azure/openai/dist/browser/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export {};
/**
* @packageDocumentation https://learn.microsoft.com/azure/cognitive-services/openai/overview
*/
//# sourceMappingURL=index.js.map

1
node_modules/@azure/openai/dist/browser/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC;;GAEG","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @packageDocumentation https://learn.microsoft.com/azure/cognitive-services/openai/overview\n */\n"]}

3
node_modules/@azure/openai/dist/browser/package.json generated vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@@ -0,0 +1,117 @@
import type { Completion, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming, ChatCompletion, ChatCompletionChunk, ChatCompletionMessage } from "openai/resources/index";
import type { ContentFilterResultsForPromptOutput, ContentFilterResultsForChoiceOutput, AzureChatExtensionsMessageContextOutput, ImageGenerationPromptFilterResults, ImageGenerationContentFilterResults } from "./outputModels.js";
import type { AzureChatExtensionConfiguration } from "./models.js";
declare module "openai/resources/index" {
interface Completion {
/**
* Content filtering results for zero or more prompts in the request. In a streaming request,
* results for different prompts may arrive at different times or in different orders.
*/
prompt_filter_results?: Array<ContentFilterResultsForPromptOutput>;
}
interface ChatCompletionCreateParamsNonStreaming {
/**
* The configuration entries for Azure OpenAI chat extensions that use them.
* This additional specification is only compatible with Azure OpenAI.
*/
data_sources?: Array<AzureChatExtensionConfiguration>;
}
interface ChatCompletionCreateParamsStreaming {
/**
* The configuration entries for Azure OpenAI chat extensions that use them.
* This additional specification is only compatible with Azure OpenAI.
*/
data_sources?: Array<AzureChatExtensionConfiguration>;
}
interface ChatCompletion {
/**
* Content filtering results for zero or more prompts in the request. In a streaming request,
* results for different prompts may arrive at different times or in different orders.
*/
prompt_filter_results?: Array<ContentFilterResultsForPromptOutput>;
}
interface ChatCompletionMessage {
/**
* If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those
* extensions while processing the chat completions request.
*/
context?: AzureChatExtensionsMessageContextOutput;
}
interface CompletionChoice {
/**
* Information about the content filtering category (hate, sexual, violence, self_harm), if it
* has been detected, as well as the severity level (very_low, low, medium, high-scale that
* determines the intensity and risk level of harmful content) and if it has been filtered or not.
*/
content_filter_results?: ContentFilterResultsForChoiceOutput;
}
namespace ChatCompletion {
interface Choice {
/**
* Information about the content filtering category (hate, sexual, violence, self_harm), if it
* has been detected, as well as the severity level (very_low, low, medium, high-scale that
* determines the intensity and risk level of harmful content) and if it has been filtered or not.
*/
content_filter_results?: ContentFilterResultsForChoiceOutput;
}
}
interface ChatCompletionChunk {
/**
* Content filtering results for zero or more prompts in the request. In a streaming request,
* results for different prompts may arrive at different times or in different orders.
*/
prompt_filter_results?: Array<ContentFilterResultsForPromptOutput>;
}
namespace ChatCompletionChunk {
interface Choice {
/**
* Information about the content filtering category (hate, sexual, violence, self_harm), if it
* has been detected, as well as the severity level (very_low, low, medium, high-scale that
* determines the intensity and risk level of harmful content) and if it has been filtered or not.
*/
content_filter_results?: ContentFilterResultsForChoiceOutput;
}
namespace Choice {
/**
* A chat completion delta generated by streamed model responses.
*/
interface Delta {
/**
* If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those
* extensions while processing the chat completions request.
*/
context?: AzureChatExtensionsMessageContextOutput;
}
}
}
interface ImagesResponse {
/**
* Information about the content filtering category (hate, sexual, violence, self_harm), if
* it has been detected, as well as the severity level (very_low, low, medium, high-scale
* that determines the intensity and risk level of harmful content) and if it has been
* filtered or not. Information about jailbreak content and profanity, if it has been detected,
* and if it has been filtered or not. And information about customer block list, if it has
* been filtered and its id.
*/
content_filter_results?: ImageGenerationContentFilterResults;
/**
* Information about the content filtering category (hate, sexual, violence, self_harm), if
* it has been detected, as well as the severity level (very_low, low, medium, high-scale
* that determines the intensity and risk level of harmful content) and if it has been
* filtered or not. Information about jailbreak content and profanity, if it has been detected,
* and if it has been filtered or not. And information about customer block list, if it has
* been filtered and its id.
*/
prompt_filter_results?: ImageGenerationPromptFilterResults;
}
interface UploadPart {
/**
* Azure-only field.
*/
azure_block_id?: string;
}
}
export { Completion, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming, ChatCompletion, ChatCompletionChunk, ChatCompletionMessage, };
export * from "./outputModels.js";
export * from "./models.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,UAAU,EACV,kCAAkC,EAClC,+BAA+B,EAC/B,sCAAsC,EACtC,mCAAmC,EACnC,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,mCAAmC,EACnC,mCAAmC,EACnC,uCAAuC,EACvC,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,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B,EAC/B,sCAAsC,EACtC,mCAAmC,EACnC,cAAc,EACd,mBAAmB,EACnB,qBAAqB,GACtB,CAAC;AACF,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}

View File

@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export * from "./outputModels.js";
export * from "./models.js";
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,199 @@
/**
* A specific representation of configurable options for Azure Search when using it as an Azure OpenAI chat
* extension.
*/
export interface AzureSearchChatExtensionConfiguration extends AzureChatExtensionConfigurationParent {
/**
* The type label to use when configuring Azure OpenAI chat extensions. This should typically not be changed from its
* default value for Azure Cognitive Search.
*/
type: "azure_search";
/** The parameters to use when configuring Azure Search. */
parameters: AzureSearchChatExtensionParameters;
}
/** Parameters for Azure Cognitive Search when used as an Azure OpenAI chat extension. The supported authentication types are APIKey, SystemAssignedManagedIdentity and UserAssignedManagedIdentity. */
export interface AzureSearchChatExtensionParameters {
/**
* The authentication method to use when accessing the defined data source.
* Each data source type supports a specific set of available authentication methods; please see the documentation of
* the data source for supported mechanisms.
* If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential)
* authentication.
*/
authentication: OnYourDataAuthenticationOptions;
/** The configured top number of documents to feature for the configured query. */
top_n_documents?: number;
/** Whether queries should be restricted to use of indexed data. */
in_scope?: boolean;
/** The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. */
strictness?: number;
/** The absolute endpoint path for the Azure Cognitive Search resource to use. */
endpoint: string;
/** The name of the index to use as available in the referenced Azure Cognitive Search resource. */
index_name: string;
/** Customized field mapping behavior to use when interacting with the search index. */
fields_mapping?: AzureSearchIndexFieldMappingOptions;
/**
* The query type to use with Azure Cognitive Search.
*
* Possible values: "simple", "semantic", "vector", "vector_simple_hybrid", "vector_semantic_hybrid"
*/
query_type?: string;
/** The additional semantic configuration for the query. */
semantic_configuration?: string;
/** Search filter. */
filter?: string;
/** The embedding dependency for vector search. */
embedding_dependency?: OnYourDataVectorizationSource;
}
/** Optional settings to control how fields are processed when using a configured Azure Search resource. */
export interface AzureSearchIndexFieldMappingOptions {
/** The name of the index field to use as a title. */
title_field?: string;
/** The name of the index field to use as a URL. */
url_field?: string;
/** The name of the index field to use as a filepath. */
filepath_field?: string;
/** The names of index fields that should be treated as content. */
content_fields?: string[];
/** The separator pattern that content fields should use. */
content_fields_separator?: string;
/** The names of fields that represent vector data. */
vector_fields?: string[];
}
/**
* A specific representation of configurable options for Azure Cosmos DB when using it as an Azure OpenAI chat
* extension.
*/
export interface AzureCosmosDBChatExtensionConfiguration extends AzureChatExtensionConfigurationParent {
/**
* The type label to use when configuring Azure OpenAI chat extensions. This should typically not be changed from its
* default value for Azure Cosmos DB.
*/
type: "azure_cosmos_db";
/** The parameters to use when configuring Azure OpenAI CosmosDB chat extensions. */
parameters: AzureCosmosDBChatExtensionParameters;
}
/**
* Parameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB for
* MongoDB vCore. The supported authentication type is ConnectionString.
*/
export interface AzureCosmosDBChatExtensionParameters {
/**
* The authentication method to use when accessing the defined data source.
* Each data source type supports a specific set of available authentication methods; please see the documentation of
* the data source for supported mechanisms.
* If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential)
* authentication.
*/
authentication: OnYourDataAuthenticationOptions;
/** The configured top number of documents to feature for the configured query. */
top_n_documents?: number;
/** Whether queries should be restricted to use of indexed data. */
in_scope?: boolean;
/** The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. */
strictness?: number;
/** The MongoDB vCore database name to use with Azure Cosmos DB. */
database_name: string;
/** The name of the Azure Cosmos DB resource container. */
container_name: string;
/** The MongoDB vCore index name to use with Azure Cosmos DB. */
index_name: string;
/** Customized field mapping behavior to use when interacting with the search index. */
fields_mapping: AzureCosmosDBFieldMappingOptions;
/** The embedding dependency for vector search. */
embedding_dependency: OnYourDataVectorizationSource;
}
/** Optional settings to control how fields are processed when using a configured Azure Cosmos DB resource. */
export interface AzureCosmosDBFieldMappingOptions {
/** The name of the index field to use as a title. */
title_field?: string;
/** The name of the index field to use as a URL. */
url_field?: string;
/** The name of the index field to use as a filepath. */
filepath_field?: string;
/** The names of index fields that should be treated as content. */
content_fields: string[];
/** The separator pattern that content fields should use. */
content_fields_separator?: string;
/** The names of fields that represent vector data. */
vector_fields: string[];
}
/** The authentication options for Azure OpenAI On Your Data when using an API key. */
export interface OnYourDataApiKeyAuthenticationOptions extends OnYourDataAuthenticationOptionsParent {
/** The authentication type of API key. */
type: "api_key";
/** The API key to use for authentication. */
key: string;
}
/** The authentication options for Azure OpenAI On Your Data. */
export interface OnYourDataAuthenticationOptionsParent {
/** The authentication type. */
type: string;
}
/** The authentication options for Azure OpenAI On Your Data when using a connection string. */
export interface OnYourDataConnectionStringAuthenticationOptions extends OnYourDataAuthenticationOptionsParent {
/** The authentication type of connection string. */
type: "connection_string";
/** The connection string to use for authentication. */
connection_string: string;
}
/**
* The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based
* on an internal embeddings model deployment name in the same Azure OpenAI resource.
*/
export interface OnYourDataDeploymentNameVectorizationSource extends OnYourDataVectorizationSourceParent {
/** The type of vectorization source to use. Always 'deployment_name' for this type. */
type: "deployment_name";
/** The embedding model deployment name within the same Azure OpenAI resource. This enables you to use vector search without Azure OpenAI api-key and without Azure OpenAI public network access. */
deployment_name: string;
}
/**
* The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based
* on a public Azure OpenAI endpoint call for embeddings.
*/
export interface OnYourDataEndpointVectorizationSource extends OnYourDataVectorizationSourceParent {
/** The type of vectorization source to use. Always 'endpoint' for this type. */
type: "endpoint";
/** Specifies the resource endpoint URL from which embeddings should be retrieved. It should be in the format of https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. The api-version query parameter is not allowed. */
endpoint: string;
/** Specifies the authentication options to use when retrieving embeddings from the specified endpoint. */
authentication: OnYourDataApiKeyAuthenticationOptions;
}
/** The authentication options for Azure OpenAI On Your Data when using a system-assigned managed identity. */
export interface OnYourDataSystemAssignedManagedIdentityAuthenticationOptions extends OnYourDataAuthenticationOptionsParent {
/** The authentication type of system-assigned managed identity. */
type: "system_assigned_managed_identity";
}
/** The authentication options for Azure OpenAI On Your Data when using a user-assigned managed identity. */
export interface OnYourDataUserAssignedManagedIdentityAuthenticationOptions extends OnYourDataAuthenticationOptionsParent {
/** The authentication type of user-assigned managed identity. */
type: "user_assigned_managed_identity";
/** The resource ID of the user-assigned managed identity to use for authentication. */
managed_identity_resource_id: string;
}
/** An abstract representation of a vectorization source for Azure OpenAI On Your Data with vector search. */
export interface OnYourDataVectorizationSourceParent {
/** The authentication type. */
type: string;
}
/**
* A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat
* completions request that should use Azure OpenAI chat extensions to augment the response behavior.
* The use of this configuration is compatible only with Azure OpenAI.
*/
export interface AzureChatExtensionConfigurationParent {
/** The type label. */
type: string;
}
/** The authentication options for Azure OpenAI On Your Data. */
export type OnYourDataAuthenticationOptions = OnYourDataAuthenticationOptionsParent | OnYourDataApiKeyAuthenticationOptions | OnYourDataConnectionStringAuthenticationOptions | OnYourDataSystemAssignedManagedIdentityAuthenticationOptions | OnYourDataUserAssignedManagedIdentityAuthenticationOptions;
/** An abstract representation of a vectorization source for Azure OpenAI On Your Data with vector search. */
export type OnYourDataVectorizationSource = OnYourDataVectorizationSourceParent | OnYourDataEndpointVectorizationSource | OnYourDataDeploymentNameVectorizationSource;
/**
* A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat
* completions request that should use Azure OpenAI chat extensions to augment the response behavior.
* The use of this configuration is compatible only with Azure OpenAI.
*/
export type AzureChatExtensionConfiguration = AzureChatExtensionConfigurationParent | AzureSearchChatExtensionConfiguration | AzureCosmosDBChatExtensionConfiguration;
//# sourceMappingURL=models.d.ts.map

View File

@@ -0,0 +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+1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export {};
//# sourceMappingURL=models.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,209 @@
import type { ErrorModel } from "@azure-rest/core-client";
/** Information about content filtering evaluated against generated model output. */
export interface ContentFilterResultsForChoiceOutput {
/**
* Describes language related to anatomical organs and genitals, romantic relationships,
* acts portrayed in erotic or affectionate terms, physical sexual acts, including
* those portrayed as an assault or a forced sexual violent act against one’s will,
* prostitution, pornography, and abuse.
*/
sexual?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to hurt, injure, damage, or
* kill someone or something; describes weapons, etc.
*/
violence?: ContentFilterResultOutput;
/**
* Describes language attacks or uses that include pejorative or discriminatory language
* with reference to a person or identity group on the basis of certain differentiating
* attributes of these groups including but not limited to race, ethnicity, nationality,
* gender identity and expression, sexual orientation, religion, immigration status, ability
* status, personal appearance, and body size.
*/
hate?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to purposely hurt, injure,
* or damage one’s body, or kill oneself.
*/
self_harm?: ContentFilterResultOutput;
/** Describes whether profanity was detected. */
profanity?: ContentFilterDetectionResultOutput;
/**
* Describes an error returned if the content filtering system is
* down or otherwise unable to complete the operation in time.
*/
error?: ErrorModel;
/** Information about detection of protected text material. */
protected_material_text?: ContentFilterDetectionResultOutput;
/** Information about detection of protected code material. */
protected_material_code?: ContentFilterCitedDetectionResultOutput;
}
/** Represents the outcome of a detection operation against protected resources as performed by content filtering. */
export interface ContentFilterCitedDetectionResultOutput {
/** A value indicating whether or not the content has been filtered. */
filtered: boolean;
/** A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. */
detected: boolean;
/** The internet location associated with the detection. */
URL?: string;
/** The license description associated with the detection. */
license?: string;
}
/** Content filtering results for a single prompt in the request. */
export interface ContentFilterResultsForPromptOutput {
/** The index of this prompt in the set of prompt results */
prompt_index: number;
/** Content filtering results for this prompt */
content_filter_results: ContentFilterResultDetailsForPromptOutput;
}
/** Information about content filtering evaluated against input data to Azure OpenAI. */
export interface ContentFilterResultDetailsForPromptOutput {
/**
* Describes language related to anatomical organs and genitals, romantic relationships,
* acts portrayed in erotic or affectionate terms, physical sexual acts, including
* those portrayed as an assault or a forced sexual violent act against one’s will,
* prostitution, pornography, and abuse.
*/
sexual?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to hurt, injure, damage, or
* kill someone or something; describes weapons, etc.
*/
violence?: ContentFilterResultOutput;
/**
* Describes language attacks or uses that include pejorative or discriminatory language
* with reference to a person or identity group on the basis of certain differentiating
* attributes of these groups including but not limited to race, ethnicity, nationality,
* gender identity and expression, sexual orientation, religion, immigration status, ability
* status, personal appearance, and body size.
*/
hate?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to purposely hurt, injure,
* or damage one’s body, or kill oneself.
*/
self_harm?: ContentFilterResultOutput;
/** Describes whether profanity was detected. */
profanity?: ContentFilterDetectionResultOutput;
/**
* Describes an error returned if the content filtering system is
* down or otherwise unable to complete the operation in time.
*/
error?: ErrorModel;
/** Whether a jailbreak attempt was detected in the prompt. */
jailbreak?: ContentFilterDetectionResultOutput;
}
/** Information about filtered content severity level and if it has been filtered or not. */
export interface ContentFilterResultOutput {
/**
* Ratings for the intensity and risk level of filtered content.
*
* Possible values: "safe", "low", "medium", "high"
*/
severity: string;
/** A value indicating whether or not the content has been filtered. */
filtered: boolean;
}
/** Represents the outcome of a detection operation performed by content filtering. */
export interface ContentFilterDetectionResultOutput {
/** A value indicating whether or not the content has been filtered. */
filtered: boolean;
/** A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. */
detected: boolean;
}
/**
* A representation of the additional context information available when Azure OpenAI chat extensions are involved
* in the generation of a corresponding chat completions response. This context information is only populated when
* using an Azure OpenAI request configured to use a matching extension.
*/
export interface AzureChatExtensionsMessageContextOutput {
/**
* The contextual information associated with the Azure chat extensions used for a chat completions request.
* These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the
* course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat
* extensions.
*/
citations?: Array<AzureChatExtensionDataSourceResponseCitationOutput>;
/** The detected intent from the chat history, used to pass to the next turn to carry over the context. */
intent?: string;
}
/**
* A single instance of additional context information available when Azure OpenAI chat extensions are involved
* in the generation of a corresponding chat completions response. This context information is only populated when
* using an Azure OpenAI request configured to use a matching extension.
*/
export interface AzureChatExtensionDataSourceResponseCitationOutput {
/** The content of the citation. */
content: string;
/** The title of the citation. */
title?: string;
/** The URL of the citation. */
url?: string;
/** The file path of the citation. */
filepath?: string;
/** The chunk ID of the citation. */
chunk_id?: string;
}
/** Describes the content filtering result for the image generation request. */
export interface ImageGenerationContentFilterResults {
/**
* Describes language related to anatomical organs and genitals, romantic relationships,
* acts portrayed in erotic or affectionate terms, physical sexual acts, including
* those portrayed as an assault or a forced sexual violent act against one’s will,
* prostitution, pornography, and abuse.
*/
sexual?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to hurt, injure, damage, or
* kill someone or something; describes weapons, etc.
*/
violence?: ContentFilterResultOutput;
/**
* Describes language attacks or uses that include pejorative or discriminatory language
* with reference to a person or identity group on the basis of certain differentiating
* attributes of these groups including but not limited to race, ethnicity, nationality,
* gender identity and expression, sexual orientation, religion, immigration status, ability
* status, personal appearance, and body size.
*/
hate?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to purposely hurt, injure,
* or damage one’s body, or kill oneself.
*/
self_harm?: ContentFilterResultOutput;
}
/**
* Describes the content filtering results for the prompt of a image generation request.
*/
export interface ImageGenerationPromptFilterResults {
/**
* Describes language related to anatomical organs and genitals, romantic relationships,
* acts portrayed in erotic or affectionate terms, physical sexual acts, including
* those portrayed as an assault or a forced sexual violent act against one’s will,
* prostitution, pornography, and abuse.
*/
sexual?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to hurt, injure, damage, or
* kill someone or something; describes weapons, etc.
*/
violence?: ContentFilterResultOutput;
/**
* Describes language attacks or uses that include pejorative or discriminatory language
* with reference to a person or identity group on the basis of certain differentiating
* attributes of these groups including but not limited to race, ethnicity, nationality,
* gender identity and expression, sexual orientation, religion, immigration status, ability
* status, personal appearance, and body size.
*/
hate?: ContentFilterResultOutput;
/**
* Describes language related to physical actions intended to purposely hurt, injure,
* or damage one’s body, or kill oneself.
*/
self_harm?: ContentFilterResultOutput;
/** Describes whether profanity was detected. */
profanity?: ContentFilterDetectionResultOutput;
/** Whether a jailbreak attempt was detected in the prompt. */
jailbreak?: ContentFilterDetectionResultOutput;
}
//# sourceMappingURL=outputModels.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../../src/types/outputModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,oFAAoF;AACpF,MAAM,WAAW,mCAAmC;IAClD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,gDAAgD;IAChD,SAAS,CAAC,EAAE,kCAAkC,CAAC;IAC/C;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,8DAA8D;IAC9D,uBAAuB,CAAC,EAAE,kCAAkC,CAAC;IAC7D,8DAA8D;IAC9D,uBAAuB,CAAC,EAAE,uCAAuC,CAAC;CACnE;AAED,qHAAqH;AACrH,MAAM,WAAW,uCAAuC;IACtD,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,mHAAmH;IACnH,QAAQ,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oEAAoE;AACpE,MAAM,WAAW,mCA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CAAC,EAAE,MAAM,CAAC;CACnB;AAED,+EAA+E;AAC/E,MAAM,WAAW,mCAAmC;IAClD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,gDAAgD;IAChD,SAAS,CAAC,EAAE,kCAAkC,CAAC;IAC/C,8DAA8D;IAC9D,SAAS,CAAC,EAAE,kCAAkC,CAAC;CAChD"}

View File

@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
export {};
//# sourceMappingURL=outputModels.js.map

File diff suppressed because one or more lines are too long