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

Replace @projectedName("json" -> @encodedName("application/json" #27740

Merged
merged 4 commits into from
Feb 12, 2024
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
18 changes: 9 additions & 9 deletions specification/ai/ImageAnalysis/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ model ImageBoundingBox {

@doc("Width of the area, in pixels.")
@minValue(0)
@projectedName("json", "w")
@encodedName("application/json", "w")
width: int32;

@doc("Height of the area, in pixels.")
@minValue(0)
@projectedName("json", "h")
@encodedName("application/json", "h")
height: int32;
}

Expand Down Expand Up @@ -166,14 +166,14 @@ model DetectedTextBlock {
@doc("Represents the outcome of an Image Analysis operation.")
model ImageAnalysisResult {
@doc("The generated phrase that describes the content of the analyzed image.")
@projectedName("json", "captionResult")
@encodedName("application/json", "captionResult")
caption?: CaptionResult;

@doc("""
The up to 10 generated phrases, the first describing the content of the whole image,
and the others describing the content of different regions of the image.
""")
@projectedName("json", "denseCaptionsResult")
@encodedName("application/json", "denseCaptionsResult")
denseCaptions?: DenseCaptionsResult;

@doc("Metadata associated with the analyzed image.")
Expand All @@ -183,26 +183,26 @@ model ImageAnalysisResult {
modelVersion: string;

@doc("A list of detected physical objects in the analyzed image, and their location.")
@projectedName("json", "objectsResult")
@encodedName("application/json", "objectsResult")
objects?: ObjectsResult;

@doc("A list of detected people in the analyzed image, and their location.")
@projectedName("json", "peopleResult")
@encodedName("application/json", "peopleResult")
people?: PeopleResult;

@doc("The extracted printed and hand-written text in the analyze image. Also knows as OCR.")
@projectedName("json", "readResult")
@encodedName("application/json", "readResult")
read?: ReadResult;

@doc("""
A list of crop regions at the desired as aspect ratios (if provided) that can be used as image thumbnails.
These regions preserve as much content as possible from the analyzed image, with priority given to detected faces.
""")
@projectedName("json", "smartCropsResult")
@encodedName("application/json", "smartCropsResult")
smartCrops?: SmartCropsResult;

@doc("A list of content tags in the analyzed image.")
@projectedName("json", "tagsResult")
@encodedName("application/json", "tagsResult")
tags?: TagsResult;
}

Expand Down
12 changes: 6 additions & 6 deletions specification/ai/OpenAI.Assistants/assistants/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model Assistant {
@doc("The object type, which is always assistant.")
object: "assistant";

@projectedName("json", "created_at")
@encodedName("application/json", "created_at")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
@doc("The Unix timestamp, in seconds, representing when this object was created.")
createdAt: utcDateTime;
Expand All @@ -39,7 +39,7 @@ model Assistant {
@doc("The collection of tools enabled for the assistant.")
tools: ToolDefinition[] = [];

@projectedName("json", "file_ids")
@encodedName("application/json", "file_ids")
@doc("A list of attached file IDs, ordered by creation date in ascending order.")
fileIds: string[] = [];

Expand Down Expand Up @@ -68,7 +68,7 @@ model AssistantCreationOptions {
@doc("The collection of tools to enable for the new assistant.")
tools?: ToolDefinition[] = [];

@projectedName("json", "file_ids")
@encodedName("application/json", "file_ids")
@doc("A list of previously uploaded file IDs to attach to the assistant.")
fileIds?: string[] = [];

Expand Down Expand Up @@ -100,7 +100,7 @@ model UpdateAssistantOptions {
@doc("The modified collection of tools to enable for the assistant.")
tools?: ToolDefinition[] = [];

@projectedName("json", "file_ids")
@encodedName("application/json", "file_ids")
@doc("The modified list of previously uploaded fileIDs to attach to the assistant.")
fileIds?: string[] = [];

Expand All @@ -125,12 +125,12 @@ model AssistantFile {
@doc("The object type, which is always 'assistant.file'.")
object: "assistant.file";

@projectedName("json", "created_at")
@encodedName("application/json", "created_at")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
@doc("The Unix timestamp, in seconds, representing when this object was created.")
createdAt: utcDateTime;

@projectedName("json", "assistant_id")
@encodedName("application/json", "assistant_id")
@doc("The assistant ID that the file is attached to.")
assistantId: string;
}
Expand Down
2 changes: 1 addition & 1 deletion specification/ai/OpenAI.Assistants/assistants/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ op deleteAssistant(@path assistantId: string): AssistantDeletionStatus;
@added(ServiceApiVersions.v2024_02_15_preview)
op createAssistantFile(
@path assistantId: string,
@projectedName("json", "file_id") fileId: string,
@encodedName("application/json", "file_id") fileId: string,
): AssistantFile;

/**
Expand Down
6 changes: 3 additions & 3 deletions specification/ai/OpenAI.Assistants/common/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ model OpenAIPageableListOf<T> {
@doc("The requested list of items.")
data: T[];

@projectedName("json", "first_id")
@encodedName("application/json", "first_id")
@doc("The first ID represented in this list.")
firstId: string;

@projectedName("json", "last_id")
@encodedName("application/json", "last_id")
@doc("The last ID represented in this list.")
lastId: string;

@projectedName("json", "has_more")
@encodedName("application/json", "has_more")
@doc("A value indicating whether there are additional values available not captured in this list.")
hasMore: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion specification/ai/OpenAI.Assistants/files/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ model OpenAIFile {
@doc("The name of the file.")
filename: string;

@projectedName("json", "created_at")
@encodedName("application/json", "created_at")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
@doc("The Unix timestamp, in seconds, representing when this object was created.")
createdAt: utcDateTime;
Expand Down
4 changes: 2 additions & 2 deletions specification/ai/OpenAI.Assistants/files/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ op uploadFile(
@route("/files/{fileId}")
op deleteFile(
@doc("The ID of the file to delete.")
@projectedName("json", "file_id")
@encodedName("application/json", "file_id")
@path
fileId: string,
): FileDeletionStatus;
Expand All @@ -78,6 +78,6 @@ op deleteFile(
op getFile(
@doc("The ID of the file to retrieve.")
@path
@projectedName("json", "file_id")
@encodedName("application/json", "file_id")
fileId: string,
): OpenAIFile;
34 changes: 17 additions & 17 deletions specification/ai/OpenAI.Assistants/messages/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ model ThreadInitializationMessage {
@doc("The textual content of the initial message. Currently, robust input including images and annotated text may only be provided via a separate call to the create message API.")
content: string;

@projectedName("json", "file_ids")
@encodedName("application/json", "file_ids")
@doc("""
A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can
access files.
Expand All @@ -32,12 +32,12 @@ model ThreadMessage {
@doc("The object type, which is always 'thread.message'.")
object: "thread.message";

@projectedName("json", "created_at")
@encodedName("application/json", "created_at")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
@doc("The Unix timestamp, in seconds, representing when this object was created.")
createdAt: utcDateTime;

@projectedName("json", "thread_id")
@encodedName("application/json", "thread_id")
@doc("The ID of the thread that this message belongs to.")
threadId: string;

Expand All @@ -47,15 +47,15 @@ model ThreadMessage {
@doc("The list of content items associated with the assistant thread message.")
content: MessageContent[];

@projectedName("json", "assistant_id")
@encodedName("application/json", "assistant_id")
@doc("If applicable, the ID of the assistant that authored this message.")
assistantId?: string;

@projectedName("json", "run_id")
@encodedName("application/json", "run_id")
@doc("If applicable, the ID of the run associated with the authoring of this message.")
runId?: string;

@projectedName("json", "file_ids")
@encodedName("application/json", "file_ids")
@doc("""
A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can
access files.
Expand Down Expand Up @@ -91,7 +91,7 @@ model MessageImageFileContent extends MessageContent {
@doc("The object type, which is always 'image_file'.")
type: "image_file";

@projectedName("json", "image_file")
@encodedName("application/json", "image_file")
@doc("The image file for this thread message content item.")
imageFile: MessageImageFileDetails;
}
Expand Down Expand Up @@ -120,11 +120,11 @@ model MessageTextAnnotation {
@doc("The textual content associated with this text annotation item.")
text: string;

@projectedName("json", "start_index")
@encodedName("application/json", "start_index")
@doc("The first text index associated with this text annotation.")
startIndex: int32;

@projectedName("json", "end_index")
@encodedName("application/json", "end_index")
@doc("The last text index associated with this text annotation.")
endIndex: int32;
}
Expand All @@ -137,7 +137,7 @@ model MessageTextFileCitationAnnotation extends MessageTextAnnotation {
@doc("The object type, which is always 'file_citation'.")
type: "file_citation";

@projectedName("json", "file_citation")
@encodedName("application/json", "file_citation")
@doc("""
A citation within the message that points to a specific quote from a specific file.
Generated when the assistant uses the "retrieval" tool to search files.
Expand All @@ -148,7 +148,7 @@ model MessageTextFileCitationAnnotation extends MessageTextAnnotation {
@doc("A representation of a file-based text citation, as used in a file-based annotation of text thread message content.")
@added(ServiceApiVersions.v2024_02_15_preview)
model MessageTextFileCitationDetails {
@projectedName("json", "file_id")
@encodedName("application/json", "file_id")
@doc("The ID of the file associated with this citation.")
fileId: string;

Expand All @@ -164,7 +164,7 @@ model MessageTextFilePathAnnotation extends MessageTextAnnotation {
@doc("The object type, which is always 'file_path'.")
type: "file_path";

@projectedName("json", "file_path")
@encodedName("application/json", "file_path")
@doc("A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.")
filePath: MessageTextFilePathDetails;
}
Expand All @@ -173,7 +173,7 @@ model MessageTextFilePathAnnotation extends MessageTextAnnotation {
@added(ServiceApiVersions.v2024_02_15_preview)
model MessageTextFilePathDetails {
@doc("The ID of the specific file that the citation is from.")
@projectedName("json", "file_id")
@encodedName("application/json", "file_id")
fileId: string;
}

Expand All @@ -182,7 +182,7 @@ model MessageTextFilePathDetails {
@doc("An image reference, as represented in thread message content.")
@added(ServiceApiVersions.v2024_02_15_preview)
model MessageImageFileDetails {
@projectedName("json", "file_id")
@encodedName("application/json", "file_id")
@doc("The ID for the file associated with this image.")
fileId: MessageImageFileIdDetails;
}
Expand All @@ -191,7 +191,7 @@ model MessageImageFileDetails {
@added(ServiceApiVersions.v2024_02_15_preview)
model MessageImageFileIdDetails {
@doc("The ID of the specific image file.")
@projectedName("json", "file_id")
@encodedName("application/json", "file_id")
fileId: string;
}

Expand All @@ -206,12 +206,12 @@ model MessageFile {
@doc("The object type, which is always 'thread.message.file'.")
object: "thread.message.file";

@projectedName("json", "created_at")
@encodedName("application/json", "created_at")
@encode(DateTimeKnownEncoding.unixTimestamp, int32)
@doc("The Unix timestamp, in seconds, representing when this object was created.")
createdAt: utcDateTime;

@projectedName("json", "message_id")
@encodedName("application/json", "message_id")
@doc("The ID of the message that this file is attached to.")
messageId: string;
}
2 changes: 1 addition & 1 deletion specification/ai/OpenAI.Assistants/messages/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ op createMessage(
@path threadId: string,
role: MessageRole,
content: string,
@projectedName("json", "file_ids") fileIds?: string[],
@encodedName("application/json", "file_ids") fileIds?: string[],
...OptionalNullableMetadata,
): ThreadMessage;

Expand Down
Loading