From c495603a753d0dc1b2c691a8b8f51b08b3e0ffcc Mon Sep 17 00:00:00 2001 From: Chris Sreesangkom Date: Thu, 15 Aug 2024 12:22:26 -0400 Subject: [PATCH 1/2] multi codegen typescript --- src/GEN_VERSION | 2 +- src/Nodes.ts | 327 ++++++++++++++++++++++++++++++++++++----------- src/OpenAPI.ts | 229 ++++++++++++++++++++++++++++++--- src/index.ts | 3 +- src/openapi.json | 212 ++++++++++++++++++++++++++++-- 5 files changed, 672 insertions(+), 101 deletions(-) diff --git a/src/GEN_VERSION b/src/GEN_VERSION index bf0b572..710ae09 100644 --- a/src/GEN_VERSION +++ b/src/GEN_VERSION @@ -1 +1 @@ -20240617.20240814 \ No newline at end of file +20240617.20240815 \ No newline at end of file diff --git a/src/Nodes.ts b/src/Nodes.ts index b3d0850..d1b2bc0 100644 --- a/src/Nodes.ts +++ b/src/Nodes.ts @@ -1,7 +1,7 @@ /** * 𐃏 Substrate * @generated file - * 20240617.20240814 + * 20240617.20240815 */ import * as OpenAPI from "substrate/OpenAPI"; @@ -59,6 +59,28 @@ export class ComputeTextInImageUris extends FutureArray { export class ComputeTextInImageUrisItem extends FutureString {} export class ComputeJSONInJsonSchema extends FutureAnyObject {} export class ComputeJSONOutJsonObject extends FutureAnyObject {} +/** Code response choices. */ +export class DeepseekOutChoices extends FutureArray { + /** Returns `GenerateCodeChoice` at given index. */ + override at(index: number) { + return new GenerateCodeChoice(this._directive.next(index)); + } + /** Returns the result for `DeepseekOutChoices` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} +/** Code response choices. */ +export class MultiGenerateCodeOutChoices extends FutureArray { + /** Returns `GenerateCodeChoice` at given index. */ + override at(index: number) { + return new GenerateCodeChoice(this._directive.next(index)); + } + /** Returns the result for `MultiGenerateCodeOutChoices` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} /** Response choices. */ export class MultiComputeTextOutChoices extends FutureArray { /** Returns `ComputeTextOut` at given index. */ @@ -944,6 +966,55 @@ export class ComputeJSONOut extends FutureObject { return super._result() as Promise; } } +/** DeepseekIn */ +export class DeepseekIn extends FutureObject { + /** Input prompt. */ + get prompt() { + return new FutureString(this._directive.next("prompt")); + } + /** Language of the code. */ + get language() { + return new FutureString(this._directive.next("language")); + } + /** (Optional) Number of choices to generate. */ + get num_choices() { + return new FutureNumber(this._directive.next("num_choices")); + } + /** (Optional) Higher values make the output more random, lower values make the output more deterministic. */ + get temperature() { + return new FutureNumber(this._directive.next("temperature")); + } + /** (Optional) Maximum number of tokens to generate. */ + get max_tokens() { + return new FutureNumber(this._directive.next("max_tokens")); + } + /** returns the result for `DeepseekIn` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} +/** DeepseekOut */ +export class DeepseekOut extends FutureObject { + /** Code response choices. */ + get choices() { + return new DeepseekOutChoices(this._directive.next("choices")); + } + /** returns the result for `DeepseekOut` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} +/** GenerateCodeChoice */ +export class GenerateCodeChoice extends FutureObject { + /** Code response. */ + get code() { + return new FutureString(this._directive.next("code")); + } + /** returns the result for `GenerateCodeChoice` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} /** GenerateCodeIn */ export class GenerateCodeIn extends FutureObject { /** Input prompt. */ @@ -978,6 +1049,44 @@ export class GenerateCodeOut extends FutureObject { return super._result() as Promise; } } +/** MultiGenerateCodeIn */ +export class MultiGenerateCodeIn extends FutureObject { + /** Input prompt. */ + get prompt() { + return new FutureString(this._directive.next("prompt")); + } + /** Language of the code. */ + get language() { + return new FutureString(this._directive.next("language")); + } + /** (Optional) Number of choices to generate. */ + get num_choices() { + return new FutureNumber(this._directive.next("num_choices")); + } + /** (Optional) Higher values make the output more random, lower values make the output more deterministic. */ + get temperature() { + return new FutureNumber(this._directive.next("temperature")); + } + /** (Optional) Maximum number of tokens to generate. */ + get max_tokens() { + return new FutureNumber(this._directive.next("max_tokens")); + } + /** returns the result for `MultiGenerateCodeIn` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} +/** MultiGenerateCodeOut */ +export class MultiGenerateCodeOut extends FutureObject { + /** Code response choices. */ + get choices() { + return new MultiGenerateCodeOutChoices(this._directive.next("choices")); + } + /** returns the result for `MultiGenerateCodeOut` once it's node has been run. */ + protected override async _result(): Promise { + return super._result() as Promise; + } +} /** MultiComputeTextIn */ export class MultiComputeTextIn extends FutureObject { /** Input prompt. */ @@ -3686,7 +3795,7 @@ export namespace GenerateCode { } /** - * Generate code in the specified language. + * Generate code in the specified language based on the prompt. * * https://www.substrate.run/nodes#GenerateCode */ @@ -3736,6 +3845,75 @@ export class GenerateCode extends Node { return super.output() as OpenAPI.components["schemas"]["GenerateCodeOut"]; } } +export namespace MultiGenerateCode { + /** + * MultiGenerateCode Input + * https://www.substrate.run/nodes#MultiGenerateCode + */ + export type Input = FutureExpandAny< + OpenAPI.components["schemas"]["MultiGenerateCodeIn"] + >; + + /** + * MultiGenerateCode Output + * https://www.substrate.run/nodes#MultiGenerateCode + */ + export type Output = OpenAPI.components["schemas"]["MultiGenerateCodeOut"]; +} + +/** + * Generate multiple choices of code in the specified language based on the prompt. + * + * https://www.substrate.run/nodes#MultiGenerateCode + */ +export class MultiGenerateCode extends Node { + /** + * Input arguments: `prompt`, `language`, `num_choices` (optional), `temperature` (optional), `max_tokens` (optional) + * + * Output fields: `choices` + * + * https://www.substrate.run/nodes#MultiGenerateCode + */ + constructor( + args: FutureExpandAny, + options?: Options, + ) { + super(args, options); + this.node = "MultiGenerateCode"; + } + + /** + * Retrieve this node's output from a response. + * + * Output fields: `choices` + * + * https://www.substrate.run/nodes#MultiGenerateCode + */ + protected override async result(): Promise< + OpenAPI.components["schemas"]["MultiGenerateCodeOut"] | undefined + > { + return Promise.resolve( + this._response ? this._response.get(this) : undefined, + ) as Promise< + OpenAPI.components["schemas"]["MultiGenerateCodeOut"] | undefined + >; + } + + /** + * Future reference to this node's output. + * + * Output fields: `choices` + * + * https://www.substrate.run/nodes#MultiGenerateCode + */ + override get future(): MultiGenerateCodeOut { + return new MultiGenerateCodeOut(new Trace([], this)); + } + + protected override output(): OpenAPI.components["schemas"]["MultiGenerateCodeOut"] { + return super.output() as OpenAPI.components["schemas"]["MultiGenerateCodeOut"]; + } +} export namespace Mistral7BInstruct { /** * Mistral7BInstruct Input @@ -6153,6 +6331,7 @@ export type AnyNode = | ComputeJSON | MultiComputeJSON | GenerateCode + | MultiGenerateCode | Mistral7BInstruct | Mixtral8x7BInstruct | Llama3Instruct8B @@ -6209,74 +6388,76 @@ export type NodeOutput = T extends Experimental ? OpenAPI.components["schemas"]["MultiComputeJSONOut"] : T extends GenerateCode ? OpenAPI.components["schemas"]["GenerateCodeOut"] - : T extends Mistral7BInstruct - ? OpenAPI.components["schemas"]["Mistral7BInstructOut"] - : T extends Mixtral8x7BInstruct - ? OpenAPI.components["schemas"]["Mixtral8x7BInstructOut"] - : T extends Llama3Instruct8B - ? OpenAPI.components["schemas"]["Llama3Instruct8BOut"] - : T extends Llama3Instruct70B - ? OpenAPI.components["schemas"]["Llama3Instruct70BOut"] - : T extends Firellava13B - ? OpenAPI.components["schemas"]["Firellava13BOut"] - : T extends GenerateImage - ? OpenAPI.components["schemas"]["GenerateImageOut"] - : T extends MultiGenerateImage - ? OpenAPI.components["schemas"]["MultiGenerateImageOut"] - : T extends InpaintImage - ? OpenAPI.components["schemas"]["InpaintImageOut"] - : T extends MultiInpaintImage - ? OpenAPI.components["schemas"]["MultiInpaintImageOut"] - : T extends StableDiffusionXLLightning - ? OpenAPI.components["schemas"]["StableDiffusionXLLightningOut"] - : T extends StableDiffusionXLInpaint - ? OpenAPI.components["schemas"]["StableDiffusionXLInpaintOut"] - : T extends StableDiffusionXLControlNet - ? OpenAPI.components["schemas"]["StableDiffusionXLControlNetOut"] - : T extends StableVideoDiffusion - ? OpenAPI.components["schemas"]["StableVideoDiffusionOut"] - : T extends InterpolateFrames - ? OpenAPI.components["schemas"]["InterpolateFramesOut"] - : T extends TranscribeSpeech - ? OpenAPI.components["schemas"]["TranscribeSpeechOut"] - : T extends GenerateSpeech - ? OpenAPI.components["schemas"]["GenerateSpeechOut"] - : T extends RemoveBackground - ? OpenAPI.components["schemas"]["RemoveBackgroundOut"] - : T extends EraseImage - ? OpenAPI.components["schemas"]["EraseImageOut"] - : T extends UpscaleImage - ? OpenAPI.components["schemas"]["UpscaleImageOut"] - : T extends SegmentUnderPoint - ? OpenAPI.components["schemas"]["SegmentUnderPointOut"] - : T extends SegmentAnything - ? OpenAPI.components["schemas"]["SegmentAnythingOut"] - : T extends SplitDocument - ? OpenAPI.components["schemas"]["SplitDocumentOut"] - : T extends EmbedText - ? OpenAPI.components["schemas"]["EmbedTextOut"] - : T extends MultiEmbedText - ? OpenAPI.components["schemas"]["MultiEmbedTextOut"] - : T extends EmbedImage - ? OpenAPI.components["schemas"]["EmbedImageOut"] - : T extends MultiEmbedImage - ? OpenAPI.components["schemas"]["MultiEmbedImageOut"] - : T extends JinaV2 - ? OpenAPI.components["schemas"]["JinaV2Out"] - : T extends CLIP - ? OpenAPI.components["schemas"]["CLIPOut"] - : T extends FindOrCreateVectorStore - ? OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"] - : T extends ListVectorStores - ? OpenAPI.components["schemas"]["ListVectorStoresOut"] - : T extends DeleteVectorStore - ? OpenAPI.components["schemas"]["DeleteVectorStoreOut"] - : T extends QueryVectorStore - ? OpenAPI.components["schemas"]["QueryVectorStoreOut"] - : T extends FetchVectors - ? OpenAPI.components["schemas"]["FetchVectorsOut"] - : T extends UpdateVectors - ? OpenAPI.components["schemas"]["UpdateVectorsOut"] - : T extends DeleteVectors - ? OpenAPI.components["schemas"]["DeleteVectorsOut"] - : never; + : T extends MultiGenerateCode + ? OpenAPI.components["schemas"]["MultiGenerateCodeOut"] + : T extends Mistral7BInstruct + ? OpenAPI.components["schemas"]["Mistral7BInstructOut"] + : T extends Mixtral8x7BInstruct + ? OpenAPI.components["schemas"]["Mixtral8x7BInstructOut"] + : T extends Llama3Instruct8B + ? OpenAPI.components["schemas"]["Llama3Instruct8BOut"] + : T extends Llama3Instruct70B + ? OpenAPI.components["schemas"]["Llama3Instruct70BOut"] + : T extends Firellava13B + ? OpenAPI.components["schemas"]["Firellava13BOut"] + : T extends GenerateImage + ? OpenAPI.components["schemas"]["GenerateImageOut"] + : T extends MultiGenerateImage + ? OpenAPI.components["schemas"]["MultiGenerateImageOut"] + : T extends InpaintImage + ? OpenAPI.components["schemas"]["InpaintImageOut"] + : T extends MultiInpaintImage + ? OpenAPI.components["schemas"]["MultiInpaintImageOut"] + : T extends StableDiffusionXLLightning + ? OpenAPI.components["schemas"]["StableDiffusionXLLightningOut"] + : T extends StableDiffusionXLInpaint + ? OpenAPI.components["schemas"]["StableDiffusionXLInpaintOut"] + : T extends StableDiffusionXLControlNet + ? OpenAPI.components["schemas"]["StableDiffusionXLControlNetOut"] + : T extends StableVideoDiffusion + ? OpenAPI.components["schemas"]["StableVideoDiffusionOut"] + : T extends InterpolateFrames + ? OpenAPI.components["schemas"]["InterpolateFramesOut"] + : T extends TranscribeSpeech + ? OpenAPI.components["schemas"]["TranscribeSpeechOut"] + : T extends GenerateSpeech + ? OpenAPI.components["schemas"]["GenerateSpeechOut"] + : T extends RemoveBackground + ? OpenAPI.components["schemas"]["RemoveBackgroundOut"] + : T extends EraseImage + ? OpenAPI.components["schemas"]["EraseImageOut"] + : T extends UpscaleImage + ? OpenAPI.components["schemas"]["UpscaleImageOut"] + : T extends SegmentUnderPoint + ? OpenAPI.components["schemas"]["SegmentUnderPointOut"] + : T extends SegmentAnything + ? OpenAPI.components["schemas"]["SegmentAnythingOut"] + : T extends SplitDocument + ? OpenAPI.components["schemas"]["SplitDocumentOut"] + : T extends EmbedText + ? OpenAPI.components["schemas"]["EmbedTextOut"] + : T extends MultiEmbedText + ? OpenAPI.components["schemas"]["MultiEmbedTextOut"] + : T extends EmbedImage + ? OpenAPI.components["schemas"]["EmbedImageOut"] + : T extends MultiEmbedImage + ? OpenAPI.components["schemas"]["MultiEmbedImageOut"] + : T extends JinaV2 + ? OpenAPI.components["schemas"]["JinaV2Out"] + : T extends CLIP + ? OpenAPI.components["schemas"]["CLIPOut"] + : T extends FindOrCreateVectorStore + ? OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"] + : T extends ListVectorStores + ? OpenAPI.components["schemas"]["ListVectorStoresOut"] + : T extends DeleteVectorStore + ? OpenAPI.components["schemas"]["DeleteVectorStoreOut"] + : T extends QueryVectorStore + ? OpenAPI.components["schemas"]["QueryVectorStoreOut"] + : T extends FetchVectors + ? OpenAPI.components["schemas"]["FetchVectorsOut"] + : T extends UpdateVectors + ? OpenAPI.components["schemas"]["UpdateVectorsOut"] + : T extends DeleteVectors + ? OpenAPI.components["schemas"]["DeleteVectorsOut"] + : never; diff --git a/src/OpenAPI.ts b/src/OpenAPI.ts index f85b1f5..553ec22 100644 --- a/src/OpenAPI.ts +++ b/src/OpenAPI.ts @@ -215,7 +215,7 @@ export interface paths { put?: never; /** * GenerateCode - * @description Generate code in the specified language. + * @description Generate code in the specified language based on the prompt. */ post: operations["GenerateCode"]; delete?: never; @@ -224,6 +224,26 @@ export interface paths { patch?: never; trace?: never; }; + "/MultiGenerateCode": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * MultiGenerateCode + * @description Generate multiple choices of code in the specified language based on the prompt. + */ + post: operations["MultiGenerateCode"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/Mistral7BInstruct": { parameters: { query?: never; @@ -1084,6 +1104,57 @@ export interface components { /** @description If the model output could not be parsed to JSON, this is the raw text output. */ text?: string; }; + /** DeepseekIn */ + DeepseekIn: { + /** @description Input prompt. */ + prompt: string; + /** + * @description Language of the code. + * @enum {string} + */ + language: + | "c" + | "c++" + | "c#" + | "css" + | "go" + | "html" + | "java" + | "javascript" + | "json" + | "python" + | "r" + | "ruby" + | "shell" + | "sql" + | "tex" + | "typescript"; + /** + * @description Number of choices to generate. + * @default 1 + */ + num_choices: number; + /** + * Format: float + * @description Higher values make the output more random, lower values make the output more deterministic. + */ + temperature?: number; + /** @description Maximum number of tokens to generate. */ + max_tokens?: number; + }; + /** DeepseekOut */ + DeepseekOut: { + /** @description Code response choices. */ + choices: { + /** @description Code response. */ + code: string; + }[]; + }; + /** GenerateCodeChoice */ + GenerateCodeChoice: { + /** @description Code response. */ + code: string; + }; /** GenerateCodeIn */ GenerateCodeIn: { /** @description Input prompt. */ @@ -1093,18 +1164,22 @@ export interface components { * @enum {string} */ language: - | "python" - | "java" + | "c" | "c++" - | "javascript" - | "typescript" - | "php" - | "html" | "c#" - | "sql" + | "css" + | "go" + | "html" + | "java" + | "javascript" + | "json" + | "python" + | "r" | "ruby" + | "shell" + | "sql" | "tex" - | "shell"; + | "typescript"; /** * Format: float * @description Higher values make the output more random, lower values make the output more deterministic. @@ -1118,6 +1193,52 @@ export interface components { /** @description Code response. */ code: string; }; + /** MultiGenerateCodeIn */ + MultiGenerateCodeIn: { + /** @description Input prompt. */ + prompt: string; + /** + * @description Language of the code. + * @enum {string} + */ + language: + | "c" + | "c++" + | "c#" + | "css" + | "go" + | "html" + | "java" + | "javascript" + | "json" + | "python" + | "r" + | "ruby" + | "shell" + | "sql" + | "tex" + | "typescript"; + /** + * @description Number of choices to generate. + * @default 1 + */ + num_choices: number; + /** + * Format: float + * @description Higher values make the output more random, lower values make the output more deterministic. + */ + temperature?: number; + /** @description Maximum number of tokens to generate. */ + max_tokens?: number; + }; + /** MultiGenerateCodeOut */ + MultiGenerateCodeOut: { + /** @description Code response choices. */ + choices: { + /** @description Code response. */ + code: string; + }[]; + }; /** MultiComputeTextIn */ MultiComputeTextIn: { /** @description Input prompt. */ @@ -3371,18 +3492,22 @@ export interface operations { * @enum {string} */ language: - | "python" - | "java" + | "c" | "c++" - | "javascript" - | "typescript" - | "php" - | "html" | "c#" - | "sql" + | "css" + | "go" + | "html" + | "java" + | "javascript" + | "json" + | "python" + | "r" | "ruby" + | "shell" + | "sql" | "tex" - | "shell"; + | "typescript"; /** * Format: float * @description Higher values make the output more random, lower values make the output more deterministic. @@ -3408,6 +3533,76 @@ export interface operations { }; }; }; + MultiGenerateCode: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + /** @example { + * "prompt": "Write a function that prints 'Hello, World!'", + * "language": "python" + * } */ + "application/json": { + /** @description Input prompt. */ + prompt: string; + /** + * @description Language of the code. + * @enum {string} + */ + language: + | "c" + | "c++" + | "c#" + | "css" + | "go" + | "html" + | "java" + | "javascript" + | "json" + | "python" + | "r" + | "ruby" + | "shell" + | "sql" + | "tex" + | "typescript"; + /** + * @description Number of choices to generate. + * @default 1 + */ + num_choices?: number; + /** + * Format: float + * @description Higher values make the output more random, lower values make the output more deterministic. + */ + temperature?: number; + /** @description Maximum number of tokens to generate. */ + max_tokens?: number; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @description Code response choices. */ + choices: { + /** @description Code response. */ + code: string; + }[]; + }; + }; + }; + }; + }; Mistral7BInstruct: { parameters: { query?: never; diff --git a/src/index.ts b/src/index.ts index f8be650..52e5fee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ /** * 𐃏 Substrate TypeScript SDK * @generated file - * 20240617.20240814 + * 20240617.20240815 */ export { SubstrateError } from "substrate/Error"; @@ -16,6 +16,7 @@ export { ComputeJSON, MultiComputeJSON, GenerateCode, + MultiGenerateCode, Mistral7BInstruct, Mixtral8x7BInstruct, Llama3Instruct8B, diff --git a/src/openapi.json b/src/openapi.json index 2ad63cb..3ca5524 100644 --- a/src/openapi.json +++ b/src/openapi.json @@ -297,6 +297,85 @@ }, "required": [] }, + "DeepseekIn": { + "title": "DeepseekIn", + "type": "object", + "properties": { + "prompt": { + "type": "string", + "description": "Input prompt." + }, + "language": { + "type": "string", + "description": "Language of the code.", + "enum": [ + "c", + "c++", + "c#", + "css", + "go", + "html", + "java", + "javascript", + "json", + "python", + "r", + "ruby", + "shell", + "sql", + "tex", + "typescript" + ] + }, + "num_choices": { + "type": "integer", + "description": "Number of choices to generate.", + "minimum": 1, + "maximum": 8, + "default": 1, + "x-loggable": true + }, + "temperature": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1, + "description": "Higher values make the output more random, lower values make the output more deterministic.", + "x-loggable": true + }, + "max_tokens": { + "type": "integer", + "description": "Maximum number of tokens to generate.", + "x-loggable": true + } + }, + "required": ["prompt", "language"] + }, + "DeepseekOut": { + "title": "DeepseekOut", + "type": "object", + "properties": { + "choices": { + "type": "array", + "description": "Code response choices.", + "items": { + "$ref": "#/components/schemas/GenerateCodeChoice" + } + } + }, + "required": ["choices"] + }, + "GenerateCodeChoice": { + "title": "GenerateCodeChoice", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Code response." + } + }, + "required": ["code"] + }, "GenerateCodeIn": { "title": "GenerateCodeIn", "type": "object", @@ -309,18 +388,22 @@ "type": "string", "description": "Language of the code.", "enum": [ - "python", - "java", + "c", "c++", - "javascript", - "typescript", - "php", - "html", "c#", - "sql", + "css", + "go", + "html", + "java", + "javascript", + "json", + "python", + "r", "ruby", + "shell", + "sql", "tex", - "shell" + "typescript" ] }, "temperature": { @@ -350,6 +433,74 @@ }, "required": ["code"] }, + "MultiGenerateCodeIn": { + "title": "MultiGenerateCodeIn", + "type": "object", + "properties": { + "prompt": { + "type": "string", + "description": "Input prompt." + }, + "language": { + "type": "string", + "description": "Language of the code.", + "enum": [ + "c", + "c++", + "c#", + "css", + "go", + "html", + "java", + "javascript", + "json", + "python", + "r", + "ruby", + "shell", + "sql", + "tex", + "typescript" + ] + }, + "num_choices": { + "type": "integer", + "description": "Number of choices to generate.", + "minimum": 1, + "maximum": 8, + "default": 1, + "x-loggable": true + }, + "temperature": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1, + "description": "Higher values make the output more random, lower values make the output more deterministic.", + "x-loggable": true + }, + "max_tokens": { + "type": "integer", + "description": "Maximum number of tokens to generate.", + "x-loggable": true + } + }, + "required": ["prompt", "language"] + }, + "MultiGenerateCodeOut": { + "title": "MultiGenerateCodeOut", + "type": "object", + "properties": { + "choices": { + "type": "array", + "description": "Code response choices.", + "items": { + "$ref": "#/components/schemas/GenerateCodeChoice" + } + } + }, + "required": ["choices"] + }, "MultiComputeTextIn": { "title": "MultiComputeTextIn", "type": "object", @@ -3411,7 +3562,7 @@ "summary": "GenerateCode", "operationId": "GenerateCode", "tags": ["category:language"], - "description": "Generate code in the specified language.", + "description": "Generate code in the specified language based on the prompt.", "requestBody": { "content": { "application/json": { @@ -3442,6 +3593,49 @@ } } }, + "/MultiGenerateCode": { + "post": { + "summary": "MultiGenerateCode", + "operationId": "MultiGenerateCode", + "tags": ["category:language"], + "description": "Generate multiple choices of code in the specified language based on the prompt.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MultiGenerateCodeIn" + }, + "example": { + "prompt": "Write a function that prints 'Hello, World!'", + "language": "python" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MultiGenerateCodeOut" + }, + "example": { + "choices": [ + { + "code": "def hello_world():\n print('Hello, World!')\n" + }, + { + "code": "def hello_world():\n print(\"Hello, World!\")\n" + } + ] + } + } + } + } + } + } + }, "/Mistral7BInstruct": { "post": { "summary": "Mistral7BInstruct", From 122a13f765a13de1fa47f610cbd14ba75e933d89 Mon Sep 17 00:00:00 2001 From: Chris Sreesangkom Date: Thu, 15 Aug 2024 12:51:00 -0400 Subject: [PATCH 2/2] remove deepseek --- src/Nodes.ts | 49 ---------------------------------- src/OpenAPI.ts | 46 -------------------------------- src/openapi.json | 68 ------------------------------------------------ 3 files changed, 163 deletions(-) diff --git a/src/Nodes.ts b/src/Nodes.ts index d1b2bc0..669cc77 100644 --- a/src/Nodes.ts +++ b/src/Nodes.ts @@ -60,17 +60,6 @@ export class ComputeTextInImageUrisItem extends FutureString {} export class ComputeJSONInJsonSchema extends FutureAnyObject {} export class ComputeJSONOutJsonObject extends FutureAnyObject {} /** Code response choices. */ -export class DeepseekOutChoices extends FutureArray { - /** Returns `GenerateCodeChoice` at given index. */ - override at(index: number) { - return new GenerateCodeChoice(this._directive.next(index)); - } - /** Returns the result for `DeepseekOutChoices` once it's node has been run. */ - protected override async _result(): Promise { - return super._result() as Promise; - } -} -/** Code response choices. */ export class MultiGenerateCodeOutChoices extends FutureArray { /** Returns `GenerateCodeChoice` at given index. */ override at(index: number) { @@ -966,44 +955,6 @@ export class ComputeJSONOut extends FutureObject { return super._result() as Promise; } } -/** DeepseekIn */ -export class DeepseekIn extends FutureObject { - /** Input prompt. */ - get prompt() { - return new FutureString(this._directive.next("prompt")); - } - /** Language of the code. */ - get language() { - return new FutureString(this._directive.next("language")); - } - /** (Optional) Number of choices to generate. */ - get num_choices() { - return new FutureNumber(this._directive.next("num_choices")); - } - /** (Optional) Higher values make the output more random, lower values make the output more deterministic. */ - get temperature() { - return new FutureNumber(this._directive.next("temperature")); - } - /** (Optional) Maximum number of tokens to generate. */ - get max_tokens() { - return new FutureNumber(this._directive.next("max_tokens")); - } - /** returns the result for `DeepseekIn` once it's node has been run. */ - protected override async _result(): Promise { - return super._result() as Promise; - } -} -/** DeepseekOut */ -export class DeepseekOut extends FutureObject { - /** Code response choices. */ - get choices() { - return new DeepseekOutChoices(this._directive.next("choices")); - } - /** returns the result for `DeepseekOut` once it's node has been run. */ - protected override async _result(): Promise { - return super._result() as Promise; - } -} /** GenerateCodeChoice */ export class GenerateCodeChoice extends FutureObject { /** Code response. */ diff --git a/src/OpenAPI.ts b/src/OpenAPI.ts index 553ec22..c4083a1 100644 --- a/src/OpenAPI.ts +++ b/src/OpenAPI.ts @@ -1104,52 +1104,6 @@ export interface components { /** @description If the model output could not be parsed to JSON, this is the raw text output. */ text?: string; }; - /** DeepseekIn */ - DeepseekIn: { - /** @description Input prompt. */ - prompt: string; - /** - * @description Language of the code. - * @enum {string} - */ - language: - | "c" - | "c++" - | "c#" - | "css" - | "go" - | "html" - | "java" - | "javascript" - | "json" - | "python" - | "r" - | "ruby" - | "shell" - | "sql" - | "tex" - | "typescript"; - /** - * @description Number of choices to generate. - * @default 1 - */ - num_choices: number; - /** - * Format: float - * @description Higher values make the output more random, lower values make the output more deterministic. - */ - temperature?: number; - /** @description Maximum number of tokens to generate. */ - max_tokens?: number; - }; - /** DeepseekOut */ - DeepseekOut: { - /** @description Code response choices. */ - choices: { - /** @description Code response. */ - code: string; - }[]; - }; /** GenerateCodeChoice */ GenerateCodeChoice: { /** @description Code response. */ diff --git a/src/openapi.json b/src/openapi.json index 3ca5524..d0579aa 100644 --- a/src/openapi.json +++ b/src/openapi.json @@ -297,74 +297,6 @@ }, "required": [] }, - "DeepseekIn": { - "title": "DeepseekIn", - "type": "object", - "properties": { - "prompt": { - "type": "string", - "description": "Input prompt." - }, - "language": { - "type": "string", - "description": "Language of the code.", - "enum": [ - "c", - "c++", - "c#", - "css", - "go", - "html", - "java", - "javascript", - "json", - "python", - "r", - "ruby", - "shell", - "sql", - "tex", - "typescript" - ] - }, - "num_choices": { - "type": "integer", - "description": "Number of choices to generate.", - "minimum": 1, - "maximum": 8, - "default": 1, - "x-loggable": true - }, - "temperature": { - "type": "number", - "format": "float", - "minimum": 0, - "maximum": 1, - "description": "Higher values make the output more random, lower values make the output more deterministic.", - "x-loggable": true - }, - "max_tokens": { - "type": "integer", - "description": "Maximum number of tokens to generate.", - "x-loggable": true - } - }, - "required": ["prompt", "language"] - }, - "DeepseekOut": { - "title": "DeepseekOut", - "type": "object", - "properties": { - "choices": { - "type": "array", - "description": "Code response choices.", - "items": { - "$ref": "#/components/schemas/GenerateCodeChoice" - } - } - }, - "required": ["choices"] - }, "GenerateCodeChoice": { "title": "GenerateCodeChoice", "type": "object",