-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Motivation and Context We want to ensure we have the same functionality across C#, Python and Java. ### Description These tests generate the requests sent to OpenAI from SK in C#. SK in Python and Java can compare against these requests and verify that they are exactly the same. ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
- Loading branch information
Showing
20 changed files
with
941 additions
and
1 deletion.
There are no files selected for viewing
197 changes: 197 additions & 0 deletions
197
dotnet/src/IntegrationTests/CrossLanguage/Data/LightBulbApi.json
This file contains 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,197 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "Light Bulb API", | ||
"version": "v1" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "https://127.0.0.1" | ||
} | ||
], | ||
"paths": { | ||
"/Lights/{id}": { | ||
"get": { | ||
"operationId": "GetLightById", | ||
"tags": [ | ||
"Lights" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"style": "simple", | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
}, | ||
"put": { | ||
"operationId": "PutLightById", | ||
"tags": [ | ||
"Lights" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"style": "simple", | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/ChangeStateRequest" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/ChangeStateRequest" | ||
} | ||
}, | ||
"application/*+json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/ChangeStateRequest" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"operationId": "DeleteLightById", | ||
"tags": [ | ||
"Lights" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"style": "simple", | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
} | ||
}, | ||
"/Lights": { | ||
"get": { | ||
"operationId": "GetLights", | ||
"tags": [ | ||
"Lights" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "roomId", | ||
"in": "query", | ||
"style": "form", | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
}, | ||
"post": { | ||
"operationId": "CreateLights", | ||
"tags": [ | ||
"Lights" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "roomId", | ||
"in": "query", | ||
"style": "form", | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
}, | ||
{ | ||
"name": "lightName", | ||
"in": "query", | ||
"style": "form", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"ChangeStateRequest": { | ||
"type": "object", | ||
"properties": { | ||
"isOn": { | ||
"type": "boolean", | ||
"description": "Specifies whether the light is turned on or off." | ||
}, | ||
"hexColor": { | ||
"type": "string", | ||
"description": "The hex color code for the light.", | ||
"nullable": true | ||
}, | ||
"brightness": { | ||
"enum": [ | ||
"Low", | ||
"Medium", | ||
"High" | ||
], | ||
"type": "string", | ||
"description": "The brightness level of the light." | ||
}, | ||
"fadeDurationInMilliseconds": { | ||
"type": "integer", | ||
"description": "Duration for the light to fade to the new state, in milliseconds.", | ||
"format": "int32" | ||
}, | ||
"scheduledTime": { | ||
"type": "string", | ||
"description": "The time at which the change should occur.", | ||
"format": "date-time" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"description": "Represents a request to change the state of the light." | ||
} | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
dotnet/src/IntegrationTests/CrossLanguage/Data/LightBulbApiTest.json
This file contains 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,26 @@ | ||
{ | ||
"GetLights": { | ||
"Method": "Get", | ||
"Uri": "https://127.0.0.1/Lights?roomId=1" | ||
}, | ||
"GetLightById": { | ||
"Method": "Get", | ||
"Uri": "https://127.0.0.1/Lights/1" | ||
}, | ||
"DeleteLightById": { | ||
"Method": "Delete", | ||
"Uri": "https://127.0.0.1/Lights/1" | ||
}, | ||
"CreateLights": { | ||
"Method": "Post", | ||
"Uri": "https://127.0.0.1/Lights?roomId=1&lightName=disco" | ||
}, | ||
"PutLightById": { | ||
"Method": "Put", | ||
"Uri": "https://127.0.0.1/Lights/1", | ||
"ContentType": "application/json", | ||
"Body": { | ||
"hexColor": "11EE11" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
dotnet/src/IntegrationTests/CrossLanguage/Data/PromptWithChatRolesTest-HB.yaml
This file contains 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,7 @@ | ||
name: getTimes | ||
description: Gets the time in various cities. | ||
template: | | ||
<message role="user">Can you help me tell the time in Seattle right now?</message> | ||
<message role="assistant">Sure! The time in Seattle is currently 3:00 PM.</message> | ||
<message role="user">What about New York?</message> | ||
template_format: handlebars |
22 changes: 22 additions & 0 deletions
22
dotnet/src/IntegrationTests/CrossLanguage/Data/PromptWithChatRolesTest.json
This file contains 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,22 @@ | ||
{ | ||
"messages": [ | ||
{ | ||
"content": "Can you help me tell the time in Seattle right now?", | ||
"role": "user" | ||
}, | ||
{ | ||
"content": "Sure! The time in Seattle is currently 3:00 PM.", | ||
"role": "assistant" | ||
}, | ||
{ | ||
"content": "What about New York?", | ||
"role": "user" | ||
} | ||
], | ||
"temperature": 1, | ||
"top_p": 1, | ||
"n": 1, | ||
"presence_penalty": 0, | ||
"frequency_penalty": 0, | ||
"model": "Dummy" | ||
} |
14 changes: 14 additions & 0 deletions
14
dotnet/src/IntegrationTests/CrossLanguage/Data/PromptWithComplexObjectsTest.json
This file contains 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,14 @@ | ||
{ | ||
"messages": [ | ||
{ | ||
"content": "Can you help me tell the time in Seattle right now?", | ||
"role": "user" | ||
} | ||
], | ||
"temperature": 1, | ||
"top_p": 1, | ||
"n": 1, | ||
"presence_penalty": 0, | ||
"frequency_penalty": 0, | ||
"model": "Dummy" | ||
} |
18 changes: 18 additions & 0 deletions
18
dotnet/src/IntegrationTests/CrossLanguage/Data/PromptWithHelperFunctionsTest.json
This file contains 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,18 @@ | ||
{ | ||
"messages": [ | ||
{ | ||
"content": "The current time is Sun, 04 Jun 1989 12:11:13 GMT", | ||
"role": "system" | ||
}, | ||
{ | ||
"content": "Can you help me tell the time in Seattle right now?", | ||
"role": "user" | ||
} | ||
], | ||
"temperature": 1, | ||
"top_p": 1, | ||
"n": 1, | ||
"presence_penalty": 0, | ||
"frequency_penalty": 0, | ||
"model": "Dummy" | ||
} |
14 changes: 14 additions & 0 deletions
14
dotnet/src/IntegrationTests/CrossLanguage/Data/PromptWithSimpleVariableTest.json
This file contains 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,14 @@ | ||
{ | ||
"messages": [ | ||
{ | ||
"content": "Can you help me tell the time in Seattle right now?", | ||
"role": "user" | ||
} | ||
], | ||
"temperature": 1, | ||
"top_p": 1, | ||
"n": 1, | ||
"presence_penalty": 0, | ||
"frequency_penalty": 0, | ||
"model": "Dummy" | ||
} |
9 changes: 9 additions & 0 deletions
9
dotnet/src/IntegrationTests/CrossLanguage/Data/PromptWithSimpleVariableTest.yaml
This file contains 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,9 @@ | ||
name: getTimeInCity | ||
description: Gets the time in a specified city. | ||
template: | | ||
<message role="user">Can you help me tell the time in {{$city}} right now?</message> | ||
template_format: semantic-kernel | ||
input_variables: | ||
- name: city | ||
description: City for which time is desired | ||
default: Seattle |
14 changes: 14 additions & 0 deletions
14
dotnet/src/IntegrationTests/CrossLanguage/Data/SimplePromptTest.json
This file contains 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,14 @@ | ||
{ | ||
"messages": [ | ||
{ | ||
"content": "Can you help me tell the time in Seattle right now?", | ||
"role": "user" | ||
} | ||
], | ||
"temperature": 1, | ||
"top_p": 1, | ||
"n": 1, | ||
"presence_penalty": 0, | ||
"frequency_penalty": 0, | ||
"model": "Dummy" | ||
} |
5 changes: 5 additions & 0 deletions
5
dotnet/src/IntegrationTests/CrossLanguage/Data/SimplePromptTest.yaml
This file contains 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,5 @@ | ||
name: getSeattleTime | ||
description: Gets the time in Seattle. | ||
template: | | ||
<message role="user">Can you help me tell the time in Seattle right now?</message> | ||
template_format: semantic-kernel |
Oops, something went wrong.