Skip to content

Commit

Permalink
Merge pull request #13677 from ashera96/intra-vendor-model-routing
Browse files Browse the repository at this point in the history
Fix AIAPITestCase failure
  • Loading branch information
ashera96 authored Feb 14, 2025
2 parents 3f6ee20 + 0cf516b commit 1b52e24
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public okhttp3.Call llmProvidersLlmProviderIdGetAsync(String llmProviderId, fina
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand All @@ -297,7 +298,7 @@ public okhttp3.Call llmProvidersLlmProviderIdGetAsync(String llmProviderId, fina
<tr><td> 404 </td><td> Not Found. The specified resource does not exist. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call llmProvidersLlmProviderIdPutCall(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, final ApiCallback _callback) throws ApiException {
public okhttp3.Call llmProvidersLlmProviderIdPutCall(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
Expand Down Expand Up @@ -329,6 +330,10 @@ public okhttp3.Call llmProvidersLlmProviderIdPutCall(String llmProviderId, Strin
localVarFormParams.put("apiDefinition", apiDefinition);
}

if (modelList != null) {
localVarFormParams.put("modelList", modelList);
}

final String[] localVarAccepts = {
"application/json"
};
Expand All @@ -348,15 +353,15 @@ public okhttp3.Call llmProvidersLlmProviderIdPutCall(String llmProviderId, Strin
}

@SuppressWarnings("rawtypes")
private okhttp3.Call llmProvidersLlmProviderIdPutValidateBeforeCall(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, final ApiCallback _callback) throws ApiException {
private okhttp3.Call llmProvidersLlmProviderIdPutValidateBeforeCall(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList, final ApiCallback _callback) throws ApiException {

// verify the required parameter 'llmProviderId' is set
if (llmProviderId == null) {
throw new ApiException("Missing the required parameter 'llmProviderId' when calling llmProvidersLlmProviderIdPut(Async)");
}


okhttp3.Call localVarCall = llmProvidersLlmProviderIdPutCall(llmProviderId, name, apiVersion, description, configurations, apiDefinition, _callback);
okhttp3.Call localVarCall = llmProvidersLlmProviderIdPutCall(llmProviderId, name, apiVersion, description, configurations, apiDefinition, modelList, _callback);
return localVarCall;

}
Expand All @@ -370,6 +375,7 @@ private okhttp3.Call llmProvidersLlmProviderIdPutValidateBeforeCall(String llmPr
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @return LLMProviderResponseDTO
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Expand All @@ -380,8 +386,8 @@ private okhttp3.Call llmProvidersLlmProviderIdPutValidateBeforeCall(String llmPr
<tr><td> 404 </td><td> Not Found. The specified resource does not exist. </td><td> - </td></tr>
</table>
*/
public LLMProviderResponseDTO llmProvidersLlmProviderIdPut(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition) throws ApiException {
ApiResponse<LLMProviderResponseDTO> localVarResp = llmProvidersLlmProviderIdPutWithHttpInfo(llmProviderId, name, apiVersion, description, configurations, apiDefinition);
public LLMProviderResponseDTO llmProvidersLlmProviderIdPut(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList) throws ApiException {
ApiResponse<LLMProviderResponseDTO> localVarResp = llmProvidersLlmProviderIdPutWithHttpInfo(llmProviderId, name, apiVersion, description, configurations, apiDefinition, modelList);
return localVarResp.getData();
}

Expand All @@ -394,6 +400,7 @@ public LLMProviderResponseDTO llmProvidersLlmProviderIdPut(String llmProviderId,
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @return ApiResponse&lt;LLMProviderResponseDTO&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Expand All @@ -404,8 +411,8 @@ public LLMProviderResponseDTO llmProvidersLlmProviderIdPut(String llmProviderId,
<tr><td> 404 </td><td> Not Found. The specified resource does not exist. </td><td> - </td></tr>
</table>
*/
public ApiResponse<LLMProviderResponseDTO> llmProvidersLlmProviderIdPutWithHttpInfo(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition) throws ApiException {
okhttp3.Call localVarCall = llmProvidersLlmProviderIdPutValidateBeforeCall(llmProviderId, name, apiVersion, description, configurations, apiDefinition, null);
public ApiResponse<LLMProviderResponseDTO> llmProvidersLlmProviderIdPutWithHttpInfo(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList) throws ApiException {
okhttp3.Call localVarCall = llmProvidersLlmProviderIdPutValidateBeforeCall(llmProviderId, name, apiVersion, description, configurations, apiDefinition, modelList, null);
Type localVarReturnType = new TypeToken<LLMProviderResponseDTO>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
Expand All @@ -419,6 +426,7 @@ public ApiResponse<LLMProviderResponseDTO> llmProvidersLlmProviderIdPutWithHttpI
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand All @@ -430,9 +438,9 @@ public ApiResponse<LLMProviderResponseDTO> llmProvidersLlmProviderIdPutWithHttpI
<tr><td> 404 </td><td> Not Found. The specified resource does not exist. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call llmProvidersLlmProviderIdPutAsync(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, final ApiCallback<LLMProviderResponseDTO> _callback) throws ApiException {
public okhttp3.Call llmProvidersLlmProviderIdPutAsync(String llmProviderId, String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList, final ApiCallback<LLMProviderResponseDTO> _callback) throws ApiException {

okhttp3.Call localVarCall = llmProvidersLlmProviderIdPutValidateBeforeCall(llmProviderId, name, apiVersion, description, configurations, apiDefinition, _callback);
okhttp3.Call localVarCall = llmProvidersLlmProviderIdPutValidateBeforeCall(llmProviderId, name, apiVersion, description, configurations, apiDefinition, modelList, _callback);
Type localVarReturnType = new TypeToken<LLMProviderResponseDTO>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public okhttp3.Call llmProvidersGetAsync(final ApiCallback<LLMProviderSummaryRes
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand All @@ -175,7 +176,7 @@ public okhttp3.Call llmProvidersGetAsync(final ApiCallback<LLMProviderSummaryRes
<tr><td> 400 </td><td> Bad Request. Invalid request or validation error. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call llmProvidersPostCall(String name, String apiVersion, String description, String configurations, File apiDefinition, final ApiCallback _callback) throws ApiException {
public okhttp3.Call llmProvidersPostCall(String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
Expand Down Expand Up @@ -206,6 +207,10 @@ public okhttp3.Call llmProvidersPostCall(String name, String apiVersion, String
localVarFormParams.put("apiDefinition", apiDefinition);
}

if (modelList != null) {
localVarFormParams.put("modelList", modelList);
}

final String[] localVarAccepts = {
"application/json"
};
Expand All @@ -225,10 +230,10 @@ public okhttp3.Call llmProvidersPostCall(String name, String apiVersion, String
}

@SuppressWarnings("rawtypes")
private okhttp3.Call llmProvidersPostValidateBeforeCall(String name, String apiVersion, String description, String configurations, File apiDefinition, final ApiCallback _callback) throws ApiException {
private okhttp3.Call llmProvidersPostValidateBeforeCall(String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList, final ApiCallback _callback) throws ApiException {


okhttp3.Call localVarCall = llmProvidersPostCall(name, apiVersion, description, configurations, apiDefinition, _callback);
okhttp3.Call localVarCall = llmProvidersPostCall(name, apiVersion, description, configurations, apiDefinition, modelList, _callback);
return localVarCall;

}
Expand All @@ -241,6 +246,7 @@ private okhttp3.Call llmProvidersPostValidateBeforeCall(String name, String apiV
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @return LLMProviderResponseDTO
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Expand All @@ -250,8 +256,8 @@ private okhttp3.Call llmProvidersPostValidateBeforeCall(String name, String apiV
<tr><td> 400 </td><td> Bad Request. Invalid request or validation error. </td><td> - </td></tr>
</table>
*/
public LLMProviderResponseDTO llmProvidersPost(String name, String apiVersion, String description, String configurations, File apiDefinition) throws ApiException {
ApiResponse<LLMProviderResponseDTO> localVarResp = llmProvidersPostWithHttpInfo(name, apiVersion, description, configurations, apiDefinition);
public LLMProviderResponseDTO llmProvidersPost(String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList) throws ApiException {
ApiResponse<LLMProviderResponseDTO> localVarResp = llmProvidersPostWithHttpInfo(name, apiVersion, description, configurations, apiDefinition, modelList);
return localVarResp.getData();
}

Expand All @@ -263,6 +269,7 @@ public LLMProviderResponseDTO llmProvidersPost(String name, String apiVersion, S
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @return ApiResponse&lt;LLMProviderResponseDTO&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Expand All @@ -272,8 +279,8 @@ public LLMProviderResponseDTO llmProvidersPost(String name, String apiVersion, S
<tr><td> 400 </td><td> Bad Request. Invalid request or validation error. </td><td> - </td></tr>
</table>
*/
public ApiResponse<LLMProviderResponseDTO> llmProvidersPostWithHttpInfo(String name, String apiVersion, String description, String configurations, File apiDefinition) throws ApiException {
okhttp3.Call localVarCall = llmProvidersPostValidateBeforeCall(name, apiVersion, description, configurations, apiDefinition, null);
public ApiResponse<LLMProviderResponseDTO> llmProvidersPostWithHttpInfo(String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList) throws ApiException {
okhttp3.Call localVarCall = llmProvidersPostValidateBeforeCall(name, apiVersion, description, configurations, apiDefinition, modelList, null);
Type localVarReturnType = new TypeToken<LLMProviderResponseDTO>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
Expand All @@ -286,6 +293,7 @@ public ApiResponse<LLMProviderResponseDTO> llmProvidersPostWithHttpInfo(String n
* @param description (optional)
* @param configurations LLM Provider configurations (optional)
* @param apiDefinition OpenAPI specification (optional)
* @param modelList List of models supported by the LLM Provider as a stringified JSON array (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand All @@ -296,9 +304,9 @@ public ApiResponse<LLMProviderResponseDTO> llmProvidersPostWithHttpInfo(String n
<tr><td> 400 </td><td> Bad Request. Invalid request or validation error. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call llmProvidersPostAsync(String name, String apiVersion, String description, String configurations, File apiDefinition, final ApiCallback<LLMProviderResponseDTO> _callback) throws ApiException {
public okhttp3.Call llmProvidersPostAsync(String name, String apiVersion, String description, String configurations, File apiDefinition, String modelList, final ApiCallback<LLMProviderResponseDTO> _callback) throws ApiException {

okhttp3.Call localVarCall = llmProvidersPostValidateBeforeCall(name, apiVersion, description, configurations, apiDefinition, _callback);
okhttp3.Call localVarCall = llmProvidersPostValidateBeforeCall(name, apiVersion, description, configurations, apiDefinition, modelList, _callback);
Type localVarReturnType = new TypeToken<LLMProviderResponseDTO>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public class LLMProviderRequestDTO {
@SerializedName(SERIALIZED_NAME_API_DEFINITION)
private File apiDefinition;

public static final String SERIALIZED_NAME_MODEL_LIST = "modelList";
@SerializedName(SERIALIZED_NAME_MODEL_LIST)
private String modelList;


public LLMProviderRequestDTO name(String name) {

Expand Down Expand Up @@ -166,6 +170,29 @@ public void setApiDefinition(File apiDefinition) {
}


public LLMProviderRequestDTO modelList(String modelList) {

this.modelList = modelList;
return this;
}

/**
* List of models supported by the LLM Provider as a stringified JSON array
* @return modelList
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of models supported by the LLM Provider as a stringified JSON array")

public String getModelList() {
return modelList;
}


public void setModelList(String modelList) {
this.modelList = modelList;
}


@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -179,12 +206,13 @@ public boolean equals(Object o) {
Objects.equals(this.apiVersion, llMProviderRequest.apiVersion) &&
Objects.equals(this.description, llMProviderRequest.description) &&
Objects.equals(this.configurations, llMProviderRequest.configurations) &&
Objects.equals(this.apiDefinition, llMProviderRequest.apiDefinition);
Objects.equals(this.apiDefinition, llMProviderRequest.apiDefinition) &&
Objects.equals(this.modelList, llMProviderRequest.modelList);
}

@Override
public int hashCode() {
return Objects.hash(name, apiVersion, description, configurations, apiDefinition);
return Objects.hash(name, apiVersion, description, configurations, apiDefinition, modelList);
}


Expand All @@ -197,6 +225,7 @@ public String toString() {
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" configurations: ").append(toIndentedString(configurations)).append("\n");
sb.append(" apiDefinition: ").append(toIndentedString(apiDefinition)).append("\n");
sb.append(" modelList: ").append(toIndentedString(modelList)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
Loading

0 comments on commit 1b52e24

Please sign in to comment.