Skip to content

Commit e794256

Browse files
author
SDKAuto
committed
CodeGen from PR 29297 in Azure/azure-rest-api-specs
Merge d1939e96680a344e2d77e4f25841931bfd09b8aa into 67e8e173b7a52626d07b4bd4001abcb5bd413b34
1 parent 83026f6 commit e794256

77 files changed

Lines changed: 12623 additions & 2655 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsAsyncClient.java

Lines changed: 1138 additions & 210 deletions
Large diffs are not rendered by default.

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClient.java

Lines changed: 1112 additions & 203 deletions
Large diffs are not rendered by default.

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsServiceVersion.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ public enum AssistantsServiceVersion implements ServiceVersion {
1313
/**
1414
* Enum value 2024-02-15-preview.
1515
*/
16-
V2024_02_15_PREVIEW("2024-02-15-preview");
16+
V2024_02_15_PREVIEW("2024-02-15-preview"),
17+
18+
/**
19+
* Enum value 2024-05-01-preview.
20+
*/
21+
V2024_05_01_PREVIEW("2024-05-01-preview");
1722

1823
private final String version;
1924

@@ -35,6 +40,6 @@ public String getVersion() {
3540
* @return The latest {@link AssistantsServiceVersion}.
3641
*/
3742
public static AssistantsServiceVersion getLatest() {
38-
return V2024_02_15_PREVIEW;
43+
return V2024_05_01_PREVIEW;
3944
}
4045
}

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/implementation/AssistantsClientImpl.java

Lines changed: 3454 additions & 1921 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.ai.openai.assistants.implementation.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
import java.util.List;
15+
16+
/**
17+
* The CreateVectorStoreFileBatchRequest model.
18+
*/
19+
@Immutable
20+
public final class CreateVectorStoreFileBatchRequest implements JsonSerializable<CreateVectorStoreFileBatchRequest> {
21+
/*
22+
* A list of File IDs that the vector store should use. Useful for tools like `file_search` that can access files.
23+
*/
24+
@Generated
25+
private final List<String> fileIds;
26+
27+
/**
28+
* Creates an instance of CreateVectorStoreFileBatchRequest class.
29+
*
30+
* @param fileIds the fileIds value to set.
31+
*/
32+
@Generated
33+
public CreateVectorStoreFileBatchRequest(List<String> fileIds) {
34+
this.fileIds = fileIds;
35+
}
36+
37+
/**
38+
* Get the fileIds property: A list of File IDs that the vector store should use. Useful for tools like
39+
* `file_search` that can access files.
40+
*
41+
* @return the fileIds value.
42+
*/
43+
@Generated
44+
public List<String> getFileIds() {
45+
return this.fileIds;
46+
}
47+
48+
/**
49+
* {@inheritDoc}
50+
*/
51+
@Generated
52+
@Override
53+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
54+
jsonWriter.writeStartObject();
55+
jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element));
56+
return jsonWriter.writeEndObject();
57+
}
58+
59+
/**
60+
* Reads an instance of CreateVectorStoreFileBatchRequest from the JsonReader.
61+
*
62+
* @param jsonReader The JsonReader being read.
63+
* @return An instance of CreateVectorStoreFileBatchRequest if the JsonReader was pointing to an instance of it, or
64+
* null if it was pointing to JSON null.
65+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
66+
* @throws IOException If an error occurs while reading the CreateVectorStoreFileBatchRequest.
67+
*/
68+
@Generated
69+
public static CreateVectorStoreFileBatchRequest fromJson(JsonReader jsonReader) throws IOException {
70+
return jsonReader.readObject(reader -> {
71+
List<String> fileIds = null;
72+
while (reader.nextToken() != JsonToken.END_OBJECT) {
73+
String fieldName = reader.getFieldName();
74+
reader.nextToken();
75+
76+
if ("file_ids".equals(fieldName)) {
77+
fileIds = reader.readArray(reader1 -> reader1.getString());
78+
} else {
79+
reader.skipChildren();
80+
}
81+
}
82+
return new CreateVectorStoreFileBatchRequest(fileIds);
83+
});
84+
}
85+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.ai.openai.assistants.implementation.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
15+
/**
16+
* The CreateVectorStoreFileRequest model.
17+
*/
18+
@Immutable
19+
public final class CreateVectorStoreFileRequest implements JsonSerializable<CreateVectorStoreFileRequest> {
20+
/*
21+
* A File ID that the vector store should use. Useful for tools like `file_search` that can access files.
22+
*/
23+
@Generated
24+
private final String fileId;
25+
26+
/**
27+
* Creates an instance of CreateVectorStoreFileRequest class.
28+
*
29+
* @param fileId the fileId value to set.
30+
*/
31+
@Generated
32+
public CreateVectorStoreFileRequest(String fileId) {
33+
this.fileId = fileId;
34+
}
35+
36+
/**
37+
* Get the fileId property: A File ID that the vector store should use. Useful for tools like `file_search` that can
38+
* access files.
39+
*
40+
* @return the fileId value.
41+
*/
42+
@Generated
43+
public String getFileId() {
44+
return this.fileId;
45+
}
46+
47+
/**
48+
* {@inheritDoc}
49+
*/
50+
@Generated
51+
@Override
52+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
53+
jsonWriter.writeStartObject();
54+
jsonWriter.writeStringField("file_id", this.fileId);
55+
return jsonWriter.writeEndObject();
56+
}
57+
58+
/**
59+
* Reads an instance of CreateVectorStoreFileRequest from the JsonReader.
60+
*
61+
* @param jsonReader The JsonReader being read.
62+
* @return An instance of CreateVectorStoreFileRequest if the JsonReader was pointing to an instance of it, or null
63+
* if it was pointing to JSON null.
64+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
65+
* @throws IOException If an error occurs while reading the CreateVectorStoreFileRequest.
66+
*/
67+
@Generated
68+
public static CreateVectorStoreFileRequest fromJson(JsonReader jsonReader) throws IOException {
69+
return jsonReader.readObject(reader -> {
70+
String fileId = null;
71+
while (reader.nextToken() != JsonToken.END_OBJECT) {
72+
String fieldName = reader.getFieldName();
73+
reader.nextToken();
74+
75+
if ("file_id".equals(fieldName)) {
76+
fileId = reader.getString();
77+
} else {
78+
reader.skipChildren();
79+
}
80+
}
81+
return new CreateVectorStoreFileRequest(fileId);
82+
});
83+
}
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.ai.openai.assistants.implementation.models;
6+
7+
import com.azure.ai.openai.assistants.models.VectorStore;
8+
import com.azure.core.annotation.Generated;
9+
import com.azure.core.annotation.Immutable;
10+
import com.azure.json.JsonReader;
11+
import com.azure.json.JsonSerializable;
12+
import com.azure.json.JsonToken;
13+
import com.azure.json.JsonWriter;
14+
import java.io.IOException;
15+
import java.util.List;
16+
17+
/**
18+
* The response data for a requested list of items.
19+
*/
20+
@Immutable
21+
public final class OpenAIPageableListOfVectorStore implements JsonSerializable<OpenAIPageableListOfVectorStore> {
22+
/*
23+
* The object type, which is always list.
24+
*/
25+
@Generated
26+
private final String object = "list";
27+
28+
/*
29+
* The requested list of items.
30+
*/
31+
@Generated
32+
private final List<VectorStore> data;
33+
34+
/*
35+
* The first ID represented in this list.
36+
*/
37+
@Generated
38+
private final String firstId;
39+
40+
/*
41+
* The last ID represented in this list.
42+
*/
43+
@Generated
44+
private final String lastId;
45+
46+
/*
47+
* A value indicating whether there are additional values available not captured in this list.
48+
*/
49+
@Generated
50+
private final boolean hasMore;
51+
52+
/**
53+
* Creates an instance of OpenAIPageableListOfVectorStore class.
54+
*
55+
* @param data the data value to set.
56+
* @param firstId the firstId value to set.
57+
* @param lastId the lastId value to set.
58+
* @param hasMore the hasMore value to set.
59+
*/
60+
@Generated
61+
private OpenAIPageableListOfVectorStore(List<VectorStore> data, String firstId, String lastId, boolean hasMore) {
62+
this.data = data;
63+
this.firstId = firstId;
64+
this.lastId = lastId;
65+
this.hasMore = hasMore;
66+
}
67+
68+
/**
69+
* Get the object property: The object type, which is always list.
70+
*
71+
* @return the object value.
72+
*/
73+
@Generated
74+
public String getObject() {
75+
return this.object;
76+
}
77+
78+
/**
79+
* Get the data property: The requested list of items.
80+
*
81+
* @return the data value.
82+
*/
83+
@Generated
84+
public List<VectorStore> getData() {
85+
return this.data;
86+
}
87+
88+
/**
89+
* Get the firstId property: The first ID represented in this list.
90+
*
91+
* @return the firstId value.
92+
*/
93+
@Generated
94+
public String getFirstId() {
95+
return this.firstId;
96+
}
97+
98+
/**
99+
* Get the lastId property: The last ID represented in this list.
100+
*
101+
* @return the lastId value.
102+
*/
103+
@Generated
104+
public String getLastId() {
105+
return this.lastId;
106+
}
107+
108+
/**
109+
* Get the hasMore property: A value indicating whether there are additional values available not captured in this
110+
* list.
111+
*
112+
* @return the hasMore value.
113+
*/
114+
@Generated
115+
public boolean isHasMore() {
116+
return this.hasMore;
117+
}
118+
119+
/**
120+
* {@inheritDoc}
121+
*/
122+
@Generated
123+
@Override
124+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
125+
jsonWriter.writeStartObject();
126+
jsonWriter.writeStringField("object", this.object);
127+
jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element));
128+
jsonWriter.writeStringField("first_id", this.firstId);
129+
jsonWriter.writeStringField("last_id", this.lastId);
130+
jsonWriter.writeBooleanField("has_more", this.hasMore);
131+
return jsonWriter.writeEndObject();
132+
}
133+
134+
/**
135+
* Reads an instance of OpenAIPageableListOfVectorStore from the JsonReader.
136+
*
137+
* @param jsonReader The JsonReader being read.
138+
* @return An instance of OpenAIPageableListOfVectorStore if the JsonReader was pointing to an instance of it, or
139+
* null if it was pointing to JSON null.
140+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
141+
* @throws IOException If an error occurs while reading the OpenAIPageableListOfVectorStore.
142+
*/
143+
@Generated
144+
public static OpenAIPageableListOfVectorStore fromJson(JsonReader jsonReader) throws IOException {
145+
return jsonReader.readObject(reader -> {
146+
List<VectorStore> data = null;
147+
String firstId = null;
148+
String lastId = null;
149+
boolean hasMore = false;
150+
while (reader.nextToken() != JsonToken.END_OBJECT) {
151+
String fieldName = reader.getFieldName();
152+
reader.nextToken();
153+
154+
if ("data".equals(fieldName)) {
155+
data = reader.readArray(reader1 -> VectorStore.fromJson(reader1));
156+
} else if ("first_id".equals(fieldName)) {
157+
firstId = reader.getString();
158+
} else if ("last_id".equals(fieldName)) {
159+
lastId = reader.getString();
160+
} else if ("has_more".equals(fieldName)) {
161+
hasMore = reader.getBoolean();
162+
} else {
163+
reader.skipChildren();
164+
}
165+
}
166+
return new OpenAIPageableListOfVectorStore(data, firstId, lastId, hasMore);
167+
});
168+
}
169+
}

0 commit comments

Comments
 (0)