Skip to content

Commit

Permalink
[OpenAI] Rename properties for Java (#24596)
Browse files Browse the repository at this point in the history
* renames

* more renames

* testing on the deploymentOrModelName

* revert for no breaking changes
  • Loading branch information
mssfang authored Jul 12, 2023
1 parent 29159d1 commit 82639d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion specification/cognitiveservices/OpenAI.Inference/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ enum ServiceApiVersions {
@TypeSpec.Rest.resource("deployments")
model Deployment {
@visibility("read")
@doc("deployment id of the deployed model")
@doc("Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.")
@projectedName("java", "deploymentOrModelName")
@key
deploymentId: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ model ChatCompletions {
""")
@projectedName("json", "created")
@projectedName("csharp", "InternalCreatedSecondsAfterUnixEpoch")
@projectedName("java", "createdAt")
created: int32;

@doc("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,18 @@ model CompletionsLogProbabilityModel {
@doc("A collection of log probability values for the tokens in this completions data.")
@projectedName("json", "token_logprobs")
@projectedName("csharp", "TokenLogProbabilities")
@projectedName("java", "tokenLogProbabilities")
tokenLogprobs: NullableFloat[];

@doc("A mapping of tokens to maximum log probability values in this completions data.")
@projectedName("json", "top_logprobs")
@projectedName("csharp", "TopLogProbabilities")
@projectedName("java", "topLogProbabilities")
topLogprobs: Record<NullableFloat>[];

@doc("The text offsets associated with tokens in this completions data.")
@projectedName("json", "text_offset")
@projectedName("csharp", "TextOffsets")
@projectedName("java", "textOffsets")
textOffset: int32[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ model EmbeddingItem {
embedding: float32[];

@doc("Index of the prompt to which the EmbeddingItem corresponds.")
@projectedName("java", "promptIndex")
index: int32;
}

Expand Down

0 comments on commit 82639d7

Please sign in to comment.