Skip to content
Draft
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
15 changes: 13 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"version": "0.2.0",
"configurations": [

{
"name": "Debug AOAI Simulated API",
"type": "debugpy",
Expand All @@ -27,7 +28,17 @@
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Python: Debug Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": false
}
]
}
8 changes: 8 additions & 0 deletions examples/openai_deployment_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
"model": "gpt-3.5-turbo",
"tokensPerMinute" : 100000000
},
"gpt-4-10k-token" : {
"model": "gpt-4",
"tokensPerMinute" : 10000
},
"gpt-4o-10k-token" : {
"model": "gpt-4o",
"tokensPerMinute" : 10000
},
"embedding" : {
"model": "text-embedding-ada-002",
"tokensPerMinute" : 10000
Expand Down
102 changes: 82 additions & 20 deletions http/chat-completions.http
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
"content": "Is this thing on?"
}],
"role": "user",
"content": "Is this thing on?"
}],
"model": "gpt-5-turbo-1",
"max_tokens": 20
}
Expand All @@ -29,13 +29,75 @@ api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
"content": "What is the meaning of life?"
}],
"role": "user",
"content": "What is the meaning of life?"
}],
"model": "gpt-5-turbo-1",
"max_tokens": 2000
}

###
POST {{aoai_endpoint}}/openai/deployments/{{aoai_deployment}}/chat/completions?api-version=2024-10-21
Content-Type: application/json
api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
"content": "What is the meaning of life?"
}],
"model": "gpt-5-turbo-1",
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "CalendarEventResponse",
"strict": true,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"date": {
"type": "string"
},
"participants": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"name",
"date",
"participants"
],
"additionalProperties": false
}
}
},
"max_tokens": 2000
}
###
POST {{aoai_endpoint}}/openai/deployments/{{aoai_deployment}}/chat/completions?api-version=2024-10-21
Content-Type: application/json
api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
"content": "What is the meaning of life?"
}],
"model": "gpt-5-turbo-1",
"response_format": {
"type": "json_schema",
"json_schema": {
}
},
"max_tokens": 2000
}


###
POST {{aoai_endpoint}}/openai/deployments/{{aoai_deployment}}/chat/completions?api-version=2023-12-01-preview
Expand Down Expand Up @@ -125,15 +187,15 @@ api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
"content": "What is the meaning of life?"
}, {
"role": "assistant",
"content": "blank"
}, {
"role": "user",
"content": "What is the meaning of life?"
}],
"role": "user",
"content": "What is the meaning of life?"
}, {
"role": "assistant",
"content": "blank"
}, {
"role": "user",
"content": "What is the meaning of life?"
}],
"model": "gpt-5-turbo-1"
}

Expand All @@ -145,13 +207,13 @@ api-key: {{aoai_key}}

{
"messages": [
{"role": "user", "content": "What is the furthest human-made object from Earth?"},
{"role": "assistant", "content": "As an AI language model, I don't have the latest information on this. However, as of August 2021, the furthest human-made object from Earth is the Voyager 1 spacecraft. It was launched in 1977 and is currently over 14 billion miles away from Earth and is still transmitting data."},
{"role": "user", "content": "What is the furthest human-made object from Earth?"},
{"role": "assistant", "content": "As an AI language model, I don't have the latest information on this. However, as of August 2021, the furthest human-made object from Earth is the Voyager 1 spacecraft. It was launched in 1977 and is currently over 14 billion miles away from Earth and is still transmitting data."},

{"role": "user", "content": "How fast is it travelling?"},
{"role": "assistant", "content": "As of August 2021, Voyager 1 is traveling at a speed of about 17.7 km/s (62,136 km/h or 38,614 miles per hour). This is about 0.006% of the speed of light, which means it would take over 17,000 years to travel one light-year."},
{"role": "user", "content": "How fast is it travelling?"},
{"role": "assistant", "content": "As of August 2021, Voyager 1 is traveling at a speed of about 17.7 km/s (62,136 km/h or 38,614 miles per hour). This is about 0.006% of the speed of light, which means it would take over 17,000 years to travel one light-year."},

{"role": "user", "content": "How much does it weigh?"}
{"role": "user", "content": "How much does it weigh?"}
],
"model": "gpt-5-turbo-1"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from aoai_api_simulator.models import OpenAIChatModel, OpenAIEmbeddingModel, OpenAIWhisperModel

# models: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models

model_catalogue = {
"gpt-3.5-turbo": OpenAIChatModel(name="gpt-3.5-turbo"),
"gpt-3.5-turbo-0613": OpenAIChatModel(name="gpt-3.5-turbo-0613"),
"gpt-3.5-turbo": OpenAIChatModel(name="gpt-3.5-turbo", supports_json_schema=False),
"gpt-3.5-turbo-0613": OpenAIChatModel(name="gpt-3.5-turbo-0613", supports_json_schema=False),
"gpt-4": OpenAIChatModel(name="gpt-4", supports_json_schema=True),
"gpt-4o": OpenAIChatModel(name="gpt-4o", supports_json_schema=True),
"text-embedding-ada-001": OpenAIEmbeddingModel(name="text-embedding-ada-001", supports_custom_dimensions=False),
"text-embedding-ada-002": OpenAIEmbeddingModel(name="text-embedding-ada-002", supports_custom_dimensions=False),
"text-embedding-3-small": OpenAIEmbeddingModel(name="text-embedding-3-small", supports_custom_dimensions=True),
Expand Down
Loading