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

feat(entities-plugins): support ai-azure-content-safety plugin #1369

Merged
merged 1 commit into from
Apr 26, 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
4 changes: 2 additions & 2 deletions packages/core/forms/src/generator/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<KLabel
v-if="fieldTypeHasLabel(field)"
:aria-describedby="field.help ? getTooltipId(field) : undefined"
:class="field.labelClasses"
:class="[field.labelClasses, 'form-group-label']"
:for="getFieldID(field)"
:info="!options.helpAsHtml && field.help ? field.help : undefined"
:tooltip-attributes="field.help ? {
Expand All @@ -17,7 +17,7 @@
} : undefined"
>
<template
v-if="options.helpAsHtml"
v-if="options.helpAsHtml && field.help"
#tooltip
>
<div v-html="field.help" />
Expand Down
5 changes: 5 additions & 0 deletions packages/entities/entities-plugins/fixtures/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ export const kmAvailablePlugins = {
version: '3.7.0',
priority: 905,
},
'ai-azure-content-safety': {
version: '3.7.0',
priority: 905,
},
'ai-prompt-template': {
version: '3.6.0',
priority: 773,
Expand Down Expand Up @@ -446,6 +450,7 @@ export const kongPluginNames = [
'ai-request-transformer',
'ai-response-transformer',
'ai-rate-limiting-advanced',
'ai-azure-content-safety',
'app-dynamics',
'aws-lambda',
'azure-functions',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ onBeforeMount(() => {

.form-group.field-array label,
.form-group.field-input label,
.form-group.field-select label,
.form-group.field-multiselect label {
display: flex;
justify-content: flex-start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ export const PLUGIN_METADATA: Record<string, Omit<PluginMetaData<I18nMessageSour
scope: [PluginScope.GLOBAL, PluginScope.SERVICE, PluginScope.ROUTE, PluginScope.CONSUMER, PluginScope.CONSUMER_GROUP],
useLegacyForm: true,
},
'ai-azure-content-safety': {
descriptionKey: 'plugins.meta.ai-azure-content-safety.description',
group: PluginGroup.TRAFFIC_CONTROL,
isEnterprise: true,
nameKey: 'plugins.meta.ai-azure-content-safety.name',
scope: [PluginScope.GLOBAL, PluginScope.SERVICE, PluginScope.ROUTE],
useLegacyForm: true,
},
'aws-lambda': {
descriptionKey: 'plugins.meta.aws-lambda.description',
group: PluginGroup.SERVERLESS,
Expand Down
4 changes: 4 additions & 0 deletions packages/entities/entities-plugins/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@
"name": "AI Rate Limiting Advanced",
"description": "Provides rate limiting for the providers used by any AI plugins."
},
"ai-azure-content-safety": {
"name": "AI Azure Content Safety",
"description": "Allows checking and auditing of AI-Proxy plugin messages, using Azure Cognitive Services, before proxying to upstream large-language model."
},
"aws-lambda": {
"name": "AWS Lambda",
"description": "Invoke and manage AWS Lambda functions from Kong"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import type { Field, ItemsSchema, CommonSchemaFields } from './shared'

type FieldForKeyValuePairs = Field & {
newElementButtonLabelClasses?: string
newElementButtonLabel?: string
keyInputPlaceholder?: string
valueInputPlaceholder?: string
}

type ItemsSchemaForKeyValuePairs = Omit<ItemsSchema, 'schema'> & {
schema: {
fields: FieldForKeyValuePairs[]
fields: Field[]
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import type { Field, ItemsSchema, CommonSchemaFields } from './shared'

type FieldForKeyValuePairs = Field & {
newElementButtonLabelClasses?: string
newElementButtonLabel?: string
keyInputPlaceholder?: string
valueInputPlaceholder?: string
}

type ItemsSchemaForKeyValuePairs = Omit<ItemsSchema, 'schema'> & {
schema: {
fields: FieldForKeyValuePairs[]
fields: Field[]
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import type { Field, ItemsSchema, CommonSchemaFields } from './shared'

type FieldForKeyValuePairs = Field & {
newElementButtonLabelClasses?: string
newElementButtonLabel?: string
keyInputPlaceholder?: string
valueInputPlaceholder?: string
}

type ItemsSchemaForKeyValuePairs = Omit<ItemsSchema, 'schema'> & {
schema: {
fields: FieldForKeyValuePairs[]
fields: Field[]
}
}

Expand Down
Loading