Skip to content
Closed
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 @@ -15,7 +15,10 @@ public enum OpenAIServiceVersion implements ServiceVersion {
V2023_05_15("2023-05-15"),

/** Enum value 2023-06-01-preview. */
V2023_06_01_PREVIEW("2023-06-01-preview");
V2023_06_01_PREVIEW("2023-06-01-preview"),

/** Enum value 2023-07-01-preview. */
V2023_07_01_PREVIEW("2023-07-01-preview");

private final String version;

Expand All @@ -35,6 +38,6 @@ public String getVersion() {
* @return The latest {@link OpenAIServiceVersion}.
*/
public static OpenAIServiceVersion getLatest() {
return V2023_06_01_PREVIEW;
return V2023_07_01_PREVIEW;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,25 @@ public Response<BinaryData> getEmbeddingsWithResponse(
* {
* id: String (Required)
* created: int (Required)
* prompt_annotations (Optional): [
* (Optional){
* prompt_index: int (Required)
* content_filter_results (Optional): {
* sexual (Required): {
* severity: String(safe/low/medium/high) (Required)
* filtered: boolean (Required)
* }
* violence (Required): (recursive schema, see violence above)
* hate (Required): (recursive schema, see hate above)
* self_harm (Required): (recursive schema, see self_harm above)
* }
* }
* ]
* choices (Required): [
* (Required){
* text: String (Required)
* index: int (Required)
* content_filter_results (Optional): (recursive schema, see content_filter_results above)
* logprobs (Required): {
* tokens (Required): [
* String (Required)
Expand All @@ -548,7 +563,7 @@ public Response<BinaryData> getEmbeddingsWithResponse(
* int (Required)
* ]
* }
* finish_reason: String(stop/length/content_filter) (Required)
* finish_reason: String(stop/length/content_filter/function_call) (Required)
* }
* ]
* usage (Required): {
Expand Down Expand Up @@ -626,10 +641,25 @@ public Mono<Response<BinaryData>> getCompletionsWithResponseAsync(
* {
* id: String (Required)
* created: int (Required)
* prompt_annotations (Optional): [
* (Optional){
* prompt_index: int (Required)
* content_filter_results (Optional): {
* sexual (Required): {
* severity: String(safe/low/medium/high) (Required)
* filtered: boolean (Required)
* }
* violence (Required): (recursive schema, see violence above)
* hate (Required): (recursive schema, see hate above)
* self_harm (Required): (recursive schema, see self_harm above)
* }
* }
* ]
* choices (Required): [
* (Required){
* text: String (Required)
* index: int (Required)
* content_filter_results (Optional): (recursive schema, see content_filter_results above)
* logprobs (Required): {
* tokens (Required): [
* String (Required)
Expand All @@ -646,7 +676,7 @@ public Mono<Response<BinaryData>> getCompletionsWithResponseAsync(
* int (Required)
* ]
* }
* finish_reason: String(stop/length/content_filter) (Required)
* finish_reason: String(stop/length/content_filter/function_call) (Required)
* }
* ]
* usage (Required): {
Expand Down Expand Up @@ -693,10 +723,23 @@ public Response<BinaryData> getCompletionsWithResponse(
* {
* messages (Required): [
* (Required){
* role: String(system/assistant/user) (Required)
* role: String(system/assistant/user/function) (Required)
* content: String (Optional)
* name: String (Optional)
* function_call (Optional): {
* name: String (Required)
* arguments: String (Required)
* }
* }
* ]
* functions (Optional): [
* (Optional){
* name: String (Required)
* description: String (Optional)
* parameters: Object (Optional)
* }
* ]
* function_call: FunctionCallModelBase (Optional)
* max_tokens: Integer (Optional)
* temperature: Double (Optional)
* top_p: Double (Optional)
Expand Down Expand Up @@ -724,12 +767,32 @@ public Response<BinaryData> getCompletionsWithResponse(
* choices (Required): [
* (Required){
* message (Optional): {
* role: String(system/assistant/user) (Required)
* role: String(system/assistant/user/function) (Required)
* content: String (Optional)
* name: String (Optional)
* function_call (Optional): {
* name: String (Required)
* arguments: String (Required)
* }
* }
* index: int (Required)
* finish_reason: String(stop/length/content_filter) (Required)
* finish_reason: String(stop/length/content_filter/function_call) (Required)
* delta (Optional): (recursive schema, see delta above)
* content_filter_results (Optional): {
* sexual (Required): {
* severity: String(safe/low/medium/high) (Required)
* filtered: boolean (Required)
* }
* violence (Required): (recursive schema, see violence above)
* hate (Required): (recursive schema, see hate above)
* self_harm (Required): (recursive schema, see self_harm above)
* }
* }
* ]
* prompt_annotations (Optional): [
* (Optional){
* prompt_index: int (Required)
* content_filter_results (Optional): (recursive schema, see content_filter_results above)
* }
* ]
* usage (Required): {
Expand Down Expand Up @@ -779,10 +842,23 @@ public Mono<Response<BinaryData>> getChatCompletionsWithResponseAsync(
* {
* messages (Required): [
* (Required){
* role: String(system/assistant/user) (Required)
* role: String(system/assistant/user/function) (Required)
* content: String (Optional)
* name: String (Optional)
* function_call (Optional): {
* name: String (Required)
* arguments: String (Required)
* }
* }
* ]
* functions (Optional): [
* (Optional){
* name: String (Required)
* description: String (Optional)
* parameters: Object (Optional)
* }
* ]
* function_call: FunctionCallModelBase (Optional)
* max_tokens: Integer (Optional)
* temperature: Double (Optional)
* top_p: Double (Optional)
Expand Down Expand Up @@ -810,12 +886,32 @@ public Mono<Response<BinaryData>> getChatCompletionsWithResponseAsync(
* choices (Required): [
* (Required){
* message (Optional): {
* role: String(system/assistant/user) (Required)
* role: String(system/assistant/user/function) (Required)
* content: String (Optional)
* name: String (Optional)
* function_call (Optional): {
* name: String (Required)
* arguments: String (Required)
* }
* }
* index: int (Required)
* finish_reason: String(stop/length/content_filter) (Required)
* finish_reason: String(stop/length/content_filter/function_call) (Required)
* delta (Optional): (recursive schema, see delta above)
* content_filter_results (Optional): {
* sexual (Required): {
* severity: String(safe/low/medium/high) (Required)
* filtered: boolean (Required)
* }
* violence (Required): (recursive schema, see violence above)
* hate (Required): (recursive schema, see hate above)
* self_harm (Required): (recursive schema, see self_harm above)
* }
* }
* ]
* prompt_annotations (Optional): [
* (Optional){
* prompt_index: int (Required)
* content_filter_results (Optional): (recursive schema, see content_filter_results above)
* }
* ]
* usage (Required): {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,25 @@ public CompletionsFinishReason getFinishReason() {
public ChatMessage getDelta() {
return this.delta;
}

/*
* Information about the content filtering category (hate, sexual, violence, self_harm), if it
* has been detected, as well as the severity level (very_low, low, medium, high-scale that
* determines the intensity and risk level of harmful content) and if it has been filtered or not.
*/
@Generated
@JsonProperty(value = "content_filter_results")
private ContentFilterResults contentFilterResults;

/**
* Get the contentFilterResults property: Information about the content filtering category (hate, sexual, violence,
* self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that
* determines the intensity and risk level of harmful content) and if it has been filtered or not.
*
* @return the contentFilterResults value.
*/
@Generated
public ContentFilterResults getContentFilterResults() {
return this.contentFilterResults;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,23 @@ public CompletionsUsage getUsage() {
public int getCreatedAt() {
return this.createdAt;
}

/*
* Content filtering results for zero or more prompts in the request. In a streaming request,
* results for different prompts may arrive at different times or in different orders.
*/
@Generated
@JsonProperty(value = "prompt_annotations")
private List<PromptFilterResult> promptFilterResults;

/**
* Get the promptFilterResults property: Content filtering results for zero or more prompts in the request. In a
* streaming request, results for different prompts may arrive at different times or in different orders.
*
* @return the promptFilterResults value.
*/
@Generated
public List<PromptFilterResult> getPromptFilterResults() {
return this.promptFilterResults;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,71 @@ public ChatCompletionsOptions setModel(String model) {
this.model = model;
return this;
}

/*
* A list of functions the model may generate JSON inputs for.
*/
@Generated
@JsonProperty(value = "functions")
private List<FunctionDefinition> functions;

/*
* Controls how the model responds to function calls. "none" means the model does not call a function,
* and responds to the end-user. "auto" means the model can pick between an end-user or calling a function.
* Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
* "none" is the default when no functions are present. "auto" is the default if functions are present.
*/
@Generated
@JsonProperty(value = "function_call")
private FunctionCallModelBase functionCall;

/**
* Get the functions property: A list of functions the model may generate JSON inputs for.
*
* @return the functions value.
*/
@Generated
public List<FunctionDefinition> getFunctions() {
return this.functions;
}

/**
* Set the functions property: A list of functions the model may generate JSON inputs for.
*
* @param functions the functions value to set.
* @return the ChatCompletionsOptions object itself.
*/
@Generated
public ChatCompletionsOptions setFunctions(List<FunctionDefinition> functions) {
this.functions = functions;
return this;
}

/**
* Get the functionCall property: Controls how the model responds to function calls. "none" means the model does not
* call a function, and responds to the end-user. "auto" means the model can pick between an end-user or calling a
* function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
* "none" is the default when no functions are present. "auto" is the default if functions are present.
*
* @return the functionCall value.
*/
@Generated
public FunctionCallModelBase getFunctionCall() {
return this.functionCall;
}

/**
* Set the functionCall property: Controls how the model responds to function calls. "none" means the model does not
* call a function, and responds to the end-user. "auto" means the model can pick between an end-user or calling a
* function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
* "none" is the default when no functions are present. "auto" is the default if functions are present.
*
* @param functionCall the functionCall value to set.
* @return the ChatCompletionsOptions object itself.
*/
@Generated
public ChatCompletionsOptions setFunctionCall(FunctionCallModelBase functionCall) {
this.functionCall = functionCall;
return this;
}
}
Loading