Skip to content
Merged
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 @@ -236,7 +236,7 @@ Response<BinaryData> retrieveSync(@HostParam("endpoint") String endpoint,
* ]
* activity (Optional): [
* (Optional){
* type: String(searchIndex/azureBlob/indexedOneLake/web/agenticReasoning) (Required)
* type: String(searchIndex/azureBlob/indexedOneLake/web/modelWebSummarization/agenticReasoning) (Required)
* id: int (Required)
* elapsedMs: Integer (Optional)
* error (Optional): {
Expand Down Expand Up @@ -336,7 +336,7 @@ public Mono<Response<BinaryData>> retrieveWithResponseAsync(BinaryData retrieval
* ]
* activity (Optional): [
* (Optional){
* type: String(searchIndex/azureBlob/indexedOneLake/web/agenticReasoning) (Required)
* type: String(searchIndex/azureBlob/indexedOneLake/web/modelWebSummarization/agenticReasoning) (Required)
* id: int (Required)
* elapsedMs: Integer (Optional)
* error (Optional): {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public SearchServiceVersion getServiceVersion() {
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
*
* @param knowledgeBaseName The name of the knowledge base.
* @param retrievalRequest The retrieval request to process.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
Expand All @@ -91,8 +90,8 @@ public SearchServiceVersion getServiceVersion() {
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<KnowledgeBaseRetrievalResult>> retrieveWithResponse(String knowledgeBaseName,
KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) {
public Mono<Response<KnowledgeBaseRetrievalResult>>
retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) {
return mapResponse(
this.serviceClient.retrieveWithResponseAsync(BinaryData.fromObject(retrievalRequest), requestOptions),
KnowledgeBaseRetrievalResult.class);
Expand Down Expand Up @@ -143,7 +142,7 @@ public Mono<Response<KnowledgeBaseRetrievalResult>> retrieveWithResponse(String
* ]
* activity (Optional): [
* (Optional){
* type: String(searchIndex/azureBlob/indexedOneLake/web/agenticReasoning) (Required)
* type: String(searchIndex/azureBlob/indexedOneLake/web/modelWebSummarization/agenticReasoning) (Required)
* id: int (Required)
* elapsedMs: Integer (Optional)
* error (Optional): {
Expand Down Expand Up @@ -216,23 +215,4 @@ public Mono<KnowledgeBaseRetrievalResult> retrieve(KnowledgeBaseRetrievalOptions
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(KnowledgeBaseRetrievalResult.class));
}

/**
* KnowledgeBase retrieves relevant data from backing stores.
*
* @param knowledgeBaseName The name of the knowledge base.
* @param retrievalRequest The retrieval request to process.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the output contract for the retrieval response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<KnowledgeBaseRetrievalResult> retrieve(String knowledgeBaseName,
KnowledgeBaseRetrievalOptions retrievalRequest) {
return retrieveWithResponse(knowledgeBaseName, retrievalRequest, new RequestOptions()).map(Response::getValue);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public SearchServiceVersion getServiceVersion() {
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
*
* @param knowledgeBaseName The name of the knowledge base.
* @param retrievalRequest The retrieval request to process.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
Expand All @@ -88,8 +87,8 @@ public SearchServiceVersion getServiceVersion() {
* @return the output contract for the retrieval response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<KnowledgeBaseRetrievalResult> retrieveWithResponse(String knowledgeBaseName,
KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) {
public Response<KnowledgeBaseRetrievalResult> retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest,
RequestOptions requestOptions) {
return convertResponse(
this.serviceClient.retrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions),
KnowledgeBaseRetrievalResult.class);
Expand Down Expand Up @@ -140,7 +139,7 @@ public Response<KnowledgeBaseRetrievalResult> retrieveWithResponse(String knowle
* ]
* activity (Optional): [
* (Optional){
* type: String(searchIndex/azureBlob/indexedOneLake/web/agenticReasoning) (Required)
* type: String(searchIndex/azureBlob/indexedOneLake/web/modelWebSummarization/agenticReasoning) (Required)
* id: int (Required)
* elapsedMs: Integer (Optional)
* error (Optional): {
Expand Down Expand Up @@ -211,23 +210,4 @@ public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retri
return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions).getValue()
.toObject(KnowledgeBaseRetrievalResult.class);
}

/**
* KnowledgeBase retrieves relevant data from backing stores.
*
* @param knowledgeBaseName The name of the knowledge base.
* @param retrievalRequest The retrieval request to process.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the output contract for the retrieval response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public KnowledgeBaseRetrievalResult retrieve(String knowledgeBaseName,
KnowledgeBaseRetrievalOptions retrievalRequest) {
return retrieveWithResponse(knowledgeBaseName, retrievalRequest, new RequestOptions()).getValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public static KnowledgeBaseActivityRecord fromJson(JsonReader jsonReader) throws
}
}
// Use the discriminator value to determine which subtype should be deserialized.
if ("agenticReasoning".equals(discriminatorValue)) {
if ("modelWebSummarization".equals(discriminatorValue)) {
return KnowledgeBaseModelWebSummarizationActivityRecord.fromJson(readerToUse.reset());
} else if ("agenticReasoning".equals(discriminatorValue)) {
return KnowledgeBaseAgenticReasoningActivityRecord.fromJson(readerToUse.reset());
} else {
return fromJsonKnownDiscriminator(readerToUse.reset());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@ public static KnowledgeBaseActivityRecordType fromString(String name) {
public static Collection<KnowledgeBaseActivityRecordType> values() {
return values(KnowledgeBaseActivityRecordType.class);
}

/**
* LLM web summarization activity.
*/
@Generated
public static final KnowledgeBaseActivityRecordType MODEL_WEB_SUMMARIZATION = fromString("modelWebSummarization");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.search.documents.knowledgebases.models;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Represents an LLM web summarization activity record.
*/
@Immutable
public final class KnowledgeBaseModelWebSummarizationActivityRecord extends KnowledgeBaseActivityRecord {

/*
* The type of the activity record.
*/
@Generated
private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.MODEL_WEB_SUMMARIZATION;

/*
* The number of input tokens for the LLM web summarization activity.
*/
@Generated
private Integer inputTokens;

/*
* The number of output tokens for the LLM web summarization activity.
*/
@Generated
private Integer outputTokens;

/**
* Creates an instance of KnowledgeBaseModelWebSummarizationActivityRecord class.
*
* @param id the id value to set.
*/
@Generated
private KnowledgeBaseModelWebSummarizationActivityRecord(int id) {
super(id);
}

/**
* Get the type property: The type of the activity record.
*
* @return the type value.
*/
@Generated
@Override
public KnowledgeBaseActivityRecordType getType() {
return this.type;
}

/**
* Get the inputTokens property: The number of input tokens for the LLM web summarization activity.
*
* @return the inputTokens value.
*/
@Generated
public Integer getInputTokens() {
return this.inputTokens;
}

/**
* Get the outputTokens property: The number of output tokens for the LLM web summarization activity.
*
* @return the outputTokens value.
*/
@Generated
public Integer getOutputTokens() {
return this.outputTokens;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeIntField("id", getId());
jsonWriter.writeNumberField("elapsedMs", getElapsedMs());
jsonWriter.writeJsonField("error", getError());
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeNumberField("inputTokens", this.inputTokens);
jsonWriter.writeNumberField("outputTokens", this.outputTokens);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of KnowledgeBaseModelWebSummarizationActivityRecord from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of KnowledgeBaseModelWebSummarizationActivityRecord 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 KnowledgeBaseModelWebSummarizationActivityRecord.
*/
@Generated
public static KnowledgeBaseModelWebSummarizationActivityRecord fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
int id = 0;
Integer elapsedMs = null;
KnowledgeBaseErrorDetail error = null;
KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.MODEL_WEB_SUMMARIZATION;
Integer inputTokens = null;
Integer outputTokens = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
id = reader.getInt();
} else if ("elapsedMs".equals(fieldName)) {
elapsedMs = reader.getNullable(JsonReader::getInt);
} else if ("error".equals(fieldName)) {
error = KnowledgeBaseErrorDetail.fromJson(reader);
} else if ("type".equals(fieldName)) {
type = KnowledgeBaseActivityRecordType.fromString(reader.getString());
} else if ("inputTokens".equals(fieldName)) {
inputTokens = reader.getNullable(JsonReader::getInt);
} else if ("outputTokens".equals(fieldName)) {
outputTokens = reader.getNullable(JsonReader::getInt);
} else {
reader.skipChildren();
}
}
KnowledgeBaseModelWebSummarizationActivityRecord deserializedKnowledgeBaseModelWebSummarizationActivityRecord
= new KnowledgeBaseModelWebSummarizationActivityRecord(id);
deserializedKnowledgeBaseModelWebSummarizationActivityRecord.setElapsedMs(elapsedMs);
deserializedKnowledgeBaseModelWebSummarizationActivityRecord.setError(error);
deserializedKnowledgeBaseModelWebSummarizationActivityRecord.type = type;
deserializedKnowledgeBaseModelWebSummarizationActivityRecord.inputTokens = inputTokens;
deserializedKnowledgeBaseModelWebSummarizationActivityRecord.outputTokens = outputTokens;
return deserializedKnowledgeBaseModelWebSummarizationActivityRecord;
});
}
}
Loading
Loading