forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 29297 in Azure/azure-rest-api-specs
Merge b05cf2651969c8c8bc7f38a7fe0e5de1a035f951 into bf9738223ed8c1c25485980b74cfb8ef4158b847
- Loading branch information
SDKAuto
committed
Jun 3, 2024
1 parent
d0c603d
commit e215d56
Showing
77 changed files
with
12,623 additions
and
2,655 deletions.
There are no files selected for viewing
1,348 changes: 1,138 additions & 210 deletions
1,348
...openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
1,315 changes: 1,112 additions & 203 deletions
1,315
...e-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5,375 changes: 3,454 additions & 1,921 deletions
5,375
...nts/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
85 changes: 85 additions & 0 deletions
85
...m/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileBatchRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// 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.assistants.implementation.models; | ||
|
||
import com.azure.core.annotation.Generated; | ||
import com.azure.core.annotation.Immutable; | ||
import com.azure.json.JsonReader; | ||
import com.azure.json.JsonSerializable; | ||
import com.azure.json.JsonToken; | ||
import com.azure.json.JsonWriter; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
/** | ||
* The CreateVectorStoreFileBatchRequest model. | ||
*/ | ||
@Immutable | ||
public final class CreateVectorStoreFileBatchRequest implements JsonSerializable<CreateVectorStoreFileBatchRequest> { | ||
/* | ||
* A list of File IDs that the vector store should use. Useful for tools like `file_search` that can access files. | ||
*/ | ||
@Generated | ||
private final List<String> fileIds; | ||
|
||
/** | ||
* Creates an instance of CreateVectorStoreFileBatchRequest class. | ||
* | ||
* @param fileIds the fileIds value to set. | ||
*/ | ||
@Generated | ||
public CreateVectorStoreFileBatchRequest(List<String> fileIds) { | ||
this.fileIds = fileIds; | ||
} | ||
|
||
/** | ||
* Get the fileIds property: A list of File IDs that the vector store should use. Useful for tools like | ||
* `file_search` that can access files. | ||
* | ||
* @return the fileIds value. | ||
*/ | ||
@Generated | ||
public List<String> getFileIds() { | ||
return this.fileIds; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Generated | ||
@Override | ||
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
jsonWriter.writeStartObject(); | ||
jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); | ||
return jsonWriter.writeEndObject(); | ||
} | ||
|
||
/** | ||
* Reads an instance of CreateVectorStoreFileBatchRequest from the JsonReader. | ||
* | ||
* @param jsonReader The JsonReader being read. | ||
* @return An instance of CreateVectorStoreFileBatchRequest if the JsonReader was pointing to an instance of it, or | ||
* null if it was pointing to JSON null. | ||
* @throws IllegalStateException If the deserialized JSON object was missing any required properties. | ||
* @throws IOException If an error occurs while reading the CreateVectorStoreFileBatchRequest. | ||
*/ | ||
@Generated | ||
public static CreateVectorStoreFileBatchRequest fromJson(JsonReader jsonReader) throws IOException { | ||
return jsonReader.readObject(reader -> { | ||
List<String> fileIds = null; | ||
while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
String fieldName = reader.getFieldName(); | ||
reader.nextToken(); | ||
|
||
if ("file_ids".equals(fieldName)) { | ||
fileIds = reader.readArray(reader1 -> reader1.getString()); | ||
} else { | ||
reader.skipChildren(); | ||
} | ||
} | ||
return new CreateVectorStoreFileBatchRequest(fileIds); | ||
}); | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
...va/com/azure/ai/openai/assistants/implementation/models/CreateVectorStoreFileRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// 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.assistants.implementation.models; | ||
|
||
import com.azure.core.annotation.Generated; | ||
import com.azure.core.annotation.Immutable; | ||
import com.azure.json.JsonReader; | ||
import com.azure.json.JsonSerializable; | ||
import com.azure.json.JsonToken; | ||
import com.azure.json.JsonWriter; | ||
import java.io.IOException; | ||
|
||
/** | ||
* The CreateVectorStoreFileRequest model. | ||
*/ | ||
@Immutable | ||
public final class CreateVectorStoreFileRequest implements JsonSerializable<CreateVectorStoreFileRequest> { | ||
/* | ||
* A File ID that the vector store should use. Useful for tools like `file_search` that can access files. | ||
*/ | ||
@Generated | ||
private final String fileId; | ||
|
||
/** | ||
* Creates an instance of CreateVectorStoreFileRequest class. | ||
* | ||
* @param fileId the fileId value to set. | ||
*/ | ||
@Generated | ||
public CreateVectorStoreFileRequest(String fileId) { | ||
this.fileId = fileId; | ||
} | ||
|
||
/** | ||
* Get the fileId property: A File ID that the vector store should use. Useful for tools like `file_search` that can | ||
* access files. | ||
* | ||
* @return the fileId value. | ||
*/ | ||
@Generated | ||
public String getFileId() { | ||
return this.fileId; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Generated | ||
@Override | ||
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
jsonWriter.writeStartObject(); | ||
jsonWriter.writeStringField("file_id", this.fileId); | ||
return jsonWriter.writeEndObject(); | ||
} | ||
|
||
/** | ||
* Reads an instance of CreateVectorStoreFileRequest from the JsonReader. | ||
* | ||
* @param jsonReader The JsonReader being read. | ||
* @return An instance of CreateVectorStoreFileRequest if the JsonReader was pointing to an instance of it, or null | ||
* if it was pointing to JSON null. | ||
* @throws IllegalStateException If the deserialized JSON object was missing any required properties. | ||
* @throws IOException If an error occurs while reading the CreateVectorStoreFileRequest. | ||
*/ | ||
@Generated | ||
public static CreateVectorStoreFileRequest fromJson(JsonReader jsonReader) throws IOException { | ||
return jsonReader.readObject(reader -> { | ||
String fileId = null; | ||
while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
String fieldName = reader.getFieldName(); | ||
reader.nextToken(); | ||
|
||
if ("file_id".equals(fieldName)) { | ||
fileId = reader.getString(); | ||
} else { | ||
reader.skipChildren(); | ||
} | ||
} | ||
return new CreateVectorStoreFileRequest(fileId); | ||
}); | ||
} | ||
} |
169 changes: 169 additions & 0 deletions
169
...com/azure/ai/openai/assistants/implementation/models/OpenAIPageableListOfVectorStore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
// 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.assistants.implementation.models; | ||
|
||
import com.azure.ai.openai.assistants.models.VectorStore; | ||
import com.azure.core.annotation.Generated; | ||
import com.azure.core.annotation.Immutable; | ||
import com.azure.json.JsonReader; | ||
import com.azure.json.JsonSerializable; | ||
import com.azure.json.JsonToken; | ||
import com.azure.json.JsonWriter; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
/** | ||
* The response data for a requested list of items. | ||
*/ | ||
@Immutable | ||
public final class OpenAIPageableListOfVectorStore implements JsonSerializable<OpenAIPageableListOfVectorStore> { | ||
/* | ||
* The object type, which is always list. | ||
*/ | ||
@Generated | ||
private final String object = "list"; | ||
|
||
/* | ||
* The requested list of items. | ||
*/ | ||
@Generated | ||
private final List<VectorStore> data; | ||
|
||
/* | ||
* The first ID represented in this list. | ||
*/ | ||
@Generated | ||
private final String firstId; | ||
|
||
/* | ||
* The last ID represented in this list. | ||
*/ | ||
@Generated | ||
private final String lastId; | ||
|
||
/* | ||
* A value indicating whether there are additional values available not captured in this list. | ||
*/ | ||
@Generated | ||
private final boolean hasMore; | ||
|
||
/** | ||
* Creates an instance of OpenAIPageableListOfVectorStore class. | ||
* | ||
* @param data the data value to set. | ||
* @param firstId the firstId value to set. | ||
* @param lastId the lastId value to set. | ||
* @param hasMore the hasMore value to set. | ||
*/ | ||
@Generated | ||
private OpenAIPageableListOfVectorStore(List<VectorStore> data, String firstId, String lastId, boolean hasMore) { | ||
this.data = data; | ||
this.firstId = firstId; | ||
this.lastId = lastId; | ||
this.hasMore = hasMore; | ||
} | ||
|
||
/** | ||
* Get the object property: The object type, which is always list. | ||
* | ||
* @return the object value. | ||
*/ | ||
@Generated | ||
public String getObject() { | ||
return this.object; | ||
} | ||
|
||
/** | ||
* Get the data property: The requested list of items. | ||
* | ||
* @return the data value. | ||
*/ | ||
@Generated | ||
public List<VectorStore> getData() { | ||
return this.data; | ||
} | ||
|
||
/** | ||
* Get the firstId property: The first ID represented in this list. | ||
* | ||
* @return the firstId value. | ||
*/ | ||
@Generated | ||
public String getFirstId() { | ||
return this.firstId; | ||
} | ||
|
||
/** | ||
* Get the lastId property: The last ID represented in this list. | ||
* | ||
* @return the lastId value. | ||
*/ | ||
@Generated | ||
public String getLastId() { | ||
return this.lastId; | ||
} | ||
|
||
/** | ||
* Get the hasMore property: A value indicating whether there are additional values available not captured in this | ||
* list. | ||
* | ||
* @return the hasMore value. | ||
*/ | ||
@Generated | ||
public boolean isHasMore() { | ||
return this.hasMore; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Generated | ||
@Override | ||
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
jsonWriter.writeStartObject(); | ||
jsonWriter.writeStringField("object", this.object); | ||
jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); | ||
jsonWriter.writeStringField("first_id", this.firstId); | ||
jsonWriter.writeStringField("last_id", this.lastId); | ||
jsonWriter.writeBooleanField("has_more", this.hasMore); | ||
return jsonWriter.writeEndObject(); | ||
} | ||
|
||
/** | ||
* Reads an instance of OpenAIPageableListOfVectorStore from the JsonReader. | ||
* | ||
* @param jsonReader The JsonReader being read. | ||
* @return An instance of OpenAIPageableListOfVectorStore if the JsonReader was pointing to an instance of it, or | ||
* null if it was pointing to JSON null. | ||
* @throws IllegalStateException If the deserialized JSON object was missing any required properties. | ||
* @throws IOException If an error occurs while reading the OpenAIPageableListOfVectorStore. | ||
*/ | ||
@Generated | ||
public static OpenAIPageableListOfVectorStore fromJson(JsonReader jsonReader) throws IOException { | ||
return jsonReader.readObject(reader -> { | ||
List<VectorStore> data = null; | ||
String firstId = null; | ||
String lastId = null; | ||
boolean hasMore = false; | ||
while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
String fieldName = reader.getFieldName(); | ||
reader.nextToken(); | ||
|
||
if ("data".equals(fieldName)) { | ||
data = reader.readArray(reader1 -> VectorStore.fromJson(reader1)); | ||
} else if ("first_id".equals(fieldName)) { | ||
firstId = reader.getString(); | ||
} else if ("last_id".equals(fieldName)) { | ||
lastId = reader.getString(); | ||
} else if ("has_more".equals(fieldName)) { | ||
hasMore = reader.getBoolean(); | ||
} else { | ||
reader.skipChildren(); | ||
} | ||
} | ||
return new OpenAIPageableListOfVectorStore(data, firstId, lastId, hasMore); | ||
}); | ||
} | ||
} |
Oops, something went wrong.