yandex.cloud.api.ai.llm.v1alpha.LlmService Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: yandex/cloud/ai/llm/v1alpha/llm_service.proto
package yandex.cloud.api.ai.llm.v1alpha;
public final class LlmService {
private LlmService() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface InstructRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:yandex.cloud.ai.llm.v1alpha.InstructRequest)
com.google.protobuf.MessageOrBuilder {
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
java.lang.String getModel();
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
com.google.protobuf.ByteString
getModelBytes();
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return Whether the generationOptions field is set.
*/
boolean hasGenerationOptions();
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return The generationOptions.
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions getGenerationOptions();
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder getGenerationOptionsOrBuilder();
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return Whether the instructionText field is set.
*/
boolean hasInstructionText();
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return The instructionText.
*/
java.lang.String getInstructionText();
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return The bytes for instructionText.
*/
com.google.protobuf.ByteString
getInstructionTextBytes();
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return Whether the requestText field is set.
*/
boolean hasRequestText();
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return The requestText.
*/
java.lang.String getRequestText();
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return The bytes for requestText.
*/
com.google.protobuf.ByteString
getRequestTextBytes();
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.InstructionCase getInstructionCase();
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.RequestCase getRequestCase();
}
/**
*
* Describe your query: set generation options, context in the instruction part and query in the request.
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.InstructRequest}
*/
public static final class InstructRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:yandex.cloud.ai.llm.v1alpha.InstructRequest)
InstructRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use InstructRequest.newBuilder() to construct.
private InstructRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private InstructRequest() {
model_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new InstructRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private InstructRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
model_ = s;
break;
}
case 18: {
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder subBuilder = null;
if (generationOptions_ != null) {
subBuilder = generationOptions_.toBuilder();
}
generationOptions_ = input.readMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(generationOptions_);
generationOptions_ = subBuilder.buildPartial();
}
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
instructionCase_ = 3;
instruction_ = s;
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
requestCase_ = 4;
request_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.Builder.class);
}
private int instructionCase_ = 0;
private java.lang.Object instruction_;
public enum InstructionCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
INSTRUCTION_TEXT(3),
INSTRUCTION_NOT_SET(0);
private final int value;
private InstructionCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static InstructionCase valueOf(int value) {
return forNumber(value);
}
public static InstructionCase forNumber(int value) {
switch (value) {
case 3: return INSTRUCTION_TEXT;
case 0: return INSTRUCTION_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public InstructionCase
getInstructionCase() {
return InstructionCase.forNumber(
instructionCase_);
}
private int requestCase_ = 0;
private java.lang.Object request_;
public enum RequestCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
REQUEST_TEXT(4),
REQUEST_NOT_SET(0);
private final int value;
private RequestCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static RequestCase valueOf(int value) {
return forNumber(value);
}
public static RequestCase forNumber(int value) {
switch (value) {
case 4: return REQUEST_TEXT;
case 0: return REQUEST_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public RequestCase
getRequestCase() {
return RequestCase.forNumber(
requestCase_);
}
public static final int MODEL_FIELD_NUMBER = 1;
private volatile java.lang.Object model_;
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
@java.lang.Override
public java.lang.String getModel() {
java.lang.Object ref = model_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
model_ = s;
return s;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getModelBytes() {
java.lang.Object ref = model_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
model_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int GENERATION_OPTIONS_FIELD_NUMBER = 2;
private yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions generationOptions_;
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return Whether the generationOptions field is set.
*/
@java.lang.Override
public boolean hasGenerationOptions() {
return generationOptions_ != null;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return The generationOptions.
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions getGenerationOptions() {
return generationOptions_ == null ? yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.getDefaultInstance() : generationOptions_;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder getGenerationOptionsOrBuilder() {
return getGenerationOptions();
}
public static final int INSTRUCTION_TEXT_FIELD_NUMBER = 3;
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return Whether the instructionText field is set.
*/
public boolean hasInstructionText() {
return instructionCase_ == 3;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return The instructionText.
*/
public java.lang.String getInstructionText() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (instructionCase_ == 3) {
instruction_ = s;
}
return s;
}
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return The bytes for instructionText.
*/
public com.google.protobuf.ByteString
getInstructionTextBytes() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (instructionCase_ == 3) {
instruction_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REQUEST_TEXT_FIELD_NUMBER = 4;
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return Whether the requestText field is set.
*/
public boolean hasRequestText() {
return requestCase_ == 4;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return The requestText.
*/
public java.lang.String getRequestText() {
java.lang.Object ref = "";
if (requestCase_ == 4) {
ref = request_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (requestCase_ == 4) {
request_ = s;
}
return s;
}
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return The bytes for requestText.
*/
public com.google.protobuf.ByteString
getRequestTextBytes() {
java.lang.Object ref = "";
if (requestCase_ == 4) {
ref = request_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (requestCase_ == 4) {
request_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_);
}
if (generationOptions_ != null) {
output.writeMessage(2, getGenerationOptions());
}
if (instructionCase_ == 3) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, instruction_);
}
if (requestCase_ == 4) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, request_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_);
}
if (generationOptions_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getGenerationOptions());
}
if (instructionCase_ == 3) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, instruction_);
}
if (requestCase_ == 4) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, request_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest)) {
return super.equals(obj);
}
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest other = (yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest) obj;
if (!getModel()
.equals(other.getModel())) return false;
if (hasGenerationOptions() != other.hasGenerationOptions()) return false;
if (hasGenerationOptions()) {
if (!getGenerationOptions()
.equals(other.getGenerationOptions())) return false;
}
if (!getInstructionCase().equals(other.getInstructionCase())) return false;
switch (instructionCase_) {
case 3:
if (!getInstructionText()
.equals(other.getInstructionText())) return false;
break;
case 0:
default:
}
if (!getRequestCase().equals(other.getRequestCase())) return false;
switch (requestCase_) {
case 4:
if (!getRequestText()
.equals(other.getRequestText())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + MODEL_FIELD_NUMBER;
hash = (53 * hash) + getModel().hashCode();
if (hasGenerationOptions()) {
hash = (37 * hash) + GENERATION_OPTIONS_FIELD_NUMBER;
hash = (53 * hash) + getGenerationOptions().hashCode();
}
switch (instructionCase_) {
case 3:
hash = (37 * hash) + INSTRUCTION_TEXT_FIELD_NUMBER;
hash = (53 * hash) + getInstructionText().hashCode();
break;
case 0:
default:
}
switch (requestCase_) {
case 4:
hash = (37 * hash) + REQUEST_TEXT_FIELD_NUMBER;
hash = (53 * hash) + getRequestText().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Describe your query: set generation options, context in the instruction part and query in the request.
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.InstructRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:yandex.cloud.ai.llm.v1alpha.InstructRequest)
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.Builder.class);
}
// Construct using yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
model_ = "";
if (generationOptionsBuilder_ == null) {
generationOptions_ = null;
} else {
generationOptions_ = null;
generationOptionsBuilder_ = null;
}
instructionCase_ = 0;
instruction_ = null;
requestCase_ = 0;
request_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_descriptor;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest getDefaultInstanceForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.getDefaultInstance();
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest build() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest buildPartial() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest result = new yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest(this);
result.model_ = model_;
if (generationOptionsBuilder_ == null) {
result.generationOptions_ = generationOptions_;
} else {
result.generationOptions_ = generationOptionsBuilder_.build();
}
if (instructionCase_ == 3) {
result.instruction_ = instruction_;
}
if (requestCase_ == 4) {
result.request_ = request_;
}
result.instructionCase_ = instructionCase_;
result.requestCase_ = requestCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest) {
return mergeFrom((yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest other) {
if (other == yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest.getDefaultInstance()) return this;
if (!other.getModel().isEmpty()) {
model_ = other.model_;
onChanged();
}
if (other.hasGenerationOptions()) {
mergeGenerationOptions(other.getGenerationOptions());
}
switch (other.getInstructionCase()) {
case INSTRUCTION_TEXT: {
instructionCase_ = 3;
instruction_ = other.instruction_;
onChanged();
break;
}
case INSTRUCTION_NOT_SET: {
break;
}
}
switch (other.getRequestCase()) {
case REQUEST_TEXT: {
requestCase_ = 4;
request_ = other.request_;
onChanged();
break;
}
case REQUEST_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int instructionCase_ = 0;
private java.lang.Object instruction_;
public InstructionCase
getInstructionCase() {
return InstructionCase.forNumber(
instructionCase_);
}
public Builder clearInstruction() {
instructionCase_ = 0;
instruction_ = null;
onChanged();
return this;
}
private int requestCase_ = 0;
private java.lang.Object request_;
public RequestCase
getRequestCase() {
return RequestCase.forNumber(
requestCase_);
}
public Builder clearRequest() {
requestCase_ = 0;
request_ = null;
onChanged();
return this;
}
private java.lang.Object model_ = "";
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
public java.lang.String getModel() {
java.lang.Object ref = model_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
model_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
public com.google.protobuf.ByteString
getModelBytes() {
java.lang.Object ref = model_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
model_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @param value The model to set.
* @return This builder for chaining.
*/
public Builder setModel(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
model_ = value;
onChanged();
return this;
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return This builder for chaining.
*/
public Builder clearModel() {
model_ = getDefaultInstance().getModel();
onChanged();
return this;
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @param value The bytes for model to set.
* @return This builder for chaining.
*/
public Builder setModelBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
model_ = value;
onChanged();
return this;
}
private yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions generationOptions_;
private com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder> generationOptionsBuilder_;
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return Whether the generationOptions field is set.
*/
public boolean hasGenerationOptions() {
return generationOptionsBuilder_ != null || generationOptions_ != null;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return The generationOptions.
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions getGenerationOptions() {
if (generationOptionsBuilder_ == null) {
return generationOptions_ == null ? yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.getDefaultInstance() : generationOptions_;
} else {
return generationOptionsBuilder_.getMessage();
}
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder setGenerationOptions(yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions value) {
if (generationOptionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
generationOptions_ = value;
onChanged();
} else {
generationOptionsBuilder_.setMessage(value);
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder setGenerationOptions(
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder builderForValue) {
if (generationOptionsBuilder_ == null) {
generationOptions_ = builderForValue.build();
onChanged();
} else {
generationOptionsBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder mergeGenerationOptions(yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions value) {
if (generationOptionsBuilder_ == null) {
if (generationOptions_ != null) {
generationOptions_ =
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.newBuilder(generationOptions_).mergeFrom(value).buildPartial();
} else {
generationOptions_ = value;
}
onChanged();
} else {
generationOptionsBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder clearGenerationOptions() {
if (generationOptionsBuilder_ == null) {
generationOptions_ = null;
onChanged();
} else {
generationOptions_ = null;
generationOptionsBuilder_ = null;
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder getGenerationOptionsBuilder() {
onChanged();
return getGenerationOptionsFieldBuilder().getBuilder();
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder getGenerationOptionsOrBuilder() {
if (generationOptionsBuilder_ != null) {
return generationOptionsBuilder_.getMessageOrBuilder();
} else {
return generationOptions_ == null ?
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.getDefaultInstance() : generationOptions_;
}
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder>
getGenerationOptionsFieldBuilder() {
if (generationOptionsBuilder_ == null) {
generationOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder>(
getGenerationOptions(),
getParentForChildren(),
isClean());
generationOptions_ = null;
}
return generationOptionsBuilder_;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return Whether the instructionText field is set.
*/
@java.lang.Override
public boolean hasInstructionText() {
return instructionCase_ == 3;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return The instructionText.
*/
@java.lang.Override
public java.lang.String getInstructionText() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (instructionCase_ == 3) {
instruction_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return The bytes for instructionText.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getInstructionTextBytes() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (instructionCase_ == 3) {
instruction_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @param value The instructionText to set.
* @return This builder for chaining.
*/
public Builder setInstructionText(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
instructionCase_ = 3;
instruction_ = value;
onChanged();
return this;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @return This builder for chaining.
*/
public Builder clearInstructionText() {
if (instructionCase_ == 3) {
instructionCase_ = 0;
instruction_ = null;
onChanged();
}
return this;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string instruction_text = 3;
* @param value The bytes for instructionText to set.
* @return This builder for chaining.
*/
public Builder setInstructionTextBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
instructionCase_ = 3;
instruction_ = value;
onChanged();
return this;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return Whether the requestText field is set.
*/
@java.lang.Override
public boolean hasRequestText() {
return requestCase_ == 4;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return The requestText.
*/
@java.lang.Override
public java.lang.String getRequestText() {
java.lang.Object ref = "";
if (requestCase_ == 4) {
ref = request_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (requestCase_ == 4) {
request_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return The bytes for requestText.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getRequestTextBytes() {
java.lang.Object ref = "";
if (requestCase_ == 4) {
ref = request_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (requestCase_ == 4) {
request_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @param value The requestText to set.
* @return This builder for chaining.
*/
public Builder setRequestText(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
requestCase_ = 4;
request_ = value;
onChanged();
return this;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @return This builder for chaining.
*/
public Builder clearRequestText() {
if (requestCase_ == 4) {
requestCase_ = 0;
request_ = null;
onChanged();
}
return this;
}
/**
*
* Text of the instruction. The total length of [instruction_text] and [request_text] should be equal or less to 2500 tokens.
*
*
* string request_text = 4;
* @param value The bytes for requestText to set.
* @return This builder for chaining.
*/
public Builder setRequestTextBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
requestCase_ = 4;
request_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:yandex.cloud.ai.llm.v1alpha.InstructRequest)
}
// @@protoc_insertion_point(class_scope:yandex.cloud.ai.llm.v1alpha.InstructRequest)
private static final yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest();
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public InstructRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new InstructRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface InstructResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:yandex.cloud.ai.llm.v1alpha.InstructResponse)
com.google.protobuf.MessageOrBuilder {
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
java.util.List
getAlternativesList();
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative getAlternatives(int index);
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
int getAlternativesCount();
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder>
getAlternativesOrBuilderList();
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder getAlternativesOrBuilder(
int index);
/**
*
* Number of tokens for instruction text and request text
*
*
* int64 num_prompt_tokens = 2;
* @return The numPromptTokens.
*/
long getNumPromptTokens();
}
/**
*
* Contains a set of alternative responses.
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.InstructResponse}
*/
public static final class InstructResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:yandex.cloud.ai.llm.v1alpha.InstructResponse)
InstructResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use InstructResponse.newBuilder() to construct.
private InstructResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private InstructResponse() {
alternatives_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new InstructResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private InstructResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
alternatives_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
alternatives_.add(
input.readMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.parser(), extensionRegistry));
break;
}
case 16: {
numPromptTokens_ = input.readInt64();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
alternatives_ = java.util.Collections.unmodifiableList(alternatives_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.Builder.class);
}
public static final int ALTERNATIVES_FIELD_NUMBER = 1;
private java.util.List alternatives_;
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
@java.lang.Override
public java.util.List getAlternativesList() {
return alternatives_;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
@java.lang.Override
public java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder>
getAlternativesOrBuilderList() {
return alternatives_;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
@java.lang.Override
public int getAlternativesCount() {
return alternatives_.size();
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative getAlternatives(int index) {
return alternatives_.get(index);
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder getAlternativesOrBuilder(
int index) {
return alternatives_.get(index);
}
public static final int NUM_PROMPT_TOKENS_FIELD_NUMBER = 2;
private long numPromptTokens_;
/**
*
* Number of tokens for instruction text and request text
*
*
* int64 num_prompt_tokens = 2;
* @return The numPromptTokens.
*/
@java.lang.Override
public long getNumPromptTokens() {
return numPromptTokens_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < alternatives_.size(); i++) {
output.writeMessage(1, alternatives_.get(i));
}
if (numPromptTokens_ != 0L) {
output.writeInt64(2, numPromptTokens_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < alternatives_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, alternatives_.get(i));
}
if (numPromptTokens_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, numPromptTokens_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse)) {
return super.equals(obj);
}
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse other = (yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse) obj;
if (!getAlternativesList()
.equals(other.getAlternativesList())) return false;
if (getNumPromptTokens()
!= other.getNumPromptTokens()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getAlternativesCount() > 0) {
hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER;
hash = (53 * hash) + getAlternativesList().hashCode();
}
hash = (37 * hash) + NUM_PROMPT_TOKENS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getNumPromptTokens());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Contains a set of alternative responses.
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.InstructResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:yandex.cloud.ai.llm.v1alpha.InstructResponse)
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.Builder.class);
}
// Construct using yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getAlternativesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (alternativesBuilder_ == null) {
alternatives_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
alternativesBuilder_.clear();
}
numPromptTokens_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_descriptor;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse getDefaultInstanceForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.getDefaultInstance();
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse build() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse buildPartial() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse result = new yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse(this);
int from_bitField0_ = bitField0_;
if (alternativesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
alternatives_ = java.util.Collections.unmodifiableList(alternatives_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.alternatives_ = alternatives_;
} else {
result.alternatives_ = alternativesBuilder_.build();
}
result.numPromptTokens_ = numPromptTokens_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse) {
return mergeFrom((yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse other) {
if (other == yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse.getDefaultInstance()) return this;
if (alternativesBuilder_ == null) {
if (!other.alternatives_.isEmpty()) {
if (alternatives_.isEmpty()) {
alternatives_ = other.alternatives_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureAlternativesIsMutable();
alternatives_.addAll(other.alternatives_);
}
onChanged();
}
} else {
if (!other.alternatives_.isEmpty()) {
if (alternativesBuilder_.isEmpty()) {
alternativesBuilder_.dispose();
alternativesBuilder_ = null;
alternatives_ = other.alternatives_;
bitField0_ = (bitField0_ & ~0x00000001);
alternativesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getAlternativesFieldBuilder() : null;
} else {
alternativesBuilder_.addAllMessages(other.alternatives_);
}
}
}
if (other.getNumPromptTokens() != 0L) {
setNumPromptTokens(other.getNumPromptTokens());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List alternatives_ =
java.util.Collections.emptyList();
private void ensureAlternativesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
alternatives_ = new java.util.ArrayList(alternatives_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder> alternativesBuilder_;
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public java.util.List getAlternativesList() {
if (alternativesBuilder_ == null) {
return java.util.Collections.unmodifiableList(alternatives_);
} else {
return alternativesBuilder_.getMessageList();
}
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public int getAlternativesCount() {
if (alternativesBuilder_ == null) {
return alternatives_.size();
} else {
return alternativesBuilder_.getCount();
}
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative getAlternatives(int index) {
if (alternativesBuilder_ == null) {
return alternatives_.get(index);
} else {
return alternativesBuilder_.getMessage(index);
}
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder setAlternatives(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative value) {
if (alternativesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAlternativesIsMutable();
alternatives_.set(index, value);
onChanged();
} else {
alternativesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder setAlternatives(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder builderForValue) {
if (alternativesBuilder_ == null) {
ensureAlternativesIsMutable();
alternatives_.set(index, builderForValue.build());
onChanged();
} else {
alternativesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder addAlternatives(yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative value) {
if (alternativesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAlternativesIsMutable();
alternatives_.add(value);
onChanged();
} else {
alternativesBuilder_.addMessage(value);
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder addAlternatives(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative value) {
if (alternativesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAlternativesIsMutable();
alternatives_.add(index, value);
onChanged();
} else {
alternativesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder addAlternatives(
yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder builderForValue) {
if (alternativesBuilder_ == null) {
ensureAlternativesIsMutable();
alternatives_.add(builderForValue.build());
onChanged();
} else {
alternativesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder addAlternatives(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder builderForValue) {
if (alternativesBuilder_ == null) {
ensureAlternativesIsMutable();
alternatives_.add(index, builderForValue.build());
onChanged();
} else {
alternativesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder addAllAlternatives(
java.lang.Iterable extends yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative> values) {
if (alternativesBuilder_ == null) {
ensureAlternativesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, alternatives_);
onChanged();
} else {
alternativesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder clearAlternatives() {
if (alternativesBuilder_ == null) {
alternatives_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
alternativesBuilder_.clear();
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public Builder removeAlternatives(int index) {
if (alternativesBuilder_ == null) {
ensureAlternativesIsMutable();
alternatives_.remove(index);
onChanged();
} else {
alternativesBuilder_.remove(index);
}
return this;
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder getAlternativesBuilder(
int index) {
return getAlternativesFieldBuilder().getBuilder(index);
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder getAlternativesOrBuilder(
int index) {
if (alternativesBuilder_ == null) {
return alternatives_.get(index); } else {
return alternativesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder>
getAlternativesOrBuilderList() {
if (alternativesBuilder_ != null) {
return alternativesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(alternatives_);
}
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder addAlternativesBuilder() {
return getAlternativesFieldBuilder().addBuilder(
yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.getDefaultInstance());
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder addAlternativesBuilder(
int index) {
return getAlternativesFieldBuilder().addBuilder(
index, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.getDefaultInstance());
}
/**
*
* Generated alternatives
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Alternative alternatives = 1;
*/
public java.util.List
getAlternativesBuilderList() {
return getAlternativesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder>
getAlternativesFieldBuilder() {
if (alternativesBuilder_ == null) {
alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative, yandex.cloud.api.ai.llm.v1alpha.Llm.Alternative.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.AlternativeOrBuilder>(
alternatives_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
alternatives_ = null;
}
return alternativesBuilder_;
}
private long numPromptTokens_ ;
/**
*
* Number of tokens for instruction text and request text
*
*
* int64 num_prompt_tokens = 2;
* @return The numPromptTokens.
*/
@java.lang.Override
public long getNumPromptTokens() {
return numPromptTokens_;
}
/**
*
* Number of tokens for instruction text and request text
*
*
* int64 num_prompt_tokens = 2;
* @param value The numPromptTokens to set.
* @return This builder for chaining.
*/
public Builder setNumPromptTokens(long value) {
numPromptTokens_ = value;
onChanged();
return this;
}
/**
*
* Number of tokens for instruction text and request text
*
*
* int64 num_prompt_tokens = 2;
* @return This builder for chaining.
*/
public Builder clearNumPromptTokens() {
numPromptTokens_ = 0L;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:yandex.cloud.ai.llm.v1alpha.InstructResponse)
}
// @@protoc_insertion_point(class_scope:yandex.cloud.ai.llm.v1alpha.InstructResponse)
private static final yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse();
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public InstructResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new InstructResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.InstructResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface ChatRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:yandex.cloud.ai.llm.v1alpha.ChatRequest)
com.google.protobuf.MessageOrBuilder {
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
java.lang.String getModel();
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
com.google.protobuf.ByteString
getModelBytes();
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return Whether the generationOptions field is set.
*/
boolean hasGenerationOptions();
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return The generationOptions.
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions getGenerationOptions();
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder getGenerationOptionsOrBuilder();
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return Whether the instructionText field is set.
*/
boolean hasInstructionText();
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return The instructionText.
*/
java.lang.String getInstructionText();
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return The bytes for instructionText.
*/
com.google.protobuf.ByteString
getInstructionTextBytes();
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
java.util.List
getMessagesList();
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.Message getMessages(int index);
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
int getMessagesCount();
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>
getMessagesOrBuilderList();
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder getMessagesOrBuilder(
int index);
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.InstructionCase getInstructionCase();
}
/**
*
* Describe your chat query: set generation options, context in the instruction part and message history.
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.ChatRequest}
*/
public static final class ChatRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:yandex.cloud.ai.llm.v1alpha.ChatRequest)
ChatRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use ChatRequest.newBuilder() to construct.
private ChatRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ChatRequest() {
model_ = "";
messages_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ChatRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ChatRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
model_ = s;
break;
}
case 18: {
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder subBuilder = null;
if (generationOptions_ != null) {
subBuilder = generationOptions_.toBuilder();
}
generationOptions_ = input.readMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(generationOptions_);
generationOptions_ = subBuilder.buildPartial();
}
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
instructionCase_ = 3;
instruction_ = s;
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
messages_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
messages_.add(
input.readMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.Message.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
messages_ = java.util.Collections.unmodifiableList(messages_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.Builder.class);
}
private int instructionCase_ = 0;
private java.lang.Object instruction_;
public enum InstructionCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
INSTRUCTION_TEXT(3),
INSTRUCTION_NOT_SET(0);
private final int value;
private InstructionCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static InstructionCase valueOf(int value) {
return forNumber(value);
}
public static InstructionCase forNumber(int value) {
switch (value) {
case 3: return INSTRUCTION_TEXT;
case 0: return INSTRUCTION_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public InstructionCase
getInstructionCase() {
return InstructionCase.forNumber(
instructionCase_);
}
public static final int MODEL_FIELD_NUMBER = 1;
private volatile java.lang.Object model_;
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
@java.lang.Override
public java.lang.String getModel() {
java.lang.Object ref = model_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
model_ = s;
return s;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getModelBytes() {
java.lang.Object ref = model_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
model_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int GENERATION_OPTIONS_FIELD_NUMBER = 2;
private yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions generationOptions_;
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return Whether the generationOptions field is set.
*/
@java.lang.Override
public boolean hasGenerationOptions() {
return generationOptions_ != null;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return The generationOptions.
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions getGenerationOptions() {
return generationOptions_ == null ? yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.getDefaultInstance() : generationOptions_;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder getGenerationOptionsOrBuilder() {
return getGenerationOptions();
}
public static final int INSTRUCTION_TEXT_FIELD_NUMBER = 3;
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return Whether the instructionText field is set.
*/
public boolean hasInstructionText() {
return instructionCase_ == 3;
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return The instructionText.
*/
public java.lang.String getInstructionText() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (instructionCase_ == 3) {
instruction_ = s;
}
return s;
}
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return The bytes for instructionText.
*/
public com.google.protobuf.ByteString
getInstructionTextBytes() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (instructionCase_ == 3) {
instruction_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MESSAGES_FIELD_NUMBER = 4;
private java.util.List messages_;
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
@java.lang.Override
public java.util.List getMessagesList() {
return messages_;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
@java.lang.Override
public java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>
getMessagesOrBuilderList() {
return messages_;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
@java.lang.Override
public int getMessagesCount() {
return messages_.size();
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message getMessages(int index) {
return messages_.get(index);
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder getMessagesOrBuilder(
int index) {
return messages_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_);
}
if (generationOptions_ != null) {
output.writeMessage(2, getGenerationOptions());
}
if (instructionCase_ == 3) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, instruction_);
}
for (int i = 0; i < messages_.size(); i++) {
output.writeMessage(4, messages_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_);
}
if (generationOptions_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getGenerationOptions());
}
if (instructionCase_ == 3) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, instruction_);
}
for (int i = 0; i < messages_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, messages_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest)) {
return super.equals(obj);
}
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest other = (yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest) obj;
if (!getModel()
.equals(other.getModel())) return false;
if (hasGenerationOptions() != other.hasGenerationOptions()) return false;
if (hasGenerationOptions()) {
if (!getGenerationOptions()
.equals(other.getGenerationOptions())) return false;
}
if (!getMessagesList()
.equals(other.getMessagesList())) return false;
if (!getInstructionCase().equals(other.getInstructionCase())) return false;
switch (instructionCase_) {
case 3:
if (!getInstructionText()
.equals(other.getInstructionText())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + MODEL_FIELD_NUMBER;
hash = (53 * hash) + getModel().hashCode();
if (hasGenerationOptions()) {
hash = (37 * hash) + GENERATION_OPTIONS_FIELD_NUMBER;
hash = (53 * hash) + getGenerationOptions().hashCode();
}
if (getMessagesCount() > 0) {
hash = (37 * hash) + MESSAGES_FIELD_NUMBER;
hash = (53 * hash) + getMessagesList().hashCode();
}
switch (instructionCase_) {
case 3:
hash = (37 * hash) + INSTRUCTION_TEXT_FIELD_NUMBER;
hash = (53 * hash) + getInstructionText().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Describe your chat query: set generation options, context in the instruction part and message history.
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.ChatRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:yandex.cloud.ai.llm.v1alpha.ChatRequest)
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.Builder.class);
}
// Construct using yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getMessagesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
model_ = "";
if (generationOptionsBuilder_ == null) {
generationOptions_ = null;
} else {
generationOptions_ = null;
generationOptionsBuilder_ = null;
}
if (messagesBuilder_ == null) {
messages_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
messagesBuilder_.clear();
}
instructionCase_ = 0;
instruction_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_descriptor;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest getDefaultInstanceForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.getDefaultInstance();
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest build() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest buildPartial() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest result = new yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest(this);
int from_bitField0_ = bitField0_;
result.model_ = model_;
if (generationOptionsBuilder_ == null) {
result.generationOptions_ = generationOptions_;
} else {
result.generationOptions_ = generationOptionsBuilder_.build();
}
if (instructionCase_ == 3) {
result.instruction_ = instruction_;
}
if (messagesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
messages_ = java.util.Collections.unmodifiableList(messages_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.messages_ = messages_;
} else {
result.messages_ = messagesBuilder_.build();
}
result.instructionCase_ = instructionCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest) {
return mergeFrom((yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest other) {
if (other == yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest.getDefaultInstance()) return this;
if (!other.getModel().isEmpty()) {
model_ = other.model_;
onChanged();
}
if (other.hasGenerationOptions()) {
mergeGenerationOptions(other.getGenerationOptions());
}
if (messagesBuilder_ == null) {
if (!other.messages_.isEmpty()) {
if (messages_.isEmpty()) {
messages_ = other.messages_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureMessagesIsMutable();
messages_.addAll(other.messages_);
}
onChanged();
}
} else {
if (!other.messages_.isEmpty()) {
if (messagesBuilder_.isEmpty()) {
messagesBuilder_.dispose();
messagesBuilder_ = null;
messages_ = other.messages_;
bitField0_ = (bitField0_ & ~0x00000001);
messagesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getMessagesFieldBuilder() : null;
} else {
messagesBuilder_.addAllMessages(other.messages_);
}
}
}
switch (other.getInstructionCase()) {
case INSTRUCTION_TEXT: {
instructionCase_ = 3;
instruction_ = other.instruction_;
onChanged();
break;
}
case INSTRUCTION_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int instructionCase_ = 0;
private java.lang.Object instruction_;
public InstructionCase
getInstructionCase() {
return InstructionCase.forNumber(
instructionCase_);
}
public Builder clearInstruction() {
instructionCase_ = 0;
instruction_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object model_ = "";
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
public java.lang.String getModel() {
java.lang.Object ref = model_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
model_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
public com.google.protobuf.ByteString
getModelBytes() {
java.lang.Object ref = model_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
model_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @param value The model to set.
* @return This builder for chaining.
*/
public Builder setModel(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
model_ = value;
onChanged();
return this;
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return This builder for chaining.
*/
public Builder clearModel() {
model_ = getDefaultInstance().getModel();
onChanged();
return this;
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @param value The bytes for model to set.
* @return This builder for chaining.
*/
public Builder setModelBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
model_ = value;
onChanged();
return this;
}
private yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions generationOptions_;
private com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder> generationOptionsBuilder_;
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return Whether the generationOptions field is set.
*/
public boolean hasGenerationOptions() {
return generationOptionsBuilder_ != null || generationOptions_ != null;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
* @return The generationOptions.
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions getGenerationOptions() {
if (generationOptionsBuilder_ == null) {
return generationOptions_ == null ? yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.getDefaultInstance() : generationOptions_;
} else {
return generationOptionsBuilder_.getMessage();
}
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder setGenerationOptions(yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions value) {
if (generationOptionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
generationOptions_ = value;
onChanged();
} else {
generationOptionsBuilder_.setMessage(value);
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder setGenerationOptions(
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder builderForValue) {
if (generationOptionsBuilder_ == null) {
generationOptions_ = builderForValue.build();
onChanged();
} else {
generationOptionsBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder mergeGenerationOptions(yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions value) {
if (generationOptionsBuilder_ == null) {
if (generationOptions_ != null) {
generationOptions_ =
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.newBuilder(generationOptions_).mergeFrom(value).buildPartial();
} else {
generationOptions_ = value;
}
onChanged();
} else {
generationOptionsBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public Builder clearGenerationOptions() {
if (generationOptionsBuilder_ == null) {
generationOptions_ = null;
onChanged();
} else {
generationOptions_ = null;
generationOptionsBuilder_ = null;
}
return this;
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder getGenerationOptionsBuilder() {
onChanged();
return getGenerationOptionsFieldBuilder().getBuilder();
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder getGenerationOptionsOrBuilder() {
if (generationOptionsBuilder_ != null) {
return generationOptionsBuilder_.getMessageOrBuilder();
} else {
return generationOptions_ == null ?
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.getDefaultInstance() : generationOptions_;
}
}
/**
*
* Generation options
*
*
* .yandex.cloud.ai.llm.v1alpha.GenerationOptions generation_options = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder>
getGenerationOptionsFieldBuilder() {
if (generationOptionsBuilder_ == null) {
generationOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptions.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.GenerationOptionsOrBuilder>(
getGenerationOptions(),
getParentForChildren(),
isClean());
generationOptions_ = null;
}
return generationOptionsBuilder_;
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return Whether the instructionText field is set.
*/
@java.lang.Override
public boolean hasInstructionText() {
return instructionCase_ == 3;
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return The instructionText.
*/
@java.lang.Override
public java.lang.String getInstructionText() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (instructionCase_ == 3) {
instruction_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return The bytes for instructionText.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getInstructionTextBytes() {
java.lang.Object ref = "";
if (instructionCase_ == 3) {
ref = instruction_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (instructionCase_ == 3) {
instruction_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @param value The instructionText to set.
* @return This builder for chaining.
*/
public Builder setInstructionText(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
instructionCase_ = 3;
instruction_ = value;
onChanged();
return this;
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @return This builder for chaining.
*/
public Builder clearInstructionText() {
if (instructionCase_ == 3) {
instructionCase_ = 0;
instruction_ = null;
onChanged();
}
return this;
}
/**
*
* Text of the instruction.
*
*
* string instruction_text = 3;
* @param value The bytes for instructionText to set.
* @return This builder for chaining.
*/
public Builder setInstructionTextBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
instructionCase_ = 3;
instruction_ = value;
onChanged();
return this;
}
private java.util.List messages_ =
java.util.Collections.emptyList();
private void ensureMessagesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
messages_ = new java.util.ArrayList(messages_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Message, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder> messagesBuilder_;
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public java.util.List getMessagesList() {
if (messagesBuilder_ == null) {
return java.util.Collections.unmodifiableList(messages_);
} else {
return messagesBuilder_.getMessageList();
}
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public int getMessagesCount() {
if (messagesBuilder_ == null) {
return messages_.size();
} else {
return messagesBuilder_.getCount();
}
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message getMessages(int index) {
if (messagesBuilder_ == null) {
return messages_.get(index);
} else {
return messagesBuilder_.getMessage(index);
}
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder setMessages(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Message value) {
if (messagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMessagesIsMutable();
messages_.set(index, value);
onChanged();
} else {
messagesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder setMessages(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder builderForValue) {
if (messagesBuilder_ == null) {
ensureMessagesIsMutable();
messages_.set(index, builderForValue.build());
onChanged();
} else {
messagesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder addMessages(yandex.cloud.api.ai.llm.v1alpha.Llm.Message value) {
if (messagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMessagesIsMutable();
messages_.add(value);
onChanged();
} else {
messagesBuilder_.addMessage(value);
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder addMessages(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Message value) {
if (messagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMessagesIsMutable();
messages_.add(index, value);
onChanged();
} else {
messagesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder addMessages(
yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder builderForValue) {
if (messagesBuilder_ == null) {
ensureMessagesIsMutable();
messages_.add(builderForValue.build());
onChanged();
} else {
messagesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder addMessages(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder builderForValue) {
if (messagesBuilder_ == null) {
ensureMessagesIsMutable();
messages_.add(index, builderForValue.build());
onChanged();
} else {
messagesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder addAllMessages(
java.lang.Iterable extends yandex.cloud.api.ai.llm.v1alpha.Llm.Message> values) {
if (messagesBuilder_ == null) {
ensureMessagesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, messages_);
onChanged();
} else {
messagesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder clearMessages() {
if (messagesBuilder_ == null) {
messages_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
messagesBuilder_.clear();
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public Builder removeMessages(int index) {
if (messagesBuilder_ == null) {
ensureMessagesIsMutable();
messages_.remove(index);
onChanged();
} else {
messagesBuilder_.remove(index);
}
return this;
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder getMessagesBuilder(
int index) {
return getMessagesFieldBuilder().getBuilder(index);
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder getMessagesOrBuilder(
int index) {
if (messagesBuilder_ == null) {
return messages_.get(index); } else {
return messagesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>
getMessagesOrBuilderList() {
if (messagesBuilder_ != null) {
return messagesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(messages_);
}
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder addMessagesBuilder() {
return getMessagesFieldBuilder().addBuilder(
yandex.cloud.api.ai.llm.v1alpha.Llm.Message.getDefaultInstance());
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder addMessagesBuilder(
int index) {
return getMessagesFieldBuilder().addBuilder(
index, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.getDefaultInstance());
}
/**
*
* Message history.
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Message messages = 4;
*/
public java.util.List
getMessagesBuilderList() {
return getMessagesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Message, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>
getMessagesFieldBuilder() {
if (messagesBuilder_ == null) {
messagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Message, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>(
messages_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
messages_ = null;
}
return messagesBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:yandex.cloud.ai.llm.v1alpha.ChatRequest)
}
// @@protoc_insertion_point(class_scope:yandex.cloud.ai.llm.v1alpha.ChatRequest)
private static final yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest();
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ChatRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ChatRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface ChatResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:yandex.cloud.ai.llm.v1alpha.ChatResponse)
com.google.protobuf.MessageOrBuilder {
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
* @return Whether the message field is set.
*/
boolean hasMessage();
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
* @return The message.
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.Message getMessage();
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder getMessageOrBuilder();
/**
*
* Total number of tokens for chat request and chat response
*
*
* int64 num_tokens = 2;
* @return The numTokens.
*/
long getNumTokens();
}
/**
*
* Contains a model-generated assistant's response for the chat query
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.ChatResponse}
*/
public static final class ChatResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:yandex.cloud.ai.llm.v1alpha.ChatResponse)
ChatResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use ChatResponse.newBuilder() to construct.
private ChatResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ChatResponse() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ChatResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ChatResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder subBuilder = null;
if (message_ != null) {
subBuilder = message_.toBuilder();
}
message_ = input.readMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.Message.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(message_);
message_ = subBuilder.buildPartial();
}
break;
}
case 16: {
numTokens_ = input.readInt64();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.Builder.class);
}
public static final int MESSAGE_FIELD_NUMBER = 1;
private yandex.cloud.api.ai.llm.v1alpha.Llm.Message message_;
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
* @return Whether the message field is set.
*/
@java.lang.Override
public boolean hasMessage() {
return message_ != null;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
* @return The message.
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message getMessage() {
return message_ == null ? yandex.cloud.api.ai.llm.v1alpha.Llm.Message.getDefaultInstance() : message_;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder getMessageOrBuilder() {
return getMessage();
}
public static final int NUM_TOKENS_FIELD_NUMBER = 2;
private long numTokens_;
/**
*
* Total number of tokens for chat request and chat response
*
*
* int64 num_tokens = 2;
* @return The numTokens.
*/
@java.lang.Override
public long getNumTokens() {
return numTokens_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (message_ != null) {
output.writeMessage(1, getMessage());
}
if (numTokens_ != 0L) {
output.writeInt64(2, numTokens_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (message_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getMessage());
}
if (numTokens_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, numTokens_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse)) {
return super.equals(obj);
}
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse other = (yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse) obj;
if (hasMessage() != other.hasMessage()) return false;
if (hasMessage()) {
if (!getMessage()
.equals(other.getMessage())) return false;
}
if (getNumTokens()
!= other.getNumTokens()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasMessage()) {
hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getMessage().hashCode();
}
hash = (37 * hash) + NUM_TOKENS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getNumTokens());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Contains a model-generated assistant's response for the chat query
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.ChatResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:yandex.cloud.ai.llm.v1alpha.ChatResponse)
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.Builder.class);
}
// Construct using yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (messageBuilder_ == null) {
message_ = null;
} else {
message_ = null;
messageBuilder_ = null;
}
numTokens_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_descriptor;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse getDefaultInstanceForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.getDefaultInstance();
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse build() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse buildPartial() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse result = new yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse(this);
if (messageBuilder_ == null) {
result.message_ = message_;
} else {
result.message_ = messageBuilder_.build();
}
result.numTokens_ = numTokens_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse) {
return mergeFrom((yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse other) {
if (other == yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse.getDefaultInstance()) return this;
if (other.hasMessage()) {
mergeMessage(other.getMessage());
}
if (other.getNumTokens() != 0L) {
setNumTokens(other.getNumTokens());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private yandex.cloud.api.ai.llm.v1alpha.Llm.Message message_;
private com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Message, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder> messageBuilder_;
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
* @return Whether the message field is set.
*/
public boolean hasMessage() {
return messageBuilder_ != null || message_ != null;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
* @return The message.
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message getMessage() {
if (messageBuilder_ == null) {
return message_ == null ? yandex.cloud.api.ai.llm.v1alpha.Llm.Message.getDefaultInstance() : message_;
} else {
return messageBuilder_.getMessage();
}
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
public Builder setMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.Message value) {
if (messageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
message_ = value;
onChanged();
} else {
messageBuilder_.setMessage(value);
}
return this;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
public Builder setMessage(
yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder builderForValue) {
if (messageBuilder_ == null) {
message_ = builderForValue.build();
onChanged();
} else {
messageBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
public Builder mergeMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.Message value) {
if (messageBuilder_ == null) {
if (message_ != null) {
message_ =
yandex.cloud.api.ai.llm.v1alpha.Llm.Message.newBuilder(message_).mergeFrom(value).buildPartial();
} else {
message_ = value;
}
onChanged();
} else {
messageBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
public Builder clearMessage() {
if (messageBuilder_ == null) {
message_ = null;
onChanged();
} else {
message_ = null;
messageBuilder_ = null;
}
return this;
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder getMessageBuilder() {
onChanged();
return getMessageFieldBuilder().getBuilder();
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder getMessageOrBuilder() {
if (messageBuilder_ != null) {
return messageBuilder_.getMessageOrBuilder();
} else {
return message_ == null ?
yandex.cloud.api.ai.llm.v1alpha.Llm.Message.getDefaultInstance() : message_;
}
}
/**
*
* Assistant's message
*
*
* .yandex.cloud.ai.llm.v1alpha.Message message = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Message, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>
getMessageFieldBuilder() {
if (messageBuilder_ == null) {
messageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Message, yandex.cloud.api.ai.llm.v1alpha.Llm.Message.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.MessageOrBuilder>(
getMessage(),
getParentForChildren(),
isClean());
message_ = null;
}
return messageBuilder_;
}
private long numTokens_ ;
/**
*
* Total number of tokens for chat request and chat response
*
*
* int64 num_tokens = 2;
* @return The numTokens.
*/
@java.lang.Override
public long getNumTokens() {
return numTokens_;
}
/**
*
* Total number of tokens for chat request and chat response
*
*
* int64 num_tokens = 2;
* @param value The numTokens to set.
* @return This builder for chaining.
*/
public Builder setNumTokens(long value) {
numTokens_ = value;
onChanged();
return this;
}
/**
*
* Total number of tokens for chat request and chat response
*
*
* int64 num_tokens = 2;
* @return This builder for chaining.
*/
public Builder clearNumTokens() {
numTokens_ = 0L;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:yandex.cloud.ai.llm.v1alpha.ChatResponse)
}
// @@protoc_insertion_point(class_scope:yandex.cloud.ai.llm.v1alpha.ChatResponse)
private static final yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse();
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ChatResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ChatResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.ChatResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface TokenizeRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:yandex.cloud.ai.llm.v1alpha.TokenizeRequest)
com.google.protobuf.MessageOrBuilder {
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
java.lang.String getModel();
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
com.google.protobuf.ByteString
getModelBytes();
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return The text.
*/
java.lang.String getText();
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return The bytes for text.
*/
com.google.protobuf.ByteString
getTextBytes();
}
/**
*
* Tokenization request
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.TokenizeRequest}
*/
public static final class TokenizeRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:yandex.cloud.ai.llm.v1alpha.TokenizeRequest)
TokenizeRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use TokenizeRequest.newBuilder() to construct.
private TokenizeRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TokenizeRequest() {
model_ = "";
text_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TokenizeRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TokenizeRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
model_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
text_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.Builder.class);
}
public static final int MODEL_FIELD_NUMBER = 1;
private volatile java.lang.Object model_;
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
@java.lang.Override
public java.lang.String getModel() {
java.lang.Object ref = model_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
model_ = s;
return s;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getModelBytes() {
java.lang.Object ref = model_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
model_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TEXT_FIELD_NUMBER = 2;
private volatile java.lang.Object text_;
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return The text.
*/
@java.lang.Override
public java.lang.String getText() {
java.lang.Object ref = text_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
text_ = s;
return s;
}
}
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return The bytes for text.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTextBytes() {
java.lang.Object ref = text_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
text_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, text_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest)) {
return super.equals(obj);
}
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest other = (yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest) obj;
if (!getModel()
.equals(other.getModel())) return false;
if (!getText()
.equals(other.getText())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + MODEL_FIELD_NUMBER;
hash = (53 * hash) + getModel().hashCode();
hash = (37 * hash) + TEXT_FIELD_NUMBER;
hash = (53 * hash) + getText().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Tokenization request
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.TokenizeRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:yandex.cloud.ai.llm.v1alpha.TokenizeRequest)
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.Builder.class);
}
// Construct using yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
model_ = "";
text_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_descriptor;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest getDefaultInstanceForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.getDefaultInstance();
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest build() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest buildPartial() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest result = new yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest(this);
result.model_ = model_;
result.text_ = text_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest) {
return mergeFrom((yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest other) {
if (other == yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest.getDefaultInstance()) return this;
if (!other.getModel().isEmpty()) {
model_ = other.model_;
onChanged();
}
if (!other.getText().isEmpty()) {
text_ = other.text_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object model_ = "";
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The model.
*/
public java.lang.String getModel() {
java.lang.Object ref = model_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
model_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return The bytes for model.
*/
public com.google.protobuf.ByteString
getModelBytes() {
java.lang.Object ref = model_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
model_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @param value The model to set.
* @return This builder for chaining.
*/
public Builder setModel(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
model_ = value;
onChanged();
return this;
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @return This builder for chaining.
*/
public Builder clearModel() {
model_ = getDefaultInstance().getModel();
onChanged();
return this;
}
/**
*
* Possible value for now: `general`.
*
*
* string model = 1 [(.yandex.cloud.length) = "<=50"];
* @param value The bytes for model to set.
* @return This builder for chaining.
*/
public Builder setModelBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
model_ = value;
onChanged();
return this;
}
private java.lang.Object text_ = "";
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return The text.
*/
public java.lang.String getText() {
java.lang.Object ref = text_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
text_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return The bytes for text.
*/
public com.google.protobuf.ByteString
getTextBytes() {
java.lang.Object ref = text_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
text_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @param value The text to set.
* @return This builder for chaining.
*/
public Builder setText(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
text_ = value;
onChanged();
return this;
}
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @return This builder for chaining.
*/
public Builder clearText() {
text_ = getDefaultInstance().getText();
onChanged();
return this;
}
/**
*
* Text for tokenization request
*
*
* string text = 2;
* @param value The bytes for text to set.
* @return This builder for chaining.
*/
public Builder setTextBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
text_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:yandex.cloud.ai.llm.v1alpha.TokenizeRequest)
}
// @@protoc_insertion_point(class_scope:yandex.cloud.ai.llm.v1alpha.TokenizeRequest)
private static final yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest();
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TokenizeRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TokenizeRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface TokenizeResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:yandex.cloud.ai.llm.v1alpha.TokenizeResponse)
com.google.protobuf.MessageOrBuilder {
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
java.util.List
getTokensList();
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.Token getTokens(int index);
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
int getTokensCount();
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder>
getTokensOrBuilderList();
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder getTokensOrBuilder(
int index);
}
/**
*
* Tokenization response
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.TokenizeResponse}
*/
public static final class TokenizeResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:yandex.cloud.ai.llm.v1alpha.TokenizeResponse)
TokenizeResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use TokenizeResponse.newBuilder() to construct.
private TokenizeResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TokenizeResponse() {
tokens_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TokenizeResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TokenizeResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
tokens_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
tokens_.add(
input.readMessage(yandex.cloud.api.ai.llm.v1alpha.Llm.Token.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
tokens_ = java.util.Collections.unmodifiableList(tokens_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.Builder.class);
}
public static final int TOKENS_FIELD_NUMBER = 1;
private java.util.List tokens_;
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
@java.lang.Override
public java.util.List getTokensList() {
return tokens_;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
@java.lang.Override
public java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder>
getTokensOrBuilderList() {
return tokens_;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
@java.lang.Override
public int getTokensCount() {
return tokens_.size();
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.Token getTokens(int index) {
return tokens_.get(index);
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder getTokensOrBuilder(
int index) {
return tokens_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < tokens_.size(); i++) {
output.writeMessage(1, tokens_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < tokens_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, tokens_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse)) {
return super.equals(obj);
}
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse other = (yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse) obj;
if (!getTokensList()
.equals(other.getTokensList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getTokensCount() > 0) {
hash = (37 * hash) + TOKENS_FIELD_NUMBER;
hash = (53 * hash) + getTokensList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Tokenization response
*
*
* Protobuf type {@code yandex.cloud.ai.llm.v1alpha.TokenizeResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:yandex.cloud.ai.llm.v1alpha.TokenizeResponse)
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.class, yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.Builder.class);
}
// Construct using yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getTokensFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (tokensBuilder_ == null) {
tokens_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
tokensBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_descriptor;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse getDefaultInstanceForType() {
return yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.getDefaultInstance();
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse build() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse buildPartial() {
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse result = new yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse(this);
int from_bitField0_ = bitField0_;
if (tokensBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
tokens_ = java.util.Collections.unmodifiableList(tokens_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.tokens_ = tokens_;
} else {
result.tokens_ = tokensBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse) {
return mergeFrom((yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse other) {
if (other == yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse.getDefaultInstance()) return this;
if (tokensBuilder_ == null) {
if (!other.tokens_.isEmpty()) {
if (tokens_.isEmpty()) {
tokens_ = other.tokens_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureTokensIsMutable();
tokens_.addAll(other.tokens_);
}
onChanged();
}
} else {
if (!other.tokens_.isEmpty()) {
if (tokensBuilder_.isEmpty()) {
tokensBuilder_.dispose();
tokensBuilder_ = null;
tokens_ = other.tokens_;
bitField0_ = (bitField0_ & ~0x00000001);
tokensBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getTokensFieldBuilder() : null;
} else {
tokensBuilder_.addAllMessages(other.tokens_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List tokens_ =
java.util.Collections.emptyList();
private void ensureTokensIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
tokens_ = new java.util.ArrayList(tokens_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Token, yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder> tokensBuilder_;
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public java.util.List getTokensList() {
if (tokensBuilder_ == null) {
return java.util.Collections.unmodifiableList(tokens_);
} else {
return tokensBuilder_.getMessageList();
}
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public int getTokensCount() {
if (tokensBuilder_ == null) {
return tokens_.size();
} else {
return tokensBuilder_.getCount();
}
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Token getTokens(int index) {
if (tokensBuilder_ == null) {
return tokens_.get(index);
} else {
return tokensBuilder_.getMessage(index);
}
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder setTokens(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Token value) {
if (tokensBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTokensIsMutable();
tokens_.set(index, value);
onChanged();
} else {
tokensBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder setTokens(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder builderForValue) {
if (tokensBuilder_ == null) {
ensureTokensIsMutable();
tokens_.set(index, builderForValue.build());
onChanged();
} else {
tokensBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder addTokens(yandex.cloud.api.ai.llm.v1alpha.Llm.Token value) {
if (tokensBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTokensIsMutable();
tokens_.add(value);
onChanged();
} else {
tokensBuilder_.addMessage(value);
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder addTokens(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Token value) {
if (tokensBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTokensIsMutable();
tokens_.add(index, value);
onChanged();
} else {
tokensBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder addTokens(
yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder builderForValue) {
if (tokensBuilder_ == null) {
ensureTokensIsMutable();
tokens_.add(builderForValue.build());
onChanged();
} else {
tokensBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder addTokens(
int index, yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder builderForValue) {
if (tokensBuilder_ == null) {
ensureTokensIsMutable();
tokens_.add(index, builderForValue.build());
onChanged();
} else {
tokensBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder addAllTokens(
java.lang.Iterable extends yandex.cloud.api.ai.llm.v1alpha.Llm.Token> values) {
if (tokensBuilder_ == null) {
ensureTokensIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, tokens_);
onChanged();
} else {
tokensBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder clearTokens() {
if (tokensBuilder_ == null) {
tokens_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
tokensBuilder_.clear();
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public Builder removeTokens(int index) {
if (tokensBuilder_ == null) {
ensureTokensIsMutable();
tokens_.remove(index);
onChanged();
} else {
tokensBuilder_.remove(index);
}
return this;
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder getTokensBuilder(
int index) {
return getTokensFieldBuilder().getBuilder(index);
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder getTokensOrBuilder(
int index) {
if (tokensBuilder_ == null) {
return tokens_.get(index); } else {
return tokensBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public java.util.List extends yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder>
getTokensOrBuilderList() {
if (tokensBuilder_ != null) {
return tokensBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(tokens_);
}
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder addTokensBuilder() {
return getTokensFieldBuilder().addBuilder(
yandex.cloud.api.ai.llm.v1alpha.Llm.Token.getDefaultInstance());
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder addTokensBuilder(
int index) {
return getTokensFieldBuilder().addBuilder(
index, yandex.cloud.api.ai.llm.v1alpha.Llm.Token.getDefaultInstance());
}
/**
*
* Sequence of tokens in tokenized text
*
*
* repeated .yandex.cloud.ai.llm.v1alpha.Token tokens = 1;
*/
public java.util.List
getTokensBuilderList() {
return getTokensFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Token, yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder>
getTokensFieldBuilder() {
if (tokensBuilder_ == null) {
tokensBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
yandex.cloud.api.ai.llm.v1alpha.Llm.Token, yandex.cloud.api.ai.llm.v1alpha.Llm.Token.Builder, yandex.cloud.api.ai.llm.v1alpha.Llm.TokenOrBuilder>(
tokens_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
tokens_ = null;
}
return tokensBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:yandex.cloud.ai.llm.v1alpha.TokenizeResponse)
}
// @@protoc_insertion_point(class_scope:yandex.cloud.ai.llm.v1alpha.TokenizeResponse)
private static final yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse();
}
public static yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TokenizeResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TokenizeResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public yandex.cloud.api.ai.llm.v1alpha.LlmService.TokenizeResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n-yandex/cloud/ai/llm/v1alpha/llm_servic" +
"e.proto\022\033yandex.cloud.ai.llm.v1alpha\032%ya" +
"ndex/cloud/ai/llm/v1alpha/llm.proto\032\034goo" +
"gle/api/annotations.proto\032\035yandex/cloud/" +
"validation.proto\"\304\001\n\017InstructRequest\022\027\n\005" +
"model\030\001 \001(\tB\010\212\3101\004<=50\022J\n\022generation_opti" +
"ons\030\002 \001(\0132..yandex.cloud.ai.llm.v1alpha." +
"GenerationOptions\022\032\n\020instruction_text\030\003 " +
"\001(\tH\000\022\026\n\014request_text\030\004 \001(\tH\001B\r\n\013Instruc" +
"tionB\t\n\007Request\"m\n\020InstructResponse\022>\n\014a" +
"lternatives\030\001 \003(\0132(.yandex.cloud.ai.llm." +
"v1alpha.Alternative\022\031\n\021num_prompt_tokens" +
"\030\002 \001(\003\"\325\001\n\013ChatRequest\022\027\n\005model\030\001 \001(\tB\010\212" +
"\3101\004<=50\022J\n\022generation_options\030\002 \001(\0132..ya" +
"ndex.cloud.ai.llm.v1alpha.GenerationOpti" +
"ons\022\032\n\020instruction_text\030\003 \001(\tH\000\0226\n\010messa" +
"ges\030\004 \003(\0132$.yandex.cloud.ai.llm.v1alpha." +
"MessageB\r\n\013Instruction\"Y\n\014ChatResponse\0225" +
"\n\007message\030\001 \001(\0132$.yandex.cloud.ai.llm.v1" +
"alpha.Message\022\022\n\nnum_tokens\030\002 \001(\003\"8\n\017Tok" +
"enizeRequest\022\027\n\005model\030\001 \001(\tB\010\212\3101\004<=50\022\014\n" +
"\004text\030\002 \001(\t\"F\n\020TokenizeResponse\0222\n\006token" +
"s\030\001 \003(\0132\".yandex.cloud.ai.llm.v1alpha.To" +
"ken2\242\002\n\025TextGenerationService\022\213\001\n\010Instru" +
"ct\022,.yandex.cloud.ai.llm.v1alpha.Instruc" +
"tRequest\032-.yandex.cloud.ai.llm.v1alpha.I" +
"nstructResponse\" \202\323\344\223\002\032\"\025/llm/v1alpha/in" +
"struct:\001*0\001\022{\n\004Chat\022(.yandex.cloud.ai.ll" +
"m.v1alpha.ChatRequest\032).yandex.cloud.ai." +
"llm.v1alpha.ChatResponse\"\034\202\323\344\223\002\026\"\021/llm/v" +
"1alpha/chat:\001*0\0012\236\001\n\020TokenizerService\022\211\001" +
"\n\010Tokenize\022,.yandex.cloud.ai.llm.v1alpha" +
".TokenizeRequest\032-.yandex.cloud.ai.llm.v" +
"1alpha.TokenizeResponse\" \202\323\344\223\002\032\"\025/llm/v1" +
"alpha/tokenize:\001*Bf\n\037yandex.cloud.api.ai" +
".llm.v1alphaZCgithub.com/yandex-cloud/go" +
"-genproto/yandex/cloud/ai/llm/v1alpha;ll" +
"mb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
yandex.cloud.api.ai.llm.v1alpha.Llm.getDescriptor(),
com.google.api.AnnotationsProto.getDescriptor(),
yandex.cloud.api.Validation.getDescriptor(),
});
internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_yandex_cloud_ai_llm_v1alpha_InstructRequest_descriptor,
new java.lang.String[] { "Model", "GenerationOptions", "InstructionText", "RequestText", "Instruction", "Request", });
internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_yandex_cloud_ai_llm_v1alpha_InstructResponse_descriptor,
new java.lang.String[] { "Alternatives", "NumPromptTokens", });
internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_yandex_cloud_ai_llm_v1alpha_ChatRequest_descriptor,
new java.lang.String[] { "Model", "GenerationOptions", "InstructionText", "Messages", "Instruction", });
internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_yandex_cloud_ai_llm_v1alpha_ChatResponse_descriptor,
new java.lang.String[] { "Message", "NumTokens", });
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeRequest_descriptor,
new java.lang.String[] { "Model", "Text", });
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_yandex_cloud_ai_llm_v1alpha_TokenizeResponse_descriptor,
new java.lang.String[] { "Tokens", });
com.google.protobuf.ExtensionRegistry registry =
com.google.protobuf.ExtensionRegistry.newInstance();
registry.add(com.google.api.AnnotationsProto.http);
registry.add(yandex.cloud.api.Validation.length);
com.google.protobuf.Descriptors.FileDescriptor
.internalUpdateFileDescriptor(descriptor, registry);
yandex.cloud.api.ai.llm.v1alpha.Llm.getDescriptor();
com.google.api.AnnotationsProto.getDescriptor();
yandex.cloud.api.Validation.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy