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

Azure OpenAI: incorporate TypeSpec feedback from 2023-07-01-preview .NET PR feedback #24847

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
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ model ChatMessage {
@projectedName("json", "role")
role: ChatRole;

#suppress "@azure-tools/typespec-azure-core/no-nullable" "we explicitly want a nullable string"
@doc("The text associated with this message payload.")
@projectedName("json", "content")
content?: string;
content: string | null;

@doc("""
The name of the author of this message. `name` is required if role is `function`, and it should be the name of the
Expand Down Expand Up @@ -225,9 +226,9 @@ model ChatCompletions {
represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970.
""")
@projectedName("json", "created")
@projectedName("csharp", "InternalCreatedSecondsAfterUnixEpoch")
@projectedName("java", "createdAt")
created: int32;
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
created: utcDateTime;

@doc("""
The collection of completions choices associated with this completions response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ model Completions {
represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970.
""")
@projectedName("json", "created")
@projectedName("csharp", "InternalCreatedSecondsAfterUnixEpoch")
created: int32;
@projectedName("java", "createdAt")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
created: utcDateTime;

@doc("""
Content filtering results for zero or more prompts in the request. In a streaming request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ model ImagePayload {
@added(ServiceApiVersions.v2023_06_01_Preview)
model ImageGenerations {
@doc("A timestamp when this job or item was created (in unix epochs).")
@projectedName("csharp", "InternalCreatedSecondsAfterUnixEpoch")
created: int64;
@projectedName("json", "created")
@projectedName("java", "createdAt")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
created: utcDateTime;

#suppress "@azure-tools/typespec-autorest/union-unsupported" "openapi v2 not required"
@doc("The images generated by the operator.")
@projectedName("csharp", "InternalEmittedImageResponseItems")
data: ImageLocation[] | ImagePayload[];
}

Expand All @@ -96,7 +97,10 @@ model BatchImageGenerationOperationResponse {
id: string;

@doc("A timestamp when this job or item was created (in unix epochs).")
created: int64;
@projectedName("json", "created")
@projectedName("java", "createdAt")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
created: utcDateTime;

@doc("A timestamp when this operation and its associated images expire and will be deleted (in unix epochs).")
expires?: int64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
},
"created": {
"type": "integer",
"format": "int64",
"format": "unixtime",
"description": "A timestamp when this job or item was created (in unix epochs)."
},
"expires": {
Expand Down Expand Up @@ -492,7 +492,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"choices": {
Expand Down Expand Up @@ -613,11 +613,13 @@
},
"content": {
"type": "string",
"description": "The text associated with this message payload."
"description": "The text associated with this message payload.",
"x-nullable": true
}
},
"required": [
"role"
"role",
"content"
]
},
"ChatRole": {
Expand Down Expand Up @@ -702,7 +704,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"prompt_annotations": {
Expand Down Expand Up @@ -1164,7 +1166,7 @@
"properties": {
"created": {
"type": "integer",
"format": "int64",
"format": "unixtime",
"description": "A timestamp when this job or item was created (in unix epochs)."
},
"data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
},
"created": {
"type": "integer",
"format": "int64",
"format": "unixtime",
"description": "A timestamp when this job or item was created (in unix epochs)."
},
"expires": {
Expand Down Expand Up @@ -492,7 +492,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"choices": {
Expand Down Expand Up @@ -625,7 +625,8 @@
},
"content": {
"type": "string",
"description": "The text associated with this message payload."
"description": "The text associated with this message payload.",
"x-nullable": true
},
"name": {
"type": "string",
Expand All @@ -638,7 +639,8 @@
}
},
"required": [
"role"
"role",
"content"
]
},
"ChatRole": {
Expand Down Expand Up @@ -729,7 +731,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"prompt_annotations": {
Expand Down Expand Up @@ -1235,7 +1237,7 @@
"properties": {
"created": {
"type": "integer",
"format": "int64",
"format": "unixtime",
"description": "A timestamp when this job or item was created (in unix epochs)."
},
"data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"choices": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"choices": {
Expand Down Expand Up @@ -426,11 +426,13 @@
},
"content": {
"type": "string",
"description": "The text associated with this message payload."
"description": "The text associated with this message payload.",
"x-nullable": true
}
},
"required": [
"role"
"role",
"content"
]
},
"ChatRole": {
Expand Down Expand Up @@ -510,7 +512,7 @@
},
"created": {
"type": "integer",
"format": "int32",
"format": "unixtime",
"description": "The first timestamp associated with generation activity for this completions response,\nrepresented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970."
},
"choices": {
Expand Down