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

[AutoPR azure-ai-openai] [OpenAI] Fix ChatCompletionsNamedFunctionToolSelection #9084

Closed
wants to merge 1 commit into from
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 @@ -9,7 +9,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Parameters for Azure Cognitive Search when used as an Azure OpenAI chat extension.
* Parameters for Azure Cognitive Search when used as an Azure OpenAI chat extension. The supported authentication
* types are APIKey, SystemAssignedManagedIdentity and UserAssignedManagedIdentity.
*/
@Fluent
public final class AzureCognitiveSearchChatExtensionParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
* A specific representation of configurable options for Elasticsearch when using it as an Azure OpenAI chat
* A specific representation of configurable options for Azure Cosmos DB when using it as an Azure OpenAI chat
* extension.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* Parameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB for
* MongoDB vCore.
* MongoDB vCore. The supported authentication type is ConnectionString.
*/
@Fluent
public final class AzureCosmosDBChatExtensionParameters {
Expand Down Expand Up @@ -93,26 +93,6 @@ public final class AzureCosmosDBChatExtensionParameters {
@JsonProperty(value = "embeddingDependency")
private OnYourDataVectorizationSource embeddingDependency;

/**
* Creates an instance of AzureCosmosDBChatExtensionParameters class.
*
* @param databaseName the databaseName value to set.
* @param containerName the containerName value to set.
* @param indexName the indexName value to set.
* @param fieldsMapping the fieldsMapping value to set.
*/
@Generated
@JsonCreator
public AzureCosmosDBChatExtensionParameters(@JsonProperty(value = "databaseName") String databaseName,
@JsonProperty(value = "containerName") String containerName,
@JsonProperty(value = "indexName") String indexName,
@JsonProperty(value = "fieldsMapping") AzureCosmosDBFieldMappingOptions fieldsMapping) {
this.databaseName = databaseName;
this.containerName = containerName;
this.indexName = indexName;
this.fieldsMapping = fieldsMapping;
}

/**
* Get the authentication property: The authentication method to use when accessing the defined data source.
* Each data source type supports a specific set of available authentication methods; please see the documentation
Expand Down Expand Up @@ -290,15 +270,25 @@ public OnYourDataVectorizationSource getEmbeddingDependency() {
}

/**
* Set the embeddingDependency property: The embedding dependency for vector search.
* Creates an instance of AzureCosmosDBChatExtensionParameters class.
*
* @param databaseName the databaseName value to set.
* @param containerName the containerName value to set.
* @param indexName the indexName value to set.
* @param fieldsMapping the fieldsMapping value to set.
* @param embeddingDependency the embeddingDependency value to set.
* @return the AzureCosmosDBChatExtensionParameters object itself.
*/
@Generated
public AzureCosmosDBChatExtensionParameters
setEmbeddingDependency(OnYourDataVectorizationSource embeddingDependency) {
@JsonCreator
public AzureCosmosDBChatExtensionParameters(@JsonProperty(value = "databaseName") String databaseName,
@JsonProperty(value = "containerName") String containerName,
@JsonProperty(value = "indexName") String indexName,
@JsonProperty(value = "fieldsMapping") AzureCosmosDBFieldMappingOptions fieldsMapping,
@JsonProperty(value = "embeddingDependency") OnYourDataVectorizationSource embeddingDependency) {
this.databaseName = databaseName;
this.containerName = containerName;
this.indexName = indexName;
this.fieldsMapping = fieldsMapping;
this.embeddingDependency = embeddingDependency;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.ai.openai.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
* Optional settings to control how fields are processed when using a configured Azure Cosmos DB resource.
*/
@Immutable
@Fluent
public final class AzureCosmosDBFieldMappingOptions {

/*
Expand All @@ -22,24 +22,160 @@ public final class AzureCosmosDBFieldMappingOptions {
@JsonProperty(value = "vectorFields")
private List<String> vectorFields;

/**
* Get the vectorFields property: The names of fields that represent vector data.
*
* @return the vectorFields value.
*/
@Generated
public List<String> getVectorFields() {
return this.vectorFields;
}

/*
* The name of the index field to use as a title.
*/
@Generated
@JsonProperty(value = "titleField")
private String titleField;

/*
* The name of the index field to use as a URL.
*/
@Generated
@JsonProperty(value = "urlField")
private String urlField;

/*
* The name of the index field to use as a filepath.
*/
@Generated
@JsonProperty(value = "filepathField")
private String filepathField;

/*
* The names of index fields that should be treated as content.
*/
@Generated
@JsonProperty(value = "contentFields")
private List<String> contentFields;

/*
* The separator pattern that content fields should use.
*/
@Generated
@JsonProperty(value = "contentFieldsSeparator")
private String contentFieldsSeparator;

/**
* Creates an instance of AzureCosmosDBFieldMappingOptions class.
*
* @param contentFields the contentFields value to set.
* @param vectorFields the vectorFields value to set.
*/
@Generated
@JsonCreator
public AzureCosmosDBFieldMappingOptions(@JsonProperty(value = "vectorFields") List<String> vectorFields) {
public AzureCosmosDBFieldMappingOptions(@JsonProperty(value = "contentFields") List<String> contentFields,
@JsonProperty(value = "vectorFields") List<String> vectorFields) {
this.contentFields = contentFields;
this.vectorFields = vectorFields;
}

/**
* Get the vectorFields property: The names of fields that represent vector data.
* Get the titleField property: The name of the index field to use as a title.
*
* @return the vectorFields value.
* @return the titleField value.
*/
@Generated
public List<String> getVectorFields() {
return this.vectorFields;
public String getTitleField() {
return this.titleField;
}

/**
* Set the titleField property: The name of the index field to use as a title.
*
* @param titleField the titleField value to set.
* @return the AzureCosmosDBFieldMappingOptions object itself.
*/
@Generated
public AzureCosmosDBFieldMappingOptions setTitleField(String titleField) {
this.titleField = titleField;
return this;
}

/**
* Get the urlField property: The name of the index field to use as a URL.
*
* @return the urlField value.
*/
@Generated
public String getUrlField() {
return this.urlField;
}

/**
* Set the urlField property: The name of the index field to use as a URL.
*
* @param urlField the urlField value to set.
* @return the AzureCosmosDBFieldMappingOptions object itself.
*/
@Generated
public AzureCosmosDBFieldMappingOptions setUrlField(String urlField) {
this.urlField = urlField;
return this;
}

/**
* Get the filepathField property: The name of the index field to use as a filepath.
*
* @return the filepathField value.
*/
@Generated
public String getFilepathField() {
return this.filepathField;
}

/**
* Set the filepathField property: The name of the index field to use as a filepath.
*
* @param filepathField the filepathField value to set.
* @return the AzureCosmosDBFieldMappingOptions object itself.
*/
@Generated
public AzureCosmosDBFieldMappingOptions setFilepathField(String filepathField) {
this.filepathField = filepathField;
return this;
}

/**
* Get the contentFields property: The names of index fields that should be treated as content.
*
* @return the contentFields value.
*/
@Generated
public List<String> getContentFields() {
return this.contentFields;
}

/**
* Get the contentFieldsSeparator property: The separator pattern that content fields should use.
*
* @return the contentFieldsSeparator value.
*/
@Generated
public String getContentFieldsSeparator() {
return this.contentFieldsSeparator;
}

/**
* Set the contentFieldsSeparator property: The separator pattern that content fields should use.
*
* @param contentFieldsSeparator the contentFieldsSeparator value to set.
* @return the AzureCosmosDBFieldMappingOptions object itself.
*/
@Generated
public AzureCosmosDBFieldMappingOptions setContentFieldsSeparator(String contentFieldsSeparator) {
this.contentFieldsSeparator = contentFieldsSeparator;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Parameters for the Azure Machine Learning vector index chat extension.
* Parameters for the Azure Machine Learning vector index chat extension. The supported authentication types are
* AccessToken, SystemAssignedManagedIdentity and UserAssignedManagedIdentity.
*/
@Fluent
public final class AzureMachineLearningIndexChatExtensionParameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.ai.openai.models;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* A tool selection of a specific, named function tool that will limit chat completions to using the named function.
*/
@Immutable
public final class ChatCompletionsFunctionToolSelection {
/*
* The name of the function that should be called.
*/
@Generated
@JsonProperty(value = "name")
private String name;

/**
* Creates an instance of ChatCompletionsFunctionToolSelection class.
*
* @param name the name value to set.
*/
@Generated
@JsonCreator
public ChatCompletionsFunctionToolSelection(@JsonProperty(value = "name") String name) {
this.name = name;
}

/**
* Get the name property: The name of the function that should be called.
*
* @return the name value.
*/
@Generated
public String getName() {
return this.name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,31 @@
public final class ChatCompletionsNamedFunctionToolSelection extends ChatCompletionsNamedToolSelection {

/*
* The name of the function that should be called.
* The function that should be called.
*/
@Generated
@JsonProperty(value = "name")
private String name;
@JsonProperty(value = "function")
private ChatCompletionsFunctionToolSelection function;

/**
* Get the name property: The name of the function that should be called.
* Creates an instance of ChatCompletionsNamedFunctionToolSelection class.
*
* @return the name value.
* @param function the function value to set.
*/
@Generated
public String getName() {
return this.name;
@JsonCreator
public ChatCompletionsNamedFunctionToolSelection(
@JsonProperty(value = "function") ChatCompletionsFunctionToolSelection function) {
this.function = function;
}

/**
* Creates an instance of ChatCompletionsNamedFunctionToolSelection class.
* Get the function property: The function that should be called.
*
* @param name the name value to set.
* @return the function value.
*/
@Generated
@JsonCreator
public ChatCompletionsNamedFunctionToolSelection(@JsonProperty(value = "name") String name) {
this.name = name;
public ChatCompletionsFunctionToolSelection getFunction() {
return this.function;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Parameters to use when configuring Elasticsearch® as an Azure OpenAI chat extension.
* Parameters to use when configuring Elasticsearch® as an Azure OpenAI chat extension. The supported authentication
* types are KeyAndKeyId and EncodedAPIKey.
*/
@Fluent
public final class ElasticsearchChatExtensionParameters {
Expand Down
Loading
Loading