-
Notifications
You must be signed in to change notification settings - Fork 75
Configuration Type Schemas #1107
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
Open
mrm9084
wants to merge
3
commits into
main
Choose a base branch
from
ConfigurationTypesSchemas
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
270 changes: 270 additions & 0 deletions
270
docs/Configuration Types/AIChatConfiguration.v1.0.0.schema.json
This file contains hidden or 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,270 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "http://azconfig.io/schemas/SpecialTypes/v1.0.0/AIChatConfiguration.json", | ||
| "title": "Azure App Configuration AI Chat Configuration Value", | ||
| "description": "A schema for the value part of Azure App Configuration AI Chat Configuration that defines settings and parameters for AI chat applications using Azure OpenAI or other chat completion services", | ||
| "type": "object", | ||
| "required": [ | ||
| "model" | ||
| ], | ||
| "properties": { | ||
| "model": { | ||
| "$id": "#/properties/model", | ||
| "type": "string", | ||
| "title": "Model Name", | ||
| "description": "The name of the AI model to use for chat completion (e.g., 'gpt-4o', 'gpt-3.5-turbo')", | ||
| "examples": [ | ||
| "gpt-4o", | ||
| "gpt-4", | ||
| "gpt-3.5-turbo", | ||
| "gpt-4-turbo" | ||
| ], | ||
| "minLength": 1 | ||
| }, | ||
| "messages": { | ||
| "$id": "#/properties/messages", | ||
| "type": "array", | ||
| "title": "Messages", | ||
| "description": "An array of messages that define the conversation context, including system prompts and initial conversation history", | ||
| "items": { | ||
| "$ref": "#/$defs/Message" | ||
| }, | ||
| "default": [] | ||
| }, | ||
| "max_tokens": { | ||
| "$id": "#/properties/max_tokens", | ||
| "type": "integer", | ||
| "title": "Maximum Tokens", | ||
| "description": "The maximum number of tokens to generate in the chat completion response", | ||
| "minimum": 1, | ||
| "maximum": 32768, | ||
| "examples": [ | ||
| 1000, | ||
| 2000, | ||
| 4000 | ||
| ] | ||
| }, | ||
| "temperature": { | ||
| "$id": "#/properties/temperature", | ||
| "type": "number", | ||
| "title": "Temperature", | ||
| "description": "Controls randomness in the response. Higher values make output more random, lower values make it more focused and deterministic", | ||
| "minimum": 0, | ||
| "maximum": 2, | ||
| "examples": [ | ||
| 0.7, | ||
| 0.9, | ||
| 0.1 | ||
| ] | ||
| }, | ||
| "top_p": { | ||
| "$id": "#/properties/top_p", | ||
| "type": "number", | ||
| "title": "Top P", | ||
| "description": "Controls diversity via nucleus sampling. Consider only tokens with top_p probability mass", | ||
| "minimum": 0, | ||
| "maximum": 1, | ||
| "examples": [ | ||
| 0.95, | ||
| 0.9, | ||
| 1.0 | ||
| ] | ||
| }, | ||
| "frequency_penalty": { | ||
| "$id": "#/properties/frequency_penalty", | ||
| "type": "number", | ||
| "title": "Frequency Penalty", | ||
| "description": "Penalizes new tokens based on their existing frequency in the text so far, decreasing likelihood of repetition", | ||
| "minimum": -2, | ||
| "maximum": 2, | ||
| "default": 0 | ||
| }, | ||
| "presence_penalty": { | ||
| "$id": "#/properties/presence_penalty", | ||
| "type": "number", | ||
| "title": "Presence Penalty", | ||
| "description": "Penalizes new tokens based on whether they appear in the text so far, increasing likelihood of talking about new topics", | ||
| "minimum": -2, | ||
| "maximum": 2, | ||
| "default": 0 | ||
| }, | ||
| "stop": { | ||
| "$id": "#/properties/stop", | ||
| "title": "Stop Sequences", | ||
| "description": "Up to 4 sequences where the API will stop generating further tokens", | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "maxItems": 4 | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "response_format": { | ||
| "$id": "#/properties/response_format", | ||
| "type": "object", | ||
| "title": "Response Format", | ||
| "description": "An object specifying the format that the model must output", | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "title": "Response Type", | ||
| "description": "The type of response format to use", | ||
| "enum": [ | ||
| "text", | ||
| "json_object" | ||
| ], | ||
| "examples": [ | ||
| "text", | ||
| "json_object" | ||
| ] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "type" | ||
| ], | ||
| "additionalProperties": false | ||
| }, | ||
| "stream": { | ||
| "$id": "#/properties/stream", | ||
| "type": "boolean", | ||
| "title": "Stream", | ||
| "description": "If set to true, partial message deltas will be sent as data-only server-sent events", | ||
| "default": false, | ||
| "examples": [ | ||
| true, | ||
| false | ||
| ] | ||
| }, | ||
| "user": { | ||
| "$id": "#/properties/user", | ||
| "type": "string", | ||
| "title": "User ID", | ||
| "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse", | ||
| "maxLength": 256, | ||
| "examples": [ | ||
| "user-123", | ||
| "user-id", | ||
| "[email protected]" | ||
| ] | ||
| }, | ||
| "seed": { | ||
| "$id": "#/properties/seed", | ||
| "type": "integer", | ||
| "title": "Seed", | ||
| "description": "If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result", | ||
| "minimum": -9223372036854775808, | ||
| "maximum": 9223372036854775807, | ||
| "examples": [ | ||
| 123, | ||
| 456, | ||
| 789 | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "$defs": { | ||
| "Message": { | ||
| "type": "object", | ||
| "title": "Chat Message", | ||
| "description": "A single message in the chat conversation with role and content", | ||
| "required": [ | ||
| "role" | ||
| ], | ||
| "properties": { | ||
| "role": { | ||
| "type": "string", | ||
| "title": "Message Role", | ||
| "description": "The role of the message sender", | ||
| "enum": [ | ||
| "system", | ||
| "user", | ||
| "assistant", | ||
| "function", | ||
| "tool" | ||
| ], | ||
| "examples": [ | ||
| "system", | ||
| "user", | ||
| "assistant" | ||
| ] | ||
| }, | ||
| "content": { | ||
| "title": "Message Content", | ||
| "description": "The content of the message", | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "examples": [ | ||
| "You are a helpful assistant.", | ||
| "Hello, how can I help you today?", | ||
| "I'm looking for information about machine learning." | ||
| ] | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "title": "Message Name", | ||
| "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role", | ||
| "pattern": "^[a-zA-Z0-9_-]+$", | ||
| "maxLength": 64 | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "examples": [ | ||
| { | ||
| "model": "gpt-4o", | ||
| "messages": [ | ||
| { | ||
| "role": "system", | ||
| "content": "You are a helpful assistant." | ||
| }, | ||
| { | ||
| "role": "user", | ||
| "content": "Test Message" | ||
| } | ||
| ], | ||
| "max_tokens": 800, | ||
| "temperature": 0.7, | ||
| "top_p": 0, | ||
| "stop": [ | ||
| "stop" | ||
| ], | ||
| "frequency_penalty": 0, | ||
| "presence_penalty": 0, | ||
| "response_format": { | ||
| "type": "json_object" | ||
| }, | ||
| "stream": true, | ||
| "user": "user-id", | ||
| "seed": 123 | ||
| }, | ||
| { | ||
| "model": "gpt-3.5-turbo", | ||
| "max_tokens": 2000, | ||
| "temperature": 0.9, | ||
| "messages": [ | ||
| { | ||
| "role": "system", | ||
| "content": "You are a creative writing assistant." | ||
| } | ||
| ], | ||
| "frequency_penalty": 0.1, | ||
| "presence_penalty": 0.1 | ||
| } | ||
| ] | ||
| } | ||
33 changes: 33 additions & 0 deletions
33
docs/Configuration Types/KeyVaultReference.v1.0.0.schema.json
This file contains hidden or 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,33 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "http://azconfig.io/schemas/SpecialTypes/v1.0.0/KeyVaultReference.json", | ||
| "title": "Azure App Configuration Key Vault Reference Value", | ||
| "description": "A schema for the value part of Azure App Configuration Key Vault References that point to secrets stored in Azure Key Vault", | ||
| "type": "object", | ||
| "required": [ | ||
| "uri" | ||
| ], | ||
| "properties": { | ||
| "uri": { | ||
| "$id": "#/properties/uri", | ||
| "type": "string", | ||
| "title": "Key Vault Secret URI", | ||
| "description": "The URI of the secret in Azure Key Vault. Must be a valid Key Vault secret identifier. The URI can optionally include a version identifier to reference a specific version of the secret.", | ||
| "pattern": "^https://[a-zA-Z0-9-]+\\.vault\\.[^/]+/secrets/[a-zA-Z0-9-]+(?:/[a-zA-Z0-9-]+)?$", | ||
| "examples": [ | ||
| "https://myvault.vault.azure.net/secrets/mysecret", | ||
| "https://myvault.vault.azure.net/secrets/mysecret/1234567890abcdef1234567890abcdef" | ||
| ], | ||
| "minLength": 1 | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "examples": [ | ||
| { | ||
| "uri": "https://myvault.vault.azure.net/secrets/database-connection-string" | ||
| }, | ||
| { | ||
| "uri": "https://myvault.vault.azure.net/secrets/api-key/1234567890abcdef1234567890abcdef" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,37 @@ | ||
| # Azure App Configuration Special Types | ||
|
|
||
| Azure App Configuration supports several predefined configuration types that are optimized for specific scenarios and use cases. These special types provide structured data formats with validation and enhanced functionality beyond simple key-value pairs. | ||
|
|
||
| ## Available Special Types | ||
|
|
||
| ### Key Vault Reference | ||
|
|
||
| A Key Vault Reference allows you to securely store sensitive configuration values in Azure Key Vault while referencing them from Azure App Configuration. This provides an additional layer of security for secrets, connection strings, and other sensitive data. | ||
|
|
||
| **Use Cases:** | ||
| - Database connection strings | ||
| - API keys and secrets | ||
| - Certificates and passwords | ||
| - Any sensitive configuration data | ||
|
|
||
| **Schema:** [KeyVaultReference.v1.0.0.schema.json](KeyVaultReference.v1.0.0.schema.json) | ||
|
|
||
| ### AI Chat Configuration | ||
|
|
||
| AI Chat Configuration provides a structured format for configuring AI chat applications, particularly those using Azure OpenAI or other chat completion services. This configuration type enables dynamic adjustment of AI parameters without requiring application restarts. | ||
|
|
||
| **Use Cases:** | ||
| - Chat completion parameters (temperature, max tokens, etc.) | ||
| - System prompts and conversation context | ||
| - Model selection and fine-tuning parameters | ||
| - Response formatting and behavior controls | ||
|
|
||
| **Schema:** [AIChatConfiguration.v1.0.0.schema.json](AIChatConfiguration.v1.0.0.schema.json) | ||
|
|
||
| ## Benefits of Special Types | ||
|
|
||
| - **Validation**: Built-in schema validation ensures configuration correctness | ||
| - **Type Safety**: Structured data with well-defined properties and constraints | ||
| - **Documentation**: Self-documenting configuration with clear property descriptions | ||
| - **Tooling Support**: Enhanced IDE support and validation during development | ||
| - **Consistency**: Standardized formats across applications and environments |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.