Skip to content

Commit 211a885

Browse files
mrm9084rossgrambo
andauthored
Configuration Type Schemas (#1107)
* Configuration Types * Update docs/Configuration Types/AIChatConfiguration.v1.0.0.schema.json Co-authored-by: Ross Grambo <[email protected]> * rename folder --------- Co-authored-by: Ross Grambo <[email protected]>
1 parent 7d0de7a commit 211a885

File tree

3 files changed

+340
-0
lines changed

3 files changed

+340
-0
lines changed
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://azconfig.io/schemas/SpecialTypes/v1.0.0/AIChatConfiguration.json",
4+
"title": "Azure App Configuration AI Chat Configuration Value",
5+
"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",
6+
"type": "object",
7+
"required": [
8+
"model"
9+
],
10+
"properties": {
11+
"model": {
12+
"$id": "#/properties/model",
13+
"type": "string",
14+
"title": "Model Name",
15+
"description": "The name of the AI model to use for chat completion (e.g., 'gpt-4o', 'gpt-3.5-turbo')",
16+
"examples": [
17+
"gpt-4o",
18+
"gpt-4",
19+
"gpt-3.5-turbo",
20+
"gpt-4-turbo"
21+
],
22+
"minLength": 1
23+
},
24+
"messages": {
25+
"$id": "#/properties/messages",
26+
"type": "array",
27+
"title": "Messages",
28+
"description": "An array of messages that define the conversation context, including system prompts and initial conversation history",
29+
"items": {
30+
"$ref": "#/$defs/Message"
31+
},
32+
"default": []
33+
},
34+
"max_tokens": {
35+
"$id": "#/properties/max_tokens",
36+
"type": "integer",
37+
"title": "Maximum Tokens",
38+
"description": "The maximum number of tokens to generate in the chat completion response",
39+
"minimum": 1,
40+
"maximum": 32768,
41+
"examples": [
42+
1000,
43+
2000,
44+
4000
45+
]
46+
},
47+
"temperature": {
48+
"$id": "#/properties/temperature",
49+
"type": "number",
50+
"title": "Temperature",
51+
"description": "Controls randomness in the response. Higher values make output more random, lower values make it more focused and deterministic",
52+
"minimum": 0,
53+
"maximum": 2,
54+
"examples": [
55+
0.7,
56+
0.9,
57+
0.1
58+
]
59+
},
60+
"top_p": {
61+
"$id": "#/properties/top_p",
62+
"type": "number",
63+
"title": "Top P",
64+
"description": "Controls diversity via nucleus sampling. Consider only tokens with top_p probability mass",
65+
"minimum": 0,
66+
"maximum": 1,
67+
"examples": [
68+
0.95,
69+
0.9,
70+
1.0
71+
]
72+
},
73+
"frequency_penalty": {
74+
"$id": "#/properties/frequency_penalty",
75+
"type": "number",
76+
"title": "Frequency Penalty",
77+
"description": "Penalizes new tokens based on their existing frequency in the text so far, decreasing likelihood of repetition",
78+
"minimum": -2,
79+
"maximum": 2,
80+
"default": 0
81+
},
82+
"presence_penalty": {
83+
"$id": "#/properties/presence_penalty",
84+
"type": "number",
85+
"title": "Presence Penalty",
86+
"description": "Penalizes new tokens based on whether they appear in the text so far, increasing likelihood of talking about new topics",
87+
"minimum": -2,
88+
"maximum": 2,
89+
"default": 0
90+
},
91+
"stop": {
92+
"$id": "#/properties/stop",
93+
"title": "Stop Sequences",
94+
"description": "Up to 4 sequences where the API will stop generating further tokens",
95+
"anyOf": [
96+
{
97+
"type": "string"
98+
},
99+
{
100+
"type": "array",
101+
"items": {
102+
"type": "string"
103+
},
104+
"maxItems": 4
105+
},
106+
{
107+
"type": "null"
108+
}
109+
]
110+
},
111+
"response_format": {
112+
"$id": "#/properties/response_format",
113+
"type": "object",
114+
"title": "Response Format",
115+
"description": "An object specifying the format that the model must output",
116+
"properties": {
117+
"type": {
118+
"type": "string",
119+
"title": "Response Type",
120+
"description": "The type of response format to use",
121+
"enum": [
122+
"text",
123+
"json_object"
124+
],
125+
"examples": [
126+
"text",
127+
"json_object"
128+
]
129+
}
130+
},
131+
"required": [
132+
"type"
133+
],
134+
"additionalProperties": false
135+
},
136+
"stream": {
137+
"$id": "#/properties/stream",
138+
"type": "boolean",
139+
"title": "Stream",
140+
"description": "If set to true, partial message deltas will be sent as data-only server-sent events",
141+
"default": false,
142+
"examples": [
143+
true,
144+
false
145+
]
146+
},
147+
"user": {
148+
"$id": "#/properties/user",
149+
"type": "string",
150+
"title": "User ID",
151+
"description": "A unique identifier representing your end-user, which can help AI providers to monitor and detect abuse",
152+
"maxLength": 256,
153+
"examples": [
154+
"user-123",
155+
"user-id",
156+
157+
]
158+
},
159+
"seed": {
160+
"$id": "#/properties/seed",
161+
"type": "integer",
162+
"title": "Seed",
163+
"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",
164+
"minimum": -9223372036854775808,
165+
"maximum": 9223372036854775807,
166+
"examples": [
167+
123,
168+
456,
169+
789
170+
]
171+
}
172+
},
173+
"additionalProperties": false,
174+
"$defs": {
175+
"Message": {
176+
"type": "object",
177+
"title": "Chat Message",
178+
"description": "A single message in the chat conversation with role and content",
179+
"required": [
180+
"role"
181+
],
182+
"properties": {
183+
"role": {
184+
"type": "string",
185+
"title": "Message Role",
186+
"description": "The role of the message sender",
187+
"enum": [
188+
"system",
189+
"user",
190+
"assistant",
191+
"function",
192+
"tool"
193+
],
194+
"examples": [
195+
"system",
196+
"user",
197+
"assistant"
198+
]
199+
},
200+
"content": {
201+
"title": "Message Content",
202+
"description": "The content of the message",
203+
"anyOf": [
204+
{
205+
"type": "string"
206+
},
207+
{
208+
"type": "null"
209+
}
210+
],
211+
"examples": [
212+
"You are a helpful assistant.",
213+
"Hello, how can I help you today?",
214+
"I'm looking for information about machine learning."
215+
]
216+
},
217+
"name": {
218+
"type": "string",
219+
"title": "Message Name",
220+
"description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role",
221+
"pattern": "^[a-zA-Z0-9_-]+$",
222+
"maxLength": 64
223+
}
224+
},
225+
"additionalProperties": false
226+
}
227+
},
228+
"examples": [
229+
{
230+
"model": "gpt-4o",
231+
"messages": [
232+
{
233+
"role": "system",
234+
"content": "You are a helpful assistant."
235+
},
236+
{
237+
"role": "user",
238+
"content": "Test Message"
239+
}
240+
],
241+
"max_tokens": 800,
242+
"temperature": 0.7,
243+
"top_p": 0,
244+
"stop": [
245+
"stop"
246+
],
247+
"frequency_penalty": 0,
248+
"presence_penalty": 0,
249+
"response_format": {
250+
"type": "json_object"
251+
},
252+
"stream": true,
253+
"user": "user-id",
254+
"seed": 123
255+
},
256+
{
257+
"model": "gpt-3.5-turbo",
258+
"max_tokens": 2000,
259+
"temperature": 0.9,
260+
"messages": [
261+
{
262+
"role": "system",
263+
"content": "You are a creative writing assistant."
264+
}
265+
],
266+
"frequency_penalty": 0.1,
267+
"presence_penalty": 0.1
268+
}
269+
]
270+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://azconfig.io/schemas/SpecialTypes/v1.0.0/KeyVaultReference.json",
4+
"title": "Azure App Configuration Key Vault Reference Value",
5+
"description": "A schema for the value part of Azure App Configuration Key Vault References that point to secrets stored in Azure Key Vault",
6+
"type": "object",
7+
"required": [
8+
"uri"
9+
],
10+
"properties": {
11+
"uri": {
12+
"$id": "#/properties/uri",
13+
"type": "string",
14+
"title": "Key Vault Secret URI",
15+
"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.",
16+
"pattern": "^https://[a-zA-Z0-9-]+\\.vault\\.[^/]+/secrets/[a-zA-Z0-9-]+(?:/[a-zA-Z0-9-]+)?$",
17+
"examples": [
18+
"https://myvault.vault.azure.net/secrets/mysecret",
19+
"https://myvault.vault.azure.net/secrets/mysecret/1234567890abcdef1234567890abcdef"
20+
],
21+
"minLength": 1
22+
}
23+
},
24+
"additionalProperties": false,
25+
"examples": [
26+
{
27+
"uri": "https://myvault.vault.azure.net/secrets/database-connection-string"
28+
},
29+
{
30+
"uri": "https://myvault.vault.azure.net/secrets/api-key/1234567890abcdef1234567890abcdef"
31+
}
32+
]
33+
}

docs/ConfigurationTypes/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Azure App Configuration Special Types
2+
3+
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.
4+
5+
## Available Special Types
6+
7+
### Key Vault Reference
8+
9+
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.
10+
11+
**Use Cases:**
12+
- Database connection strings
13+
- API keys and secrets
14+
- Certificates and passwords
15+
- Any sensitive configuration data
16+
17+
**Schema:** [KeyVaultReference.v1.0.0.schema.json](KeyVaultReference.v1.0.0.schema.json)
18+
19+
### AI Chat Configuration
20+
21+
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.
22+
23+
**Use Cases:**
24+
- Chat completion parameters (temperature, max tokens, etc.)
25+
- System prompts and conversation context
26+
- Model selection and fine-tuning parameters
27+
- Response formatting and behavior controls
28+
29+
**Schema:** [AIChatConfiguration.v1.0.0.schema.json](AIChatConfiguration.v1.0.0.schema.json)
30+
31+
## Benefits of Special Types
32+
33+
- **Validation**: Built-in schema validation ensures configuration correctness
34+
- **Type Safety**: Structured data with well-defined properties and constraints
35+
- **Documentation**: Self-documenting configuration with clear property descriptions
36+
- **Tooling Support**: Enhanced IDE support and validation during development
37+
- **Consistency**: Standardized formats across applications and environments

0 commit comments

Comments
 (0)