From fd78f4d2a74964c58eb6d7e874856b49e7fcc911 Mon Sep 17 00:00:00 2001 From: David Marx Date: Mon, 29 Aug 2022 20:30:05 -0700 Subject: [PATCH] precompiled stubs for js/ts (#15) --- README.md | 12 + src/js/generation_pb.d.ts | 710 ++++ src/js/generation_pb.js | 5045 +++++++++++++++++++++++++++++ src/js/generation_pb_service.d.ts | 55 + src/js/generation_pb_service.js | 69 + 5 files changed, 5891 insertions(+) create mode 100644 src/js/generation_pb.d.ts create mode 100644 src/js/generation_pb.js create mode 100644 src/js/generation_pb_service.d.ts create mode 100644 src/js/generation_pb_service.js diff --git a/README.md b/README.md index 49470301..f7c05630 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,15 @@ optional arguments: --show open artifacts using PIL --engine, -e engine to use for inference ``` + + +## Connecting to the API in using langauges other than python + +The `src` subdirectory contains pre-compiled gRPC stubs for the following languages: + +* [Javascript/Typescript](https://github.com/Stability-AI/stability-sdk/tree/main/src/js) + +If a language you would like to connect to the API with is not listed above, you can use the following +protobuf definition to compile stubs for your language: + +* [protobuf spec](https://github.com/Stability-AI/stability-sdk/tree/ecma_clients/src/proto) diff --git a/src/js/generation_pb.d.ts b/src/js/generation_pb.d.ts new file mode 100644 index 00000000..36553938 --- /dev/null +++ b/src/js/generation_pb.d.ts @@ -0,0 +1,710 @@ +// package: gooseai +// file: generation.proto + +import * as jspb from "google-protobuf"; + +export class Token extends jspb.Message { + hasText(): boolean; + clearText(): void; + getText(): string; + setText(value: string): void; + + getId(): number; + setId(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Token.AsObject; + static toObject(includeInstance: boolean, msg: Token): Token.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Token, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Token; + static deserializeBinaryFromReader(message: Token, reader: jspb.BinaryReader): Token; +} + +export namespace Token { + export type AsObject = { + text: string, + id: number, + } +} + +export class Tokens extends jspb.Message { + clearTokensList(): void; + getTokensList(): Array; + setTokensList(value: Array): void; + addTokens(value?: Token, index?: number): Token; + + hasTokenizerId(): boolean; + clearTokenizerId(): void; + getTokenizerId(): string; + setTokenizerId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Tokens.AsObject; + static toObject(includeInstance: boolean, msg: Tokens): Tokens.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Tokens, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Tokens; + static deserializeBinaryFromReader(message: Tokens, reader: jspb.BinaryReader): Tokens; +} + +export namespace Tokens { + export type AsObject = { + tokensList: Array, + tokenizerId: string, + } +} + +export class Artifact extends jspb.Message { + getId(): number; + setId(value: number): void; + + getType(): ArtifactTypeMap[keyof ArtifactTypeMap]; + setType(value: ArtifactTypeMap[keyof ArtifactTypeMap]): void; + + getMime(): string; + setMime(value: string): void; + + hasMagic(): boolean; + clearMagic(): void; + getMagic(): string; + setMagic(value: string): void; + + hasBinary(): boolean; + clearBinary(): void; + getBinary(): Uint8Array | string; + getBinary_asU8(): Uint8Array; + getBinary_asB64(): string; + setBinary(value: Uint8Array | string): void; + + hasText(): boolean; + clearText(): void; + getText(): string; + setText(value: string): void; + + hasTokens(): boolean; + clearTokens(): void; + getTokens(): Tokens | undefined; + setTokens(value?: Tokens): void; + + hasClassifier(): boolean; + clearClassifier(): void; + getClassifier(): ClassifierParameters | undefined; + setClassifier(value?: ClassifierParameters): void; + + getIndex(): number; + setIndex(value: number): void; + + getFinishReason(): FinishReasonMap[keyof FinishReasonMap]; + setFinishReason(value: FinishReasonMap[keyof FinishReasonMap]): void; + + getSeed(): number; + setSeed(value: number): void; + + getDataCase(): Artifact.DataCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Artifact.AsObject; + static toObject(includeInstance: boolean, msg: Artifact): Artifact.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Artifact, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Artifact; + static deserializeBinaryFromReader(message: Artifact, reader: jspb.BinaryReader): Artifact; +} + +export namespace Artifact { + export type AsObject = { + id: number, + type: ArtifactTypeMap[keyof ArtifactTypeMap], + mime: string, + magic: string, + binary: Uint8Array | string, + text: string, + tokens?: Tokens.AsObject, + classifier?: ClassifierParameters.AsObject, + index: number, + finishReason: FinishReasonMap[keyof FinishReasonMap], + seed: number, + } + + export enum DataCase { + DATA_NOT_SET = 0, + BINARY = 5, + TEXT = 6, + TOKENS = 7, + CLASSIFIER = 11, + } +} + +export class PromptParameters extends jspb.Message { + hasInit(): boolean; + clearInit(): void; + getInit(): boolean; + setInit(value: boolean): void; + + hasWeight(): boolean; + clearWeight(): void; + getWeight(): number; + setWeight(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PromptParameters.AsObject; + static toObject(includeInstance: boolean, msg: PromptParameters): PromptParameters.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PromptParameters, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PromptParameters; + static deserializeBinaryFromReader(message: PromptParameters, reader: jspb.BinaryReader): PromptParameters; +} + +export namespace PromptParameters { + export type AsObject = { + init: boolean, + weight: number, + } +} + +export class Prompt extends jspb.Message { + hasParameters(): boolean; + clearParameters(): void; + getParameters(): PromptParameters | undefined; + setParameters(value?: PromptParameters): void; + + hasText(): boolean; + clearText(): void; + getText(): string; + setText(value: string): void; + + hasTokens(): boolean; + clearTokens(): void; + getTokens(): Tokens | undefined; + setTokens(value?: Tokens): void; + + hasArtifact(): boolean; + clearArtifact(): void; + getArtifact(): Artifact | undefined; + setArtifact(value?: Artifact): void; + + getPromptCase(): Prompt.PromptCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Prompt.AsObject; + static toObject(includeInstance: boolean, msg: Prompt): Prompt.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Prompt, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Prompt; + static deserializeBinaryFromReader(message: Prompt, reader: jspb.BinaryReader): Prompt; +} + +export namespace Prompt { + export type AsObject = { + parameters?: PromptParameters.AsObject, + text: string, + tokens?: Tokens.AsObject, + artifact?: Artifact.AsObject, + } + + export enum PromptCase { + PROMPT_NOT_SET = 0, + TEXT = 2, + TOKENS = 3, + ARTIFACT = 4, + } +} + +export class AnswerMeta extends jspb.Message { + hasGpuId(): boolean; + clearGpuId(): void; + getGpuId(): string; + setGpuId(value: string): void; + + hasCpuId(): boolean; + clearCpuId(): void; + getCpuId(): string; + setCpuId(value: string): void; + + hasNodeId(): boolean; + clearNodeId(): void; + getNodeId(): string; + setNodeId(value: string): void; + + hasEngineId(): boolean; + clearEngineId(): void; + getEngineId(): string; + setEngineId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AnswerMeta.AsObject; + static toObject(includeInstance: boolean, msg: AnswerMeta): AnswerMeta.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AnswerMeta, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AnswerMeta; + static deserializeBinaryFromReader(message: AnswerMeta, reader: jspb.BinaryReader): AnswerMeta; +} + +export namespace AnswerMeta { + export type AsObject = { + gpuId: string, + cpuId: string, + nodeId: string, + engineId: string, + } +} + +export class Answer extends jspb.Message { + getAnswerId(): string; + setAnswerId(value: string): void; + + getRequestId(): string; + setRequestId(value: string): void; + + getReceived(): number; + setReceived(value: number): void; + + getCreated(): number; + setCreated(value: number): void; + + hasMeta(): boolean; + clearMeta(): void; + getMeta(): AnswerMeta | undefined; + setMeta(value?: AnswerMeta): void; + + clearArtifactsList(): void; + getArtifactsList(): Array; + setArtifactsList(value: Array): void; + addArtifacts(value?: Artifact, index?: number): Artifact; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Answer.AsObject; + static toObject(includeInstance: boolean, msg: Answer): Answer.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Answer, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Answer; + static deserializeBinaryFromReader(message: Answer, reader: jspb.BinaryReader): Answer; +} + +export namespace Answer { + export type AsObject = { + answerId: string, + requestId: string, + received: number, + created: number, + meta?: AnswerMeta.AsObject, + artifactsList: Array, + } +} + +export class SamplerParameters extends jspb.Message { + hasEta(): boolean; + clearEta(): void; + getEta(): number; + setEta(value: number): void; + + hasSamplingSteps(): boolean; + clearSamplingSteps(): void; + getSamplingSteps(): number; + setSamplingSteps(value: number): void; + + hasLatentChannels(): boolean; + clearLatentChannels(): void; + getLatentChannels(): number; + setLatentChannels(value: number): void; + + hasDownsamplingFactor(): boolean; + clearDownsamplingFactor(): void; + getDownsamplingFactor(): number; + setDownsamplingFactor(value: number): void; + + hasCfgScale(): boolean; + clearCfgScale(): void; + getCfgScale(): number; + setCfgScale(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SamplerParameters.AsObject; + static toObject(includeInstance: boolean, msg: SamplerParameters): SamplerParameters.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SamplerParameters, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SamplerParameters; + static deserializeBinaryFromReader(message: SamplerParameters, reader: jspb.BinaryReader): SamplerParameters; +} + +export namespace SamplerParameters { + export type AsObject = { + eta: number, + samplingSteps: number, + latentChannels: number, + downsamplingFactor: number, + cfgScale: number, + } +} + +export class ConditionerParameters extends jspb.Message { + hasVectorAdjustPrior(): boolean; + clearVectorAdjustPrior(): void; + getVectorAdjustPrior(): string; + setVectorAdjustPrior(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ConditionerParameters.AsObject; + static toObject(includeInstance: boolean, msg: ConditionerParameters): ConditionerParameters.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ConditionerParameters, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ConditionerParameters; + static deserializeBinaryFromReader(message: ConditionerParameters, reader: jspb.BinaryReader): ConditionerParameters; +} + +export namespace ConditionerParameters { + export type AsObject = { + vectorAdjustPrior: string, + } +} + +export class StepParameter extends jspb.Message { + getScaledStep(): number; + setScaledStep(value: number): void; + + hasSampler(): boolean; + clearSampler(): void; + getSampler(): SamplerParameters | undefined; + setSampler(value?: SamplerParameters): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): StepParameter.AsObject; + static toObject(includeInstance: boolean, msg: StepParameter): StepParameter.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: StepParameter, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StepParameter; + static deserializeBinaryFromReader(message: StepParameter, reader: jspb.BinaryReader): StepParameter; +} + +export namespace StepParameter { + export type AsObject = { + scaledStep: number, + sampler?: SamplerParameters.AsObject, + } +} + +export class TransformType extends jspb.Message { + hasDiffusion(): boolean; + clearDiffusion(): void; + getDiffusion(): DiffusionSamplerMap[keyof DiffusionSamplerMap]; + setDiffusion(value: DiffusionSamplerMap[keyof DiffusionSamplerMap]): void; + + hasUpscaler(): boolean; + clearUpscaler(): void; + getUpscaler(): UpscalerMap[keyof UpscalerMap]; + setUpscaler(value: UpscalerMap[keyof UpscalerMap]): void; + + getTypeCase(): TransformType.TypeCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransformType.AsObject; + static toObject(includeInstance: boolean, msg: TransformType): TransformType.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TransformType, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransformType; + static deserializeBinaryFromReader(message: TransformType, reader: jspb.BinaryReader): TransformType; +} + +export namespace TransformType { + export type AsObject = { + diffusion: DiffusionSamplerMap[keyof DiffusionSamplerMap], + upscaler: UpscalerMap[keyof UpscalerMap], + } + + export enum TypeCase { + TYPE_NOT_SET = 0, + DIFFUSION = 1, + UPSCALER = 2, + } +} + +export class ImageParameters extends jspb.Message { + hasHeight(): boolean; + clearHeight(): void; + getHeight(): number; + setHeight(value: number): void; + + hasWidth(): boolean; + clearWidth(): void; + getWidth(): number; + setWidth(value: number): void; + + clearSeedList(): void; + getSeedList(): Array; + setSeedList(value: Array): void; + addSeed(value: number, index?: number): number; + + hasSamples(): boolean; + clearSamples(): void; + getSamples(): number; + setSamples(value: number): void; + + hasSteps(): boolean; + clearSteps(): void; + getSteps(): number; + setSteps(value: number): void; + + hasTransform(): boolean; + clearTransform(): void; + getTransform(): TransformType | undefined; + setTransform(value?: TransformType): void; + + clearParametersList(): void; + getParametersList(): Array; + setParametersList(value: Array): void; + addParameters(value?: StepParameter, index?: number): StepParameter; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ImageParameters.AsObject; + static toObject(includeInstance: boolean, msg: ImageParameters): ImageParameters.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ImageParameters, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ImageParameters; + static deserializeBinaryFromReader(message: ImageParameters, reader: jspb.BinaryReader): ImageParameters; +} + +export namespace ImageParameters { + export type AsObject = { + height: number, + width: number, + seedList: Array, + samples: number, + steps: number, + transform?: TransformType.AsObject, + parametersList: Array, + } +} + +export class ClassifierConcept extends jspb.Message { + getConcept(): string; + setConcept(value: string): void; + + hasThreshold(): boolean; + clearThreshold(): void; + getThreshold(): number; + setThreshold(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClassifierConcept.AsObject; + static toObject(includeInstance: boolean, msg: ClassifierConcept): ClassifierConcept.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClassifierConcept, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClassifierConcept; + static deserializeBinaryFromReader(message: ClassifierConcept, reader: jspb.BinaryReader): ClassifierConcept; +} + +export namespace ClassifierConcept { + export type AsObject = { + concept: string, + threshold: number, + } +} + +export class ClassifierCategory extends jspb.Message { + getName(): string; + setName(value: string): void; + + clearConceptsList(): void; + getConceptsList(): Array; + setConceptsList(value: Array): void; + addConcepts(value?: ClassifierConcept, index?: number): ClassifierConcept; + + hasAdjustment(): boolean; + clearAdjustment(): void; + getAdjustment(): number; + setAdjustment(value: number): void; + + hasAction(): boolean; + clearAction(): void; + getAction(): ActionMap[keyof ActionMap]; + setAction(value: ActionMap[keyof ActionMap]): void; + + hasClassifierMode(): boolean; + clearClassifierMode(): void; + getClassifierMode(): ClassifierModeMap[keyof ClassifierModeMap]; + setClassifierMode(value: ClassifierModeMap[keyof ClassifierModeMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClassifierCategory.AsObject; + static toObject(includeInstance: boolean, msg: ClassifierCategory): ClassifierCategory.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClassifierCategory, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClassifierCategory; + static deserializeBinaryFromReader(message: ClassifierCategory, reader: jspb.BinaryReader): ClassifierCategory; +} + +export namespace ClassifierCategory { + export type AsObject = { + name: string, + conceptsList: Array, + adjustment: number, + action: ActionMap[keyof ActionMap], + classifierMode: ClassifierModeMap[keyof ClassifierModeMap], + } +} + +export class ClassifierParameters extends jspb.Message { + clearCategoriesList(): void; + getCategoriesList(): Array; + setCategoriesList(value: Array): void; + addCategories(value?: ClassifierCategory, index?: number): ClassifierCategory; + + clearExceedsList(): void; + getExceedsList(): Array; + setExceedsList(value: Array): void; + addExceeds(value?: ClassifierCategory, index?: number): ClassifierCategory; + + hasRealizedAction(): boolean; + clearRealizedAction(): void; + getRealizedAction(): ActionMap[keyof ActionMap]; + setRealizedAction(value: ActionMap[keyof ActionMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClassifierParameters.AsObject; + static toObject(includeInstance: boolean, msg: ClassifierParameters): ClassifierParameters.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClassifierParameters, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClassifierParameters; + static deserializeBinaryFromReader(message: ClassifierParameters, reader: jspb.BinaryReader): ClassifierParameters; +} + +export namespace ClassifierParameters { + export type AsObject = { + categoriesList: Array, + exceedsList: Array, + realizedAction: ActionMap[keyof ActionMap], + } +} + +export class Request extends jspb.Message { + getEngineId(): string; + setEngineId(value: string): void; + + getRequestId(): string; + setRequestId(value: string): void; + + getRequestedType(): ArtifactTypeMap[keyof ArtifactTypeMap]; + setRequestedType(value: ArtifactTypeMap[keyof ArtifactTypeMap]): void; + + clearPromptList(): void; + getPromptList(): Array; + setPromptList(value: Array): void; + addPrompt(value?: Prompt, index?: number): Prompt; + + hasImage(): boolean; + clearImage(): void; + getImage(): ImageParameters | undefined; + setImage(value?: ImageParameters): void; + + hasConditioner(): boolean; + clearConditioner(): void; + getConditioner(): ConditionerParameters | undefined; + setConditioner(value?: ConditionerParameters): void; + + hasClassifier(): boolean; + clearClassifier(): void; + getClassifier(): ClassifierParameters | undefined; + setClassifier(value?: ClassifierParameters): void; + + getParamsCase(): Request.ParamsCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Request.AsObject; + static toObject(includeInstance: boolean, msg: Request): Request.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Request, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Request; + static deserializeBinaryFromReader(message: Request, reader: jspb.BinaryReader): Request; +} + +export namespace Request { + export type AsObject = { + engineId: string, + requestId: string, + requestedType: ArtifactTypeMap[keyof ArtifactTypeMap], + promptList: Array, + image?: ImageParameters.AsObject, + conditioner?: ConditionerParameters.AsObject, + classifier?: ClassifierParameters.AsObject, + } + + export enum ParamsCase { + PARAMS_NOT_SET = 0, + IMAGE = 5, + } +} + +export interface FinishReasonMap { + NULL: 0; + LENGTH: 1; + STOP: 2; + ERROR: 3; + FILTER: 4; +} + +export const FinishReason: FinishReasonMap; + +export interface ArtifactTypeMap { + ARTIFACT_NONE: 0; + ARTIFACT_IMAGE: 1; + ARTIFACT_VIDEO: 2; + ARTIFACT_TEXT: 3; + ARTIFACT_TOKENS: 4; + ARTIFACT_EMBEDDING: 5; + ARTIFACT_CLASSIFICATIONS: 6; +} + +export const ArtifactType: ArtifactTypeMap; + +export interface DiffusionSamplerMap { + SAMPLER_DDIM: 0; + SAMPLER_DDPM: 1; + SAMPLER_K_EULER: 2; + SAMPLER_K_EULER_ANCESTRAL: 3; + SAMPLER_K_HEUN: 4; + SAMPLER_K_DPM_2: 5; + SAMPLER_K_DPM_2_ANCESTRAL: 6; + SAMPLER_K_LMS: 7; +} + +export const DiffusionSampler: DiffusionSamplerMap; + +export interface UpscalerMap { + UPSCALER_RGB: 0; + UPSCALER_GFPGAN: 1; + UPSCALER_ESRGAN: 2; +} + +export const Upscaler: UpscalerMap; + +export interface ActionMap { + ACTION_PASSTHROUGH: 0; + ACTION_REGENERATE_DUPLICATE: 1; + ACTION_REGENERATE: 2; + ACTION_OBFUSCATE_DUPLICATE: 3; + ACTION_OBFUSCATE: 4; + ACTION_DISCARD: 5; +} + +export const Action: ActionMap; + +export interface ClassifierModeMap { + CLSFR_MODE_ZEROSHOT: 0; + CLSFR_MODE_MULTICLASS: 1; +} + +export const ClassifierMode: ClassifierModeMap; + diff --git a/src/js/generation_pb.js b/src/js/generation_pb.js new file mode 100644 index 00000000..2d14d205 --- /dev/null +++ b/src/js/generation_pb.js @@ -0,0 +1,5045 @@ +// source: generation.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); + +goog.exportSymbol('proto.gooseai.Action', null, global); +goog.exportSymbol('proto.gooseai.Answer', null, global); +goog.exportSymbol('proto.gooseai.AnswerMeta', null, global); +goog.exportSymbol('proto.gooseai.Artifact', null, global); +goog.exportSymbol('proto.gooseai.Artifact.DataCase', null, global); +goog.exportSymbol('proto.gooseai.ArtifactType', null, global); +goog.exportSymbol('proto.gooseai.ClassifierCategory', null, global); +goog.exportSymbol('proto.gooseai.ClassifierConcept', null, global); +goog.exportSymbol('proto.gooseai.ClassifierParameters', null, global); +goog.exportSymbol('proto.gooseai.ConditionerParameters', null, global); +goog.exportSymbol('proto.gooseai.DiffusionSampler', null, global); +goog.exportSymbol('proto.gooseai.FinishReason', null, global); +goog.exportSymbol('proto.gooseai.ImageParameters', null, global); +goog.exportSymbol('proto.gooseai.Prompt', null, global); +goog.exportSymbol('proto.gooseai.Prompt.PromptCase', null, global); +goog.exportSymbol('proto.gooseai.PromptParameters', null, global); +goog.exportSymbol('proto.gooseai.Request', null, global); +goog.exportSymbol('proto.gooseai.Request.ParamsCase', null, global); +goog.exportSymbol('proto.gooseai.SamplerParameters', null, global); +goog.exportSymbol('proto.gooseai.StepParameter', null, global); +goog.exportSymbol('proto.gooseai.Token', null, global); +goog.exportSymbol('proto.gooseai.Tokens', null, global); +goog.exportSymbol('proto.gooseai.TransformType', null, global); +goog.exportSymbol('proto.gooseai.TransformType.TypeCase', null, global); +goog.exportSymbol('proto.gooseai.Upscaler', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.Token = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.Token, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.Token.displayName = 'proto.gooseai.Token'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.Tokens = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.gooseai.Tokens.repeatedFields_, null); +}; +goog.inherits(proto.gooseai.Tokens, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.Tokens.displayName = 'proto.gooseai.Tokens'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.Artifact = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.gooseai.Artifact.oneofGroups_); +}; +goog.inherits(proto.gooseai.Artifact, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.Artifact.displayName = 'proto.gooseai.Artifact'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.PromptParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.PromptParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.PromptParameters.displayName = 'proto.gooseai.PromptParameters'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.Prompt = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.gooseai.Prompt.oneofGroups_); +}; +goog.inherits(proto.gooseai.Prompt, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.Prompt.displayName = 'proto.gooseai.Prompt'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.AnswerMeta = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.AnswerMeta, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.AnswerMeta.displayName = 'proto.gooseai.AnswerMeta'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.Answer = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.gooseai.Answer.repeatedFields_, null); +}; +goog.inherits(proto.gooseai.Answer, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.Answer.displayName = 'proto.gooseai.Answer'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.SamplerParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.SamplerParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.SamplerParameters.displayName = 'proto.gooseai.SamplerParameters'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.ConditionerParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.ConditionerParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.ConditionerParameters.displayName = 'proto.gooseai.ConditionerParameters'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.StepParameter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.StepParameter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.StepParameter.displayName = 'proto.gooseai.StepParameter'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.TransformType = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.gooseai.TransformType.oneofGroups_); +}; +goog.inherits(proto.gooseai.TransformType, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.TransformType.displayName = 'proto.gooseai.TransformType'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.ImageParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.gooseai.ImageParameters.repeatedFields_, null); +}; +goog.inherits(proto.gooseai.ImageParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.ImageParameters.displayName = 'proto.gooseai.ImageParameters'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.ClassifierConcept = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.gooseai.ClassifierConcept, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.ClassifierConcept.displayName = 'proto.gooseai.ClassifierConcept'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.ClassifierCategory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.gooseai.ClassifierCategory.repeatedFields_, null); +}; +goog.inherits(proto.gooseai.ClassifierCategory, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.ClassifierCategory.displayName = 'proto.gooseai.ClassifierCategory'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.ClassifierParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.gooseai.ClassifierParameters.repeatedFields_, null); +}; +goog.inherits(proto.gooseai.ClassifierParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.ClassifierParameters.displayName = 'proto.gooseai.ClassifierParameters'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.gooseai.Request = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.gooseai.Request.repeatedFields_, proto.gooseai.Request.oneofGroups_); +}; +goog.inherits(proto.gooseai.Request, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.gooseai.Request.displayName = 'proto.gooseai.Request'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.Token.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.Token.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.Token} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Token.toObject = function(includeInstance, msg) { + var f, obj = { + text: jspb.Message.getFieldWithDefault(msg, 1, ""), + id: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.Token} + */ +proto.gooseai.Token.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.Token; + return proto.gooseai.Token.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.Token} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.Token} + */ +proto.gooseai.Token.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setText(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.Token.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.Token.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.Token} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Token.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getId(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional string text = 1; + * @return {string} + */ +proto.gooseai.Token.prototype.getText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Token} returns this + */ +proto.gooseai.Token.prototype.setText = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.Token} returns this + */ +proto.gooseai.Token.prototype.clearText = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Token.prototype.hasText = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint32 id = 2; + * @return {number} + */ +proto.gooseai.Token.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.Token} returns this + */ +proto.gooseai.Token.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.gooseai.Tokens.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.Tokens.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.Tokens.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.Tokens} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Tokens.toObject = function(includeInstance, msg) { + var f, obj = { + tokensList: jspb.Message.toObjectList(msg.getTokensList(), + proto.gooseai.Token.toObject, includeInstance), + tokenizerId: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.Tokens} + */ +proto.gooseai.Tokens.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.Tokens; + return proto.gooseai.Tokens.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.Tokens} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.Tokens} + */ +proto.gooseai.Tokens.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.gooseai.Token; + reader.readMessage(value,proto.gooseai.Token.deserializeBinaryFromReader); + msg.addTokens(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTokenizerId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.Tokens.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.Tokens.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.Tokens} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Tokens.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokensList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.gooseai.Token.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * repeated Token tokens = 1; + * @return {!Array} + */ +proto.gooseai.Tokens.prototype.getTokensList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.Token, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.Tokens} returns this +*/ +proto.gooseai.Tokens.prototype.setTokensList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.gooseai.Token=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.Token} + */ +proto.gooseai.Tokens.prototype.addTokens = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.gooseai.Token, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.Tokens} returns this + */ +proto.gooseai.Tokens.prototype.clearTokensList = function() { + return this.setTokensList([]); +}; + + +/** + * optional string tokenizer_id = 2; + * @return {string} + */ +proto.gooseai.Tokens.prototype.getTokenizerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Tokens} returns this + */ +proto.gooseai.Tokens.prototype.setTokenizerId = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.Tokens} returns this + */ +proto.gooseai.Tokens.prototype.clearTokenizerId = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Tokens.prototype.hasTokenizerId = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.gooseai.Artifact.oneofGroups_ = [[5,6,7,11]]; + +/** + * @enum {number} + */ +proto.gooseai.Artifact.DataCase = { + DATA_NOT_SET: 0, + BINARY: 5, + TEXT: 6, + TOKENS: 7, + CLASSIFIER: 11 +}; + +/** + * @return {proto.gooseai.Artifact.DataCase} + */ +proto.gooseai.Artifact.prototype.getDataCase = function() { + return /** @type {proto.gooseai.Artifact.DataCase} */(jspb.Message.computeOneofCase(this, proto.gooseai.Artifact.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.Artifact.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.Artifact.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.Artifact} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Artifact.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + type: jspb.Message.getFieldWithDefault(msg, 2, 0), + mime: jspb.Message.getFieldWithDefault(msg, 3, ""), + magic: jspb.Message.getFieldWithDefault(msg, 4, ""), + binary: msg.getBinary_asB64(), + text: jspb.Message.getFieldWithDefault(msg, 6, ""), + tokens: (f = msg.getTokens()) && proto.gooseai.Tokens.toObject(includeInstance, f), + classifier: (f = msg.getClassifier()) && proto.gooseai.ClassifierParameters.toObject(includeInstance, f), + index: jspb.Message.getFieldWithDefault(msg, 8, 0), + finishReason: jspb.Message.getFieldWithDefault(msg, 9, 0), + seed: jspb.Message.getFieldWithDefault(msg, 10, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.Artifact} + */ +proto.gooseai.Artifact.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.Artifact; + return proto.gooseai.Artifact.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.Artifact} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.Artifact} + */ +proto.gooseai.Artifact.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {!proto.gooseai.ArtifactType} */ (reader.readEnum()); + msg.setType(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setMime(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setMagic(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBinary(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setText(value); + break; + case 7: + var value = new proto.gooseai.Tokens; + reader.readMessage(value,proto.gooseai.Tokens.deserializeBinaryFromReader); + msg.setTokens(value); + break; + case 11: + var value = new proto.gooseai.ClassifierParameters; + reader.readMessage(value,proto.gooseai.ClassifierParameters.deserializeBinaryFromReader); + msg.setClassifier(value); + break; + case 8: + var value = /** @type {number} */ (reader.readUint32()); + msg.setIndex(value); + break; + case 9: + var value = /** @type {!proto.gooseai.FinishReason} */ (reader.readEnum()); + msg.setFinishReason(value); + break; + case 10: + var value = /** @type {number} */ (reader.readUint32()); + msg.setSeed(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.Artifact.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.Artifact.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.Artifact} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Artifact.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getMime(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeBytes( + 5, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } + f = message.getTokens(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.gooseai.Tokens.serializeBinaryToWriter + ); + } + f = message.getClassifier(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.gooseai.ClassifierParameters.serializeBinaryToWriter + ); + } + f = message.getIndex(); + if (f !== 0) { + writer.writeUint32( + 8, + f + ); + } + f = message.getFinishReason(); + if (f !== 0.0) { + writer.writeEnum( + 9, + f + ); + } + f = message.getSeed(); + if (f !== 0) { + writer.writeUint32( + 10, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.gooseai.Artifact.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional ArtifactType type = 2; + * @return {!proto.gooseai.ArtifactType} + */ +proto.gooseai.Artifact.prototype.getType = function() { + return /** @type {!proto.gooseai.ArtifactType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.gooseai.ArtifactType} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional string mime = 3; + * @return {string} + */ +proto.gooseai.Artifact.prototype.getMime = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setMime = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string magic = 4; + * @return {string} + */ +proto.gooseai.Artifact.prototype.getMagic = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setMagic = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.clearMagic = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Artifact.prototype.hasMagic = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bytes binary = 5; + * @return {!(string|Uint8Array)} + */ +proto.gooseai.Artifact.prototype.getBinary = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * optional bytes binary = 5; + * This is a type-conversion wrapper around `getBinary()` + * @return {string} + */ +proto.gooseai.Artifact.prototype.getBinary_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBinary())); +}; + + +/** + * optional bytes binary = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBinary()` + * @return {!Uint8Array} + */ +proto.gooseai.Artifact.prototype.getBinary_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBinary())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setBinary = function(value) { + return jspb.Message.setOneofField(this, 5, proto.gooseai.Artifact.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.clearBinary = function() { + return jspb.Message.setOneofField(this, 5, proto.gooseai.Artifact.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Artifact.prototype.hasBinary = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional string text = 6; + * @return {string} + */ +proto.gooseai.Artifact.prototype.getText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setText = function(value) { + return jspb.Message.setOneofField(this, 6, proto.gooseai.Artifact.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.clearText = function() { + return jspb.Message.setOneofField(this, 6, proto.gooseai.Artifact.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Artifact.prototype.hasText = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional Tokens tokens = 7; + * @return {?proto.gooseai.Tokens} + */ +proto.gooseai.Artifact.prototype.getTokens = function() { + return /** @type{?proto.gooseai.Tokens} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.Tokens, 7)); +}; + + +/** + * @param {?proto.gooseai.Tokens|undefined} value + * @return {!proto.gooseai.Artifact} returns this +*/ +proto.gooseai.Artifact.prototype.setTokens = function(value) { + return jspb.Message.setOneofWrapperField(this, 7, proto.gooseai.Artifact.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.clearTokens = function() { + return this.setTokens(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Artifact.prototype.hasTokens = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional ClassifierParameters classifier = 11; + * @return {?proto.gooseai.ClassifierParameters} + */ +proto.gooseai.Artifact.prototype.getClassifier = function() { + return /** @type{?proto.gooseai.ClassifierParameters} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.ClassifierParameters, 11)); +}; + + +/** + * @param {?proto.gooseai.ClassifierParameters|undefined} value + * @return {!proto.gooseai.Artifact} returns this +*/ +proto.gooseai.Artifact.prototype.setClassifier = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.gooseai.Artifact.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.clearClassifier = function() { + return this.setClassifier(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Artifact.prototype.hasClassifier = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional uint32 index = 8; + * @return {number} + */ +proto.gooseai.Artifact.prototype.getIndex = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setIndex = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional FinishReason finish_reason = 9; + * @return {!proto.gooseai.FinishReason} + */ +proto.gooseai.Artifact.prototype.getFinishReason = function() { + return /** @type {!proto.gooseai.FinishReason} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +}; + + +/** + * @param {!proto.gooseai.FinishReason} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setFinishReason = function(value) { + return jspb.Message.setProto3EnumField(this, 9, value); +}; + + +/** + * optional uint32 seed = 10; + * @return {number} + */ +proto.gooseai.Artifact.prototype.getSeed = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.Artifact} returns this + */ +proto.gooseai.Artifact.prototype.setSeed = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.PromptParameters.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.PromptParameters.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.PromptParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.PromptParameters.toObject = function(includeInstance, msg) { + var f, obj = { + init: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + weight: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.PromptParameters} + */ +proto.gooseai.PromptParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.PromptParameters; + return proto.gooseai.PromptParameters.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.PromptParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.PromptParameters} + */ +proto.gooseai.PromptParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setInit(value); + break; + case 2: + var value = /** @type {number} */ (reader.readFloat()); + msg.setWeight(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.PromptParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.PromptParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.PromptParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.PromptParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBool( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeFloat( + 2, + f + ); + } +}; + + +/** + * optional bool init = 1; + * @return {boolean} + */ +proto.gooseai.PromptParameters.prototype.getInit = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.gooseai.PromptParameters} returns this + */ +proto.gooseai.PromptParameters.prototype.setInit = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.PromptParameters} returns this + */ +proto.gooseai.PromptParameters.prototype.clearInit = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.PromptParameters.prototype.hasInit = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional float weight = 2; + * @return {number} + */ +proto.gooseai.PromptParameters.prototype.getWeight = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.PromptParameters} returns this + */ +proto.gooseai.PromptParameters.prototype.setWeight = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.PromptParameters} returns this + */ +proto.gooseai.PromptParameters.prototype.clearWeight = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.PromptParameters.prototype.hasWeight = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.gooseai.Prompt.oneofGroups_ = [[2,3,4]]; + +/** + * @enum {number} + */ +proto.gooseai.Prompt.PromptCase = { + PROMPT_NOT_SET: 0, + TEXT: 2, + TOKENS: 3, + ARTIFACT: 4 +}; + +/** + * @return {proto.gooseai.Prompt.PromptCase} + */ +proto.gooseai.Prompt.prototype.getPromptCase = function() { + return /** @type {proto.gooseai.Prompt.PromptCase} */(jspb.Message.computeOneofCase(this, proto.gooseai.Prompt.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.Prompt.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.Prompt.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.Prompt} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Prompt.toObject = function(includeInstance, msg) { + var f, obj = { + parameters: (f = msg.getParameters()) && proto.gooseai.PromptParameters.toObject(includeInstance, f), + text: jspb.Message.getFieldWithDefault(msg, 2, ""), + tokens: (f = msg.getTokens()) && proto.gooseai.Tokens.toObject(includeInstance, f), + artifact: (f = msg.getArtifact()) && proto.gooseai.Artifact.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.Prompt} + */ +proto.gooseai.Prompt.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.Prompt; + return proto.gooseai.Prompt.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.Prompt} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.Prompt} + */ +proto.gooseai.Prompt.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.gooseai.PromptParameters; + reader.readMessage(value,proto.gooseai.PromptParameters.deserializeBinaryFromReader); + msg.setParameters(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setText(value); + break; + case 3: + var value = new proto.gooseai.Tokens; + reader.readMessage(value,proto.gooseai.Tokens.deserializeBinaryFromReader); + msg.setTokens(value); + break; + case 4: + var value = new proto.gooseai.Artifact; + reader.readMessage(value,proto.gooseai.Artifact.deserializeBinaryFromReader); + msg.setArtifact(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.Prompt.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.Prompt.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.Prompt} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Prompt.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getParameters(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.gooseai.PromptParameters.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = message.getTokens(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.gooseai.Tokens.serializeBinaryToWriter + ); + } + f = message.getArtifact(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.gooseai.Artifact.serializeBinaryToWriter + ); + } +}; + + +/** + * optional PromptParameters parameters = 1; + * @return {?proto.gooseai.PromptParameters} + */ +proto.gooseai.Prompt.prototype.getParameters = function() { + return /** @type{?proto.gooseai.PromptParameters} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.PromptParameters, 1)); +}; + + +/** + * @param {?proto.gooseai.PromptParameters|undefined} value + * @return {!proto.gooseai.Prompt} returns this +*/ +proto.gooseai.Prompt.prototype.setParameters = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Prompt} returns this + */ +proto.gooseai.Prompt.prototype.clearParameters = function() { + return this.setParameters(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Prompt.prototype.hasParameters = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string text = 2; + * @return {string} + */ +proto.gooseai.Prompt.prototype.getText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Prompt} returns this + */ +proto.gooseai.Prompt.prototype.setText = function(value) { + return jspb.Message.setOneofField(this, 2, proto.gooseai.Prompt.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.Prompt} returns this + */ +proto.gooseai.Prompt.prototype.clearText = function() { + return jspb.Message.setOneofField(this, 2, proto.gooseai.Prompt.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Prompt.prototype.hasText = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Tokens tokens = 3; + * @return {?proto.gooseai.Tokens} + */ +proto.gooseai.Prompt.prototype.getTokens = function() { + return /** @type{?proto.gooseai.Tokens} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.Tokens, 3)); +}; + + +/** + * @param {?proto.gooseai.Tokens|undefined} value + * @return {!proto.gooseai.Prompt} returns this +*/ +proto.gooseai.Prompt.prototype.setTokens = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.gooseai.Prompt.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Prompt} returns this + */ +proto.gooseai.Prompt.prototype.clearTokens = function() { + return this.setTokens(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Prompt.prototype.hasTokens = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Artifact artifact = 4; + * @return {?proto.gooseai.Artifact} + */ +proto.gooseai.Prompt.prototype.getArtifact = function() { + return /** @type{?proto.gooseai.Artifact} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.Artifact, 4)); +}; + + +/** + * @param {?proto.gooseai.Artifact|undefined} value + * @return {!proto.gooseai.Prompt} returns this +*/ +proto.gooseai.Prompt.prototype.setArtifact = function(value) { + return jspb.Message.setOneofWrapperField(this, 4, proto.gooseai.Prompt.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Prompt} returns this + */ +proto.gooseai.Prompt.prototype.clearArtifact = function() { + return this.setArtifact(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Prompt.prototype.hasArtifact = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.AnswerMeta.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.AnswerMeta.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.AnswerMeta} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.AnswerMeta.toObject = function(includeInstance, msg) { + var f, obj = { + gpuId: jspb.Message.getFieldWithDefault(msg, 1, ""), + cpuId: jspb.Message.getFieldWithDefault(msg, 2, ""), + nodeId: jspb.Message.getFieldWithDefault(msg, 3, ""), + engineId: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.AnswerMeta} + */ +proto.gooseai.AnswerMeta.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.AnswerMeta; + return proto.gooseai.AnswerMeta.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.AnswerMeta} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.AnswerMeta} + */ +proto.gooseai.AnswerMeta.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setGpuId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setCpuId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setNodeId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setEngineId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.AnswerMeta.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.AnswerMeta.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.AnswerMeta} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.AnswerMeta.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string gpu_id = 1; + * @return {string} + */ +proto.gooseai.AnswerMeta.prototype.getGpuId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.setGpuId = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.clearGpuId = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.AnswerMeta.prototype.hasGpuId = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string cpu_id = 2; + * @return {string} + */ +proto.gooseai.AnswerMeta.prototype.getCpuId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.setCpuId = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.clearCpuId = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.AnswerMeta.prototype.hasCpuId = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string node_id = 3; + * @return {string} + */ +proto.gooseai.AnswerMeta.prototype.getNodeId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.setNodeId = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.clearNodeId = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.AnswerMeta.prototype.hasNodeId = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string engine_id = 4; + * @return {string} + */ +proto.gooseai.AnswerMeta.prototype.getEngineId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.setEngineId = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.AnswerMeta} returns this + */ +proto.gooseai.AnswerMeta.prototype.clearEngineId = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.AnswerMeta.prototype.hasEngineId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.gooseai.Answer.repeatedFields_ = [7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.Answer.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.Answer.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.Answer} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Answer.toObject = function(includeInstance, msg) { + var f, obj = { + answerId: jspb.Message.getFieldWithDefault(msg, 1, ""), + requestId: jspb.Message.getFieldWithDefault(msg, 2, ""), + received: jspb.Message.getFieldWithDefault(msg, 3, 0), + created: jspb.Message.getFieldWithDefault(msg, 4, 0), + meta: (f = msg.getMeta()) && proto.gooseai.AnswerMeta.toObject(includeInstance, f), + artifactsList: jspb.Message.toObjectList(msg.getArtifactsList(), + proto.gooseai.Artifact.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.Answer} + */ +proto.gooseai.Answer.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.Answer; + return proto.gooseai.Answer.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.Answer} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.Answer} + */ +proto.gooseai.Answer.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAnswerId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setReceived(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setCreated(value); + break; + case 6: + var value = new proto.gooseai.AnswerMeta; + reader.readMessage(value,proto.gooseai.AnswerMeta.deserializeBinaryFromReader); + msg.setMeta(value); + break; + case 7: + var value = new proto.gooseai.Artifact; + reader.readMessage(value,proto.gooseai.Artifact.deserializeBinaryFromReader); + msg.addArtifacts(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.Answer.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.Answer.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.Answer} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Answer.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAnswerId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getReceived(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getCreated(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getMeta(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.gooseai.AnswerMeta.serializeBinaryToWriter + ); + } + f = message.getArtifactsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.gooseai.Artifact.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string answer_id = 1; + * @return {string} + */ +proto.gooseai.Answer.prototype.getAnswerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Answer} returns this + */ +proto.gooseai.Answer.prototype.setAnswerId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string request_id = 2; + * @return {string} + */ +proto.gooseai.Answer.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Answer} returns this + */ +proto.gooseai.Answer.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional uint64 received = 3; + * @return {number} + */ +proto.gooseai.Answer.prototype.getReceived = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.Answer} returns this + */ +proto.gooseai.Answer.prototype.setReceived = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint64 created = 4; + * @return {number} + */ +proto.gooseai.Answer.prototype.getCreated = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.Answer} returns this + */ +proto.gooseai.Answer.prototype.setCreated = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional AnswerMeta meta = 6; + * @return {?proto.gooseai.AnswerMeta} + */ +proto.gooseai.Answer.prototype.getMeta = function() { + return /** @type{?proto.gooseai.AnswerMeta} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.AnswerMeta, 6)); +}; + + +/** + * @param {?proto.gooseai.AnswerMeta|undefined} value + * @return {!proto.gooseai.Answer} returns this +*/ +proto.gooseai.Answer.prototype.setMeta = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Answer} returns this + */ +proto.gooseai.Answer.prototype.clearMeta = function() { + return this.setMeta(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Answer.prototype.hasMeta = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * repeated Artifact artifacts = 7; + * @return {!Array} + */ +proto.gooseai.Answer.prototype.getArtifactsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.Artifact, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.Answer} returns this +*/ +proto.gooseai.Answer.prototype.setArtifactsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.gooseai.Artifact=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.Artifact} + */ +proto.gooseai.Answer.prototype.addArtifacts = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.gooseai.Artifact, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.Answer} returns this + */ +proto.gooseai.Answer.prototype.clearArtifactsList = function() { + return this.setArtifactsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.SamplerParameters.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.SamplerParameters.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.SamplerParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.SamplerParameters.toObject = function(includeInstance, msg) { + var f, obj = { + eta: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), + samplingSteps: jspb.Message.getFieldWithDefault(msg, 2, 0), + latentChannels: jspb.Message.getFieldWithDefault(msg, 3, 0), + downsamplingFactor: jspb.Message.getFieldWithDefault(msg, 4, 0), + cfgScale: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.SamplerParameters} + */ +proto.gooseai.SamplerParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.SamplerParameters; + return proto.gooseai.SamplerParameters.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.SamplerParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.SamplerParameters} + */ +proto.gooseai.SamplerParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readFloat()); + msg.setEta(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSamplingSteps(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setLatentChannels(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setDownsamplingFactor(value); + break; + case 5: + var value = /** @type {number} */ (reader.readFloat()); + msg.setCfgScale(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.SamplerParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.SamplerParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.SamplerParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.SamplerParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeFloat( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint64( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeUint64( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeUint64( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeFloat( + 5, + f + ); + } +}; + + +/** + * optional float eta = 1; + * @return {number} + */ +proto.gooseai.SamplerParameters.prototype.getEta = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.setEta = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.clearEta = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.SamplerParameters.prototype.hasEta = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint64 sampling_steps = 2; + * @return {number} + */ +proto.gooseai.SamplerParameters.prototype.getSamplingSteps = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.setSamplingSteps = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.clearSamplingSteps = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.SamplerParameters.prototype.hasSamplingSteps = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional uint64 latent_channels = 3; + * @return {number} + */ +proto.gooseai.SamplerParameters.prototype.getLatentChannels = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.setLatentChannels = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.clearLatentChannels = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.SamplerParameters.prototype.hasLatentChannels = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional uint64 downsampling_factor = 4; + * @return {number} + */ +proto.gooseai.SamplerParameters.prototype.getDownsamplingFactor = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.setDownsamplingFactor = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.clearDownsamplingFactor = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.SamplerParameters.prototype.hasDownsamplingFactor = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional float cfg_scale = 5; + * @return {number} + */ +proto.gooseai.SamplerParameters.prototype.getCfgScale = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.setCfgScale = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.SamplerParameters} returns this + */ +proto.gooseai.SamplerParameters.prototype.clearCfgScale = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.SamplerParameters.prototype.hasCfgScale = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.ConditionerParameters.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.ConditionerParameters.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.ConditionerParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ConditionerParameters.toObject = function(includeInstance, msg) { + var f, obj = { + vectorAdjustPrior: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.ConditionerParameters} + */ +proto.gooseai.ConditionerParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.ConditionerParameters; + return proto.gooseai.ConditionerParameters.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.ConditionerParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.ConditionerParameters} + */ +proto.gooseai.ConditionerParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVectorAdjustPrior(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.ConditionerParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.ConditionerParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.ConditionerParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ConditionerParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string vector_adjust_prior = 1; + * @return {string} + */ +proto.gooseai.ConditionerParameters.prototype.getVectorAdjustPrior = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.ConditionerParameters} returns this + */ +proto.gooseai.ConditionerParameters.prototype.setVectorAdjustPrior = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ConditionerParameters} returns this + */ +proto.gooseai.ConditionerParameters.prototype.clearVectorAdjustPrior = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ConditionerParameters.prototype.hasVectorAdjustPrior = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.StepParameter.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.StepParameter.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.StepParameter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.StepParameter.toObject = function(includeInstance, msg) { + var f, obj = { + scaledStep: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), + sampler: (f = msg.getSampler()) && proto.gooseai.SamplerParameters.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.StepParameter} + */ +proto.gooseai.StepParameter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.StepParameter; + return proto.gooseai.StepParameter.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.StepParameter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.StepParameter} + */ +proto.gooseai.StepParameter.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readFloat()); + msg.setScaledStep(value); + break; + case 2: + var value = new proto.gooseai.SamplerParameters; + reader.readMessage(value,proto.gooseai.SamplerParameters.deserializeBinaryFromReader); + msg.setSampler(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.StepParameter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.StepParameter.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.StepParameter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.StepParameter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getScaledStep(); + if (f !== 0.0) { + writer.writeFloat( + 1, + f + ); + } + f = message.getSampler(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.gooseai.SamplerParameters.serializeBinaryToWriter + ); + } +}; + + +/** + * optional float scaled_step = 1; + * @return {number} + */ +proto.gooseai.StepParameter.prototype.getScaledStep = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.StepParameter} returns this + */ +proto.gooseai.StepParameter.prototype.setScaledStep = function(value) { + return jspb.Message.setProto3FloatField(this, 1, value); +}; + + +/** + * optional SamplerParameters sampler = 2; + * @return {?proto.gooseai.SamplerParameters} + */ +proto.gooseai.StepParameter.prototype.getSampler = function() { + return /** @type{?proto.gooseai.SamplerParameters} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.SamplerParameters, 2)); +}; + + +/** + * @param {?proto.gooseai.SamplerParameters|undefined} value + * @return {!proto.gooseai.StepParameter} returns this +*/ +proto.gooseai.StepParameter.prototype.setSampler = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.StepParameter} returns this + */ +proto.gooseai.StepParameter.prototype.clearSampler = function() { + return this.setSampler(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.StepParameter.prototype.hasSampler = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.gooseai.TransformType.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.gooseai.TransformType.TypeCase = { + TYPE_NOT_SET: 0, + DIFFUSION: 1, + UPSCALER: 2 +}; + +/** + * @return {proto.gooseai.TransformType.TypeCase} + */ +proto.gooseai.TransformType.prototype.getTypeCase = function() { + return /** @type {proto.gooseai.TransformType.TypeCase} */(jspb.Message.computeOneofCase(this, proto.gooseai.TransformType.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.TransformType.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.TransformType.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.TransformType} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.TransformType.toObject = function(includeInstance, msg) { + var f, obj = { + diffusion: jspb.Message.getFieldWithDefault(msg, 1, 0), + upscaler: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.TransformType} + */ +proto.gooseai.TransformType.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.TransformType; + return proto.gooseai.TransformType.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.TransformType} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.TransformType} + */ +proto.gooseai.TransformType.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.gooseai.DiffusionSampler} */ (reader.readEnum()); + msg.setDiffusion(value); + break; + case 2: + var value = /** @type {!proto.gooseai.Upscaler} */ (reader.readEnum()); + msg.setUpscaler(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.TransformType.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.TransformType.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.TransformType} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.TransformType.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.gooseai.DiffusionSampler} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.gooseai.Upscaler} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * optional DiffusionSampler diffusion = 1; + * @return {!proto.gooseai.DiffusionSampler} + */ +proto.gooseai.TransformType.prototype.getDiffusion = function() { + return /** @type {!proto.gooseai.DiffusionSampler} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.gooseai.DiffusionSampler} value + * @return {!proto.gooseai.TransformType} returns this + */ +proto.gooseai.TransformType.prototype.setDiffusion = function(value) { + return jspb.Message.setOneofField(this, 1, proto.gooseai.TransformType.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.TransformType} returns this + */ +proto.gooseai.TransformType.prototype.clearDiffusion = function() { + return jspb.Message.setOneofField(this, 1, proto.gooseai.TransformType.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.TransformType.prototype.hasDiffusion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Upscaler upscaler = 2; + * @return {!proto.gooseai.Upscaler} + */ +proto.gooseai.TransformType.prototype.getUpscaler = function() { + return /** @type {!proto.gooseai.Upscaler} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.gooseai.Upscaler} value + * @return {!proto.gooseai.TransformType} returns this + */ +proto.gooseai.TransformType.prototype.setUpscaler = function(value) { + return jspb.Message.setOneofField(this, 2, proto.gooseai.TransformType.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.TransformType} returns this + */ +proto.gooseai.TransformType.prototype.clearUpscaler = function() { + return jspb.Message.setOneofField(this, 2, proto.gooseai.TransformType.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.TransformType.prototype.hasUpscaler = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.gooseai.ImageParameters.repeatedFields_ = [3,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.ImageParameters.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.ImageParameters.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.ImageParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ImageParameters.toObject = function(includeInstance, msg) { + var f, obj = { + height: jspb.Message.getFieldWithDefault(msg, 1, 0), + width: jspb.Message.getFieldWithDefault(msg, 2, 0), + seedList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + samples: jspb.Message.getFieldWithDefault(msg, 4, 0), + steps: jspb.Message.getFieldWithDefault(msg, 5, 0), + transform: (f = msg.getTransform()) && proto.gooseai.TransformType.toObject(includeInstance, f), + parametersList: jspb.Message.toObjectList(msg.getParametersList(), + proto.gooseai.StepParameter.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.ImageParameters} + */ +proto.gooseai.ImageParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.ImageParameters; + return proto.gooseai.ImageParameters.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.ImageParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.ImageParameters} + */ +proto.gooseai.ImageParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setHeight(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setWidth(value); + break; + case 3: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addSeed(values[i]); + } + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSamples(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSteps(value); + break; + case 6: + var value = new proto.gooseai.TransformType; + reader.readMessage(value,proto.gooseai.TransformType.deserializeBinaryFromReader); + msg.setTransform(value); + break; + case 7: + var value = new proto.gooseai.StepParameter; + reader.readMessage(value,proto.gooseai.StepParameter.deserializeBinaryFromReader); + msg.addParameters(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.ImageParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.ImageParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.ImageParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ImageParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeUint64( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint64( + 2, + f + ); + } + f = message.getSeedList(); + if (f.length > 0) { + writer.writePackedUint32( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeUint64( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeUint64( + 5, + f + ); + } + f = message.getTransform(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.gooseai.TransformType.serializeBinaryToWriter + ); + } + f = message.getParametersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.gooseai.StepParameter.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint64 height = 1; + * @return {number} + */ +proto.gooseai.ImageParameters.prototype.getHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.setHeight = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearHeight = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ImageParameters.prototype.hasHeight = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint64 width = 2; + * @return {number} + */ +proto.gooseai.ImageParameters.prototype.getWidth = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.setWidth = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearWidth = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ImageParameters.prototype.hasWidth = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated uint32 seed = 3; + * @return {!Array} + */ +proto.gooseai.ImageParameters.prototype.getSeedList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.setSeedList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.addSeed = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearSeedList = function() { + return this.setSeedList([]); +}; + + +/** + * optional uint64 samples = 4; + * @return {number} + */ +proto.gooseai.ImageParameters.prototype.getSamples = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.setSamples = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearSamples = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ImageParameters.prototype.hasSamples = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional uint64 steps = 5; + * @return {number} + */ +proto.gooseai.ImageParameters.prototype.getSteps = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.setSteps = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearSteps = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ImageParameters.prototype.hasSteps = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional TransformType transform = 6; + * @return {?proto.gooseai.TransformType} + */ +proto.gooseai.ImageParameters.prototype.getTransform = function() { + return /** @type{?proto.gooseai.TransformType} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.TransformType, 6)); +}; + + +/** + * @param {?proto.gooseai.TransformType|undefined} value + * @return {!proto.gooseai.ImageParameters} returns this +*/ +proto.gooseai.ImageParameters.prototype.setTransform = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearTransform = function() { + return this.setTransform(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ImageParameters.prototype.hasTransform = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * repeated StepParameter parameters = 7; + * @return {!Array} + */ +proto.gooseai.ImageParameters.prototype.getParametersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.StepParameter, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.ImageParameters} returns this +*/ +proto.gooseai.ImageParameters.prototype.setParametersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.gooseai.StepParameter=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.StepParameter} + */ +proto.gooseai.ImageParameters.prototype.addParameters = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.gooseai.StepParameter, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.ImageParameters} returns this + */ +proto.gooseai.ImageParameters.prototype.clearParametersList = function() { + return this.setParametersList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.ClassifierConcept.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.ClassifierConcept.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.ClassifierConcept} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ClassifierConcept.toObject = function(includeInstance, msg) { + var f, obj = { + concept: jspb.Message.getFieldWithDefault(msg, 1, ""), + threshold: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.ClassifierConcept} + */ +proto.gooseai.ClassifierConcept.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.ClassifierConcept; + return proto.gooseai.ClassifierConcept.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.ClassifierConcept} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.ClassifierConcept} + */ +proto.gooseai.ClassifierConcept.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setConcept(value); + break; + case 2: + var value = /** @type {number} */ (reader.readFloat()); + msg.setThreshold(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.ClassifierConcept.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.ClassifierConcept.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.ClassifierConcept} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ClassifierConcept.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConcept(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeFloat( + 2, + f + ); + } +}; + + +/** + * optional string concept = 1; + * @return {string} + */ +proto.gooseai.ClassifierConcept.prototype.getConcept = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.ClassifierConcept} returns this + */ +proto.gooseai.ClassifierConcept.prototype.setConcept = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional float threshold = 2; + * @return {number} + */ +proto.gooseai.ClassifierConcept.prototype.getThreshold = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.ClassifierConcept} returns this + */ +proto.gooseai.ClassifierConcept.prototype.setThreshold = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ClassifierConcept} returns this + */ +proto.gooseai.ClassifierConcept.prototype.clearThreshold = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ClassifierConcept.prototype.hasThreshold = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.gooseai.ClassifierCategory.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.ClassifierCategory.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.ClassifierCategory.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.ClassifierCategory} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ClassifierCategory.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + conceptsList: jspb.Message.toObjectList(msg.getConceptsList(), + proto.gooseai.ClassifierConcept.toObject, includeInstance), + adjustment: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), + action: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.ClassifierCategory} + */ +proto.gooseai.ClassifierCategory.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.ClassifierCategory; + return proto.gooseai.ClassifierCategory.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.ClassifierCategory} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.ClassifierCategory} + */ +proto.gooseai.ClassifierCategory.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = new proto.gooseai.ClassifierConcept; + reader.readMessage(value,proto.gooseai.ClassifierConcept.deserializeBinaryFromReader); + msg.addConcepts(value); + break; + case 3: + var value = /** @type {number} */ (reader.readFloat()); + msg.setAdjustment(value); + break; + case 4: + var value = /** @type {!proto.gooseai.Action} */ (reader.readEnum()); + msg.setAction(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.ClassifierCategory.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.ClassifierCategory.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.ClassifierCategory} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ClassifierCategory.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getConceptsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.gooseai.ClassifierConcept.serializeBinaryToWriter + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeFloat( + 3, + f + ); + } + f = /** @type {!proto.gooseai.Action} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeEnum( + 4, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.gooseai.ClassifierCategory.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.ClassifierCategory} returns this + */ +proto.gooseai.ClassifierCategory.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated ClassifierConcept concepts = 2; + * @return {!Array} + */ +proto.gooseai.ClassifierCategory.prototype.getConceptsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.ClassifierConcept, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.ClassifierCategory} returns this +*/ +proto.gooseai.ClassifierCategory.prototype.setConceptsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.gooseai.ClassifierConcept=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.ClassifierConcept} + */ +proto.gooseai.ClassifierCategory.prototype.addConcepts = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.gooseai.ClassifierConcept, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.ClassifierCategory} returns this + */ +proto.gooseai.ClassifierCategory.prototype.clearConceptsList = function() { + return this.setConceptsList([]); +}; + + +/** + * optional float adjustment = 3; + * @return {number} + */ +proto.gooseai.ClassifierCategory.prototype.getAdjustment = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.gooseai.ClassifierCategory} returns this + */ +proto.gooseai.ClassifierCategory.prototype.setAdjustment = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ClassifierCategory} returns this + */ +proto.gooseai.ClassifierCategory.prototype.clearAdjustment = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ClassifierCategory.prototype.hasAdjustment = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Action action = 4; + * @return {!proto.gooseai.Action} + */ +proto.gooseai.ClassifierCategory.prototype.getAction = function() { + return /** @type {!proto.gooseai.Action} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.gooseai.Action} value + * @return {!proto.gooseai.ClassifierCategory} returns this + */ +proto.gooseai.ClassifierCategory.prototype.setAction = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ClassifierCategory} returns this + */ +proto.gooseai.ClassifierCategory.prototype.clearAction = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ClassifierCategory.prototype.hasAction = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.gooseai.ClassifierParameters.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.ClassifierParameters.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.ClassifierParameters.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.ClassifierParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ClassifierParameters.toObject = function(includeInstance, msg) { + var f, obj = { + categoriesList: jspb.Message.toObjectList(msg.getCategoriesList(), + proto.gooseai.ClassifierCategory.toObject, includeInstance), + exceedsList: jspb.Message.toObjectList(msg.getExceedsList(), + proto.gooseai.ClassifierCategory.toObject, includeInstance), + realizedAction: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.ClassifierParameters} + */ +proto.gooseai.ClassifierParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.ClassifierParameters; + return proto.gooseai.ClassifierParameters.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.ClassifierParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.ClassifierParameters} + */ +proto.gooseai.ClassifierParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.gooseai.ClassifierCategory; + reader.readMessage(value,proto.gooseai.ClassifierCategory.deserializeBinaryFromReader); + msg.addCategories(value); + break; + case 2: + var value = new proto.gooseai.ClassifierCategory; + reader.readMessage(value,proto.gooseai.ClassifierCategory.deserializeBinaryFromReader); + msg.addExceeds(value); + break; + case 3: + var value = /** @type {!proto.gooseai.Action} */ (reader.readEnum()); + msg.setRealizedAction(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.ClassifierParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.ClassifierParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.ClassifierParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.ClassifierParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCategoriesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.gooseai.ClassifierCategory.serializeBinaryToWriter + ); + } + f = message.getExceedsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.gooseai.ClassifierCategory.serializeBinaryToWriter + ); + } + f = /** @type {!proto.gooseai.Action} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeEnum( + 3, + f + ); + } +}; + + +/** + * repeated ClassifierCategory categories = 1; + * @return {!Array} + */ +proto.gooseai.ClassifierParameters.prototype.getCategoriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.ClassifierCategory, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.ClassifierParameters} returns this +*/ +proto.gooseai.ClassifierParameters.prototype.setCategoriesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.gooseai.ClassifierCategory=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.ClassifierCategory} + */ +proto.gooseai.ClassifierParameters.prototype.addCategories = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.gooseai.ClassifierCategory, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.ClassifierParameters} returns this + */ +proto.gooseai.ClassifierParameters.prototype.clearCategoriesList = function() { + return this.setCategoriesList([]); +}; + + +/** + * repeated ClassifierCategory exceeds = 2; + * @return {!Array} + */ +proto.gooseai.ClassifierParameters.prototype.getExceedsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.ClassifierCategory, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.ClassifierParameters} returns this +*/ +proto.gooseai.ClassifierParameters.prototype.setExceedsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.gooseai.ClassifierCategory=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.ClassifierCategory} + */ +proto.gooseai.ClassifierParameters.prototype.addExceeds = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.gooseai.ClassifierCategory, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.ClassifierParameters} returns this + */ +proto.gooseai.ClassifierParameters.prototype.clearExceedsList = function() { + return this.setExceedsList([]); +}; + + +/** + * optional Action realized_action = 3; + * @return {!proto.gooseai.Action} + */ +proto.gooseai.ClassifierParameters.prototype.getRealizedAction = function() { + return /** @type {!proto.gooseai.Action} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.gooseai.Action} value + * @return {!proto.gooseai.ClassifierParameters} returns this + */ +proto.gooseai.ClassifierParameters.prototype.setRealizedAction = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.gooseai.ClassifierParameters} returns this + */ +proto.gooseai.ClassifierParameters.prototype.clearRealizedAction = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.ClassifierParameters.prototype.hasRealizedAction = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.gooseai.Request.repeatedFields_ = [4]; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.gooseai.Request.oneofGroups_ = [[5]]; + +/** + * @enum {number} + */ +proto.gooseai.Request.ParamsCase = { + PARAMS_NOT_SET: 0, + IMAGE: 5 +}; + +/** + * @return {proto.gooseai.Request.ParamsCase} + */ +proto.gooseai.Request.prototype.getParamsCase = function() { + return /** @type {proto.gooseai.Request.ParamsCase} */(jspb.Message.computeOneofCase(this, proto.gooseai.Request.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.gooseai.Request.prototype.toObject = function(opt_includeInstance) { + return proto.gooseai.Request.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.gooseai.Request} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Request.toObject = function(includeInstance, msg) { + var f, obj = { + engineId: jspb.Message.getFieldWithDefault(msg, 1, ""), + requestId: jspb.Message.getFieldWithDefault(msg, 2, ""), + requestedType: jspb.Message.getFieldWithDefault(msg, 3, 0), + promptList: jspb.Message.toObjectList(msg.getPromptList(), + proto.gooseai.Prompt.toObject, includeInstance), + image: (f = msg.getImage()) && proto.gooseai.ImageParameters.toObject(includeInstance, f), + conditioner: (f = msg.getConditioner()) && proto.gooseai.ConditionerParameters.toObject(includeInstance, f), + classifier: (f = msg.getClassifier()) && proto.gooseai.ClassifierParameters.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.gooseai.Request} + */ +proto.gooseai.Request.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.gooseai.Request; + return proto.gooseai.Request.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.gooseai.Request} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.gooseai.Request} + */ +proto.gooseai.Request.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setEngineId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 3: + var value = /** @type {!proto.gooseai.ArtifactType} */ (reader.readEnum()); + msg.setRequestedType(value); + break; + case 4: + var value = new proto.gooseai.Prompt; + reader.readMessage(value,proto.gooseai.Prompt.deserializeBinaryFromReader); + msg.addPrompt(value); + break; + case 5: + var value = new proto.gooseai.ImageParameters; + reader.readMessage(value,proto.gooseai.ImageParameters.deserializeBinaryFromReader); + msg.setImage(value); + break; + case 6: + var value = new proto.gooseai.ConditionerParameters; + reader.readMessage(value,proto.gooseai.ConditionerParameters.deserializeBinaryFromReader); + msg.setConditioner(value); + break; + case 7: + var value = new proto.gooseai.ClassifierParameters; + reader.readMessage(value,proto.gooseai.ClassifierParameters.deserializeBinaryFromReader); + msg.setClassifier(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.gooseai.Request.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.gooseai.Request.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.gooseai.Request} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.gooseai.Request.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEngineId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRequestedType(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getPromptList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.gooseai.Prompt.serializeBinaryToWriter + ); + } + f = message.getImage(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.gooseai.ImageParameters.serializeBinaryToWriter + ); + } + f = message.getConditioner(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.gooseai.ConditionerParameters.serializeBinaryToWriter + ); + } + f = message.getClassifier(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.gooseai.ClassifierParameters.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string engine_id = 1; + * @return {string} + */ +proto.gooseai.Request.prototype.getEngineId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.setEngineId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string request_id = 2; + * @return {string} + */ +proto.gooseai.Request.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional ArtifactType requested_type = 3; + * @return {!proto.gooseai.ArtifactType} + */ +proto.gooseai.Request.prototype.getRequestedType = function() { + return /** @type {!proto.gooseai.ArtifactType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.gooseai.ArtifactType} value + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.setRequestedType = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * repeated Prompt prompt = 4; + * @return {!Array} + */ +proto.gooseai.Request.prototype.getPromptList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.gooseai.Prompt, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.gooseai.Request} returns this +*/ +proto.gooseai.Request.prototype.setPromptList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.gooseai.Prompt=} opt_value + * @param {number=} opt_index + * @return {!proto.gooseai.Prompt} + */ +proto.gooseai.Request.prototype.addPrompt = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.gooseai.Prompt, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.clearPromptList = function() { + return this.setPromptList([]); +}; + + +/** + * optional ImageParameters image = 5; + * @return {?proto.gooseai.ImageParameters} + */ +proto.gooseai.Request.prototype.getImage = function() { + return /** @type{?proto.gooseai.ImageParameters} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.ImageParameters, 5)); +}; + + +/** + * @param {?proto.gooseai.ImageParameters|undefined} value + * @return {!proto.gooseai.Request} returns this +*/ +proto.gooseai.Request.prototype.setImage = function(value) { + return jspb.Message.setOneofWrapperField(this, 5, proto.gooseai.Request.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.clearImage = function() { + return this.setImage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Request.prototype.hasImage = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional ConditionerParameters conditioner = 6; + * @return {?proto.gooseai.ConditionerParameters} + */ +proto.gooseai.Request.prototype.getConditioner = function() { + return /** @type{?proto.gooseai.ConditionerParameters} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.ConditionerParameters, 6)); +}; + + +/** + * @param {?proto.gooseai.ConditionerParameters|undefined} value + * @return {!proto.gooseai.Request} returns this +*/ +proto.gooseai.Request.prototype.setConditioner = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.clearConditioner = function() { + return this.setConditioner(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Request.prototype.hasConditioner = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional ClassifierParameters classifier = 7; + * @return {?proto.gooseai.ClassifierParameters} + */ +proto.gooseai.Request.prototype.getClassifier = function() { + return /** @type{?proto.gooseai.ClassifierParameters} */ ( + jspb.Message.getWrapperField(this, proto.gooseai.ClassifierParameters, 7)); +}; + + +/** + * @param {?proto.gooseai.ClassifierParameters|undefined} value + * @return {!proto.gooseai.Request} returns this +*/ +proto.gooseai.Request.prototype.setClassifier = function(value) { + return jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.gooseai.Request} returns this + */ +proto.gooseai.Request.prototype.clearClassifier = function() { + return this.setClassifier(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.gooseai.Request.prototype.hasClassifier = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * @enum {number} + */ +proto.gooseai.FinishReason = { + NULL: 0, + LENGTH: 1, + STOP: 2, + ERROR: 3, + FILTER: 4 +}; + +/** + * @enum {number} + */ +proto.gooseai.ArtifactType = { + ARTIFACT_NONE: 0, + ARTIFACT_IMAGE: 1, + ARTIFACT_VIDEO: 2, + ARTIFACT_TEXT: 3, + ARTIFACT_TOKENS: 4, + ARTIFACT_EMBEDDING: 5, + ARTIFACT_CLASSIFICATIONS: 6 +}; + +/** + * @enum {number} + */ +proto.gooseai.DiffusionSampler = { + SAMPLER_DDIM: 0, + SAMPLER_DDPM: 1, + SAMPLER_K_EULER: 2, + SAMPLER_K_EULER_ANCESTRAL: 3, + SAMPLER_K_HEUN: 4, + SAMPLER_K_DPM_2: 5, + SAMPLER_K_DPM_2_ANCESTRAL: 6, + SAMPLER_K_LMS: 7 +}; + +/** + * @enum {number} + */ +proto.gooseai.Upscaler = { + UPSCALER_RGB: 0, + UPSCALER_GFPGAN: 1, + UPSCALER_ESRGAN: 2 +}; + +/** + * @enum {number} + */ +proto.gooseai.Action = { + ACTION_PASSTHROUGH: 0, + ACTION_REGENERATE: 1, + ACTION_OBFUSCATE: 2, + ACTION_DISCARD: 3 +}; + +goog.object.extend(exports, proto.gooseai); diff --git a/src/js/generation_pb_service.d.ts b/src/js/generation_pb_service.d.ts new file mode 100644 index 00000000..5eebd9c5 --- /dev/null +++ b/src/js/generation_pb_service.d.ts @@ -0,0 +1,55 @@ +// package: gooseai +// file: generation.proto + +import * as generation_pb from "./generation_pb"; +import {grpc} from "@improbable-eng/grpc-web"; + +type GenerationServiceGenerate = { + readonly methodName: string; + readonly service: typeof GenerationService; + readonly requestStream: false; + readonly responseStream: true; + readonly requestType: typeof generation_pb.Request; + readonly responseType: typeof generation_pb.Answer; +}; + +export class GenerationService { + static readonly serviceName: string; + static readonly Generate: GenerationServiceGenerate; +} + +export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } +export type Status = { details: string, code: number; metadata: grpc.Metadata } + +interface UnaryResponse { + cancel(): void; +} +interface ResponseStream { + cancel(): void; + on(type: 'data', handler: (message: T) => void): ResponseStream; + on(type: 'end', handler: (status?: Status) => void): ResponseStream; + on(type: 'status', handler: (status: Status) => void): ResponseStream; +} +interface RequestStream { + write(message: T): RequestStream; + end(): void; + cancel(): void; + on(type: 'end', handler: (status?: Status) => void): RequestStream; + on(type: 'status', handler: (status: Status) => void): RequestStream; +} +interface BidirectionalStream { + write(message: ReqT): BidirectionalStream; + end(): void; + cancel(): void; + on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; + on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; + on(type: 'status', handler: (status: Status) => void): BidirectionalStream; +} + +export class GenerationServiceClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + generate(requestMessage: generation_pb.Request, metadata?: grpc.Metadata): ResponseStream; +} + diff --git a/src/js/generation_pb_service.js b/src/js/generation_pb_service.js new file mode 100644 index 00000000..ebc30eca --- /dev/null +++ b/src/js/generation_pb_service.js @@ -0,0 +1,69 @@ +// package: gooseai +// file: generation.proto + +var generation_pb = require("./generation_pb"); +var grpc = require("@improbable-eng/grpc-web").grpc; + +var GenerationService = (function () { + function GenerationService() {} + GenerationService.serviceName = "gooseai.GenerationService"; + return GenerationService; +}()); + +GenerationService.Generate = { + methodName: "Generate", + service: GenerationService, + requestStream: false, + responseStream: true, + requestType: generation_pb.Request, + responseType: generation_pb.Answer +}; + +exports.GenerationService = GenerationService; + +function GenerationServiceClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +GenerationServiceClient.prototype.generate = function generate(requestMessage, metadata) { + var listeners = { + data: [], + end: [], + status: [] + }; + var client = grpc.invoke(GenerationService.Generate, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onMessage: function (responseMessage) { + listeners.data.forEach(function (handler) { + handler(responseMessage); + }); + }, + onEnd: function (status, statusMessage, trailers) { + listeners.status.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners.end.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners = null; + } + }); + return { + on: function (type, handler) { + listeners[type].push(handler); + return this; + }, + cancel: function () { + listeners = null; + client.close(); + } + }; +}; + +exports.GenerationServiceClient = GenerationServiceClient; +