From 7028ada8097cddf823fed01933ee415d1e030679 Mon Sep 17 00:00:00 2001 From: benzguo Date: Thu, 13 Jun 2024 17:30:30 -0400 Subject: [PATCH 1/6] rc --- package-lock.json | 4 +- package.json | 2 +- src/GEN_VERSION | 2 +- src/Nodes.ts | 1180 ++++++++++++++++----------------------------- src/OpenAPI.ts | 891 +++++++++++++++------------------- src/Substrate.ts | 1 + src/index.ts | 17 +- src/openapi.json | 753 +++++++++++++---------------- src/version.ts | 2 +- 9 files changed, 1145 insertions(+), 1707 deletions(-) diff --git a/package-lock.json b/package-lock.json index 495b51b..eb57377 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "substrate", - "version": "120240530.0.14", + "version": "120240612.0.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "substrate", - "version": "120240530.0.14", + "version": "120240612.0.14", "license": "MIT", "dependencies": { "@types/node-fetch": "^2.6.11", diff --git a/package.json b/package.json index f92c456..db2a3ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "substrate", - "version": "120240530.0.14", + "version": "120240612.0.14", "description": "The official SDK for the Substrate API", "repository": { "type": "git", diff --git a/src/GEN_VERSION b/src/GEN_VERSION index 9674ffc..9cb385b 100644 --- a/src/GEN_VERSION +++ b/src/GEN_VERSION @@ -1 +1 @@ -20240530.20240531 \ No newline at end of file +20240612.20240613 \ No newline at end of file diff --git a/src/Nodes.ts b/src/Nodes.ts index dcf1b83..24cba84 100644 --- a/src/Nodes.ts +++ b/src/Nodes.ts @@ -1,7 +1,7 @@ /** * 𐃏 Substrate * @generated file - * 20240530.20240531 + * 20240612.20240613 */ import * as OpenAPI from "substrate/OpenAPI"; @@ -45,7 +45,7 @@ type FutureExpandAny = T extends (infer U)[][] export class ExperimentalInArgs extends FutureAnyObject {} export class ExperimentalOutOutput extends FutureAnyObject {} -export class RunPythonInInput extends FutureAnyObject {} +export class RunPythonInKwargs extends FutureAnyObject {} /** Python packages to install. You must import them in your code. */ export class RunPythonInPipInstall extends FutureArray { /** Returns `FutureString` at given index. */ @@ -58,7 +58,18 @@ export class RunPythonInPipInstall extends FutureArray { } } export class RunPythonInPipInstallItem extends FutureString {} -export class RunPythonOutOutput extends FutureAnyObject {} +/** Image prompts. */ +export class GenerateTextInImageUris extends FutureArray { + /** Returns `FutureString` at given index. */ + override at(index: number) { + return new FutureString(this._directive.next(index)); + } + /** Returns the result for `GenerateTextInImageUris` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; + } +} +export class GenerateTextInImageUrisItem extends FutureString {} export class GenerateJSONInJsonSchema extends FutureAnyObject {} export class GenerateJSONOutJsonObject extends FutureAnyObject {} /** Response choices. */ @@ -182,18 +193,6 @@ export class Llama3Instruct70BOutChoices extends FutureArray { } } /** Image prompts. */ -export class GenerateTextVisionInImageUris extends FutureArray { - /** Returns `FutureString` at given index. */ - override at(index: number) { - return new FutureString(this._directive.next(index)); - } - /** Returns the result for `GenerateTextVisionInImageUris` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} -export class GenerateTextVisionInImageUrisItem extends FutureString {} -/** Image prompts. */ export class Firellava13BInImageUris extends FutureArray { /** Returns `FutureString` at given index. */ override at(index: number) { @@ -309,14 +308,14 @@ export class StableDiffusionXLControlNetOutOutputs extends FutureArray { } } /** Generated images. */ -export class MultiGenerativeEditImageOutOutputs extends FutureArray { - /** Returns `GenerativeEditImageOut` at given index. */ +export class MultiInpaintImageOutOutputs extends FutureArray { + /** Returns `InpaintImageOut` at given index. */ override at(index: number) { - return new GenerativeEditImageOut(this._directive.next(index)); + return new InpaintImageOut(this._directive.next(index)); } - /** Returns the result for `MultiGenerativeEditImageOutOutputs` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** Returns the result for `MultiInpaintImageOutOutputs` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } /** Random noise seeds. Default is random seeds for each generation. */ @@ -376,23 +375,23 @@ export class TranscribedSegmentWords extends FutureArray { } } /** Transcribed segments, if `segment` is enabled. */ -export class TranscribeMediaOutSegments extends FutureArray { +export class TranscribeSpeechOutSegments extends FutureArray { /** Returns `TranscribedSegment` at given index. */ override at(index: number) { return new TranscribedSegment(this._directive.next(index)); } - /** Returns the result for `TranscribeMediaOutSegments` once it's node has been run. */ + /** Returns the result for `TranscribeSpeechOutSegments` once it's node has been run. */ protected override async result(): Promise { return super.result() as Promise; } } /** Chapter markers, if `suggest_chapters` is enabled. */ -export class TranscribeMediaOutChapters extends FutureArray { +export class TranscribeSpeechOutChapters extends FutureArray { /** Returns `ChapterMarker` at given index. */ override at(index: number) { return new ChapterMarker(this._directive.next(index)); } - /** Returns the result for `TranscribeMediaOutChapters` once it's node has been run. */ + /** Returns the result for `TranscribeSpeechOutChapters` once it's node has been run. */ protected override async result(): Promise { return super.result() as Promise; } @@ -551,13 +550,13 @@ export class CLIPOutEmbeddings extends FutureArray { } /** List of vector stores. */ export class ListVectorStoresOutItems extends FutureArray { - /** Returns `CreateVectorStoreOut` at given index. */ + /** Returns `FindOrCreateVectorStoreOut` at given index. */ override at(index: number) { - return new CreateVectorStoreOut(this._directive.next(index)); + return new FindOrCreateVectorStoreOut(this._directive.next(index)); } /** Returns the result for `ListVectorStoresOutItems` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + protected override async result(): Promise { + return super.result() as Promise; } } /** Embedding vector. */ @@ -773,13 +772,17 @@ export class ExperimentalOut extends FutureObject { } /** RunPythonIn */ export class RunPythonIn extends FutureObject { - /** Python code to execute. In your code, access values from the `input` parameter using the `SB_IN` variable. Update the `SB_OUT` variable with results you want returned in `output`. */ - get code() { - return new FutureString(this._directive.next("code")); + /** (Optional) Pickled function. */ + get pkl_function() { + return new FutureString(this._directive.next("pkl_function")); } - /** (Optional) Input to your code, accessible using the preloaded `SB_IN` variable. */ - get input() { - return new FutureAnyObject(this._directive.next("input")); + /** Keyword arguments to your function. */ + get kwargs() { + return new FutureAnyObject(this._directive.next("kwargs")); + } + /** (Optional) Python version. */ + get python_version() { + return new FutureString(this._directive.next("python_version")); } /** (Optional) Python packages to install. You must import them in your code. */ @@ -793,14 +796,18 @@ export class RunPythonIn extends FutureObject { } /** RunPythonOut */ export class RunPythonOut extends FutureObject { + /** (Optional) Return value of your function. */ + get output() { + return new (this._directive.next("output"))(); + } + /** (Optional) Pickled return value. */ + get pkl_output() { + return new FutureString(this._directive.next("pkl_output")); + } /** Everything printed to stdout while running your code. */ get stdout() { return new FutureString(this._directive.next("stdout")); } - /** Contents of the `SB_OUT` variable after running your code. */ - get output() { - return new FutureAnyObject(this._directive.next("output")); - } /** Contents of stderr if your code did not run successfully. */ get stderr() { return new FutureString(this._directive.next("stderr")); @@ -816,6 +823,11 @@ export class GenerateTextIn extends FutureObject { get prompt() { return new FutureString(this._directive.next("prompt")); } + + /** (Optional) Image prompts. */ + get image_uris() { + return new GenerateTextInImageUris(this._directive.next("image_uris")); + } /** (Optional) Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. */ get temperature() { return new FutureNumber(this._directive.next("temperature")); @@ -824,9 +836,9 @@ export class GenerateTextIn extends FutureObject { get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); } - /** (Optional) Selected node. */ - get node() { - return new FutureString(this._directive.next("node")); + /** (Optional) Selected model. `Firellava13B` is automatically selected when `image_uris` is provided. */ + get model() { + return new FutureString(this._directive.next("model")); } /** returns the result for `GenerateTextIn` once it's node has been run. */ protected override async result(): Promise { @@ -862,9 +874,9 @@ export class GenerateJSONIn extends FutureObject { get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); } - /** (Optional) Selected node. */ - get node() { - return new FutureString(this._directive.next("node")); + /** (Optional) Selected model. */ + get model() { + return new FutureString(this._directive.next("model")); } /** returns the result for `GenerateJSONIn` once it's node has been run. */ protected override async result(): Promise { @@ -904,9 +916,9 @@ export class MultiGenerateTextIn extends FutureObject { get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); } - /** (Optional) Selected node. */ - get node() { - return new FutureString(this._directive.next("node")); + /** (Optional) Selected model. */ + get model() { + return new FutureString(this._directive.next("model")); } /** returns the result for `MultiGenerateTextIn` once it's node has been run. */ protected override async result(): Promise { @@ -938,6 +950,10 @@ export class BatchGenerateTextIn extends FutureObject { get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); } + /** (Optional) Selected model. */ + get model() { + return new FutureString(this._directive.next("model")); + } /** returns the result for `BatchGenerateTextIn` once it's node has been run. */ protected override async result(): Promise { return super.result() as Promise; @@ -976,9 +992,9 @@ export class MultiGenerateJSONIn extends FutureObject { get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); } - /** (Optional) Selected node. */ - get node() { - return new FutureString(this._directive.next("node")); + /** (Optional) Selected model. */ + get model() { + return new FutureString(this._directive.next("model")); } /** returns the result for `MultiGenerateJSONIn` once it's node has been run. */ protected override async result(): Promise { @@ -998,11 +1014,6 @@ export class MultiGenerateJSONOut extends FutureObject { } /** BatchGenerateJSONIn */ export class BatchGenerateJSONIn extends FutureObject { - /** (Optional) Selected node. */ - get node() { - return new FutureString(this._directive.next("node")); - } - /** Batch input prompts. */ get prompts() { return new BatchGenerateJSONInPrompts(this._directive.next("prompts")); @@ -1019,6 +1030,10 @@ export class BatchGenerateJSONIn extends FutureObject { get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); } + /** (Optional) Selected model. */ + get model() { + return new FutureString(this._directive.next("model")); + } /** returns the result for `BatchGenerateJSONIn` once it's node has been run. */ protected override async result(): Promise { return super.result() as Promise; @@ -1041,6 +1056,10 @@ export class Mistral7BInstructIn extends FutureObject { get prompt() { return new FutureString(this._directive.next("prompt")); } + /** (Optional) System prompt. */ + get system_prompt() { + return new FutureString(this._directive.next("system_prompt")); + } /** (Optional) Number of choices to generate. */ get num_choices() { return new FutureNumber(this._directive.next("num_choices")); @@ -1049,10 +1068,26 @@ export class Mistral7BInstructIn extends FutureObject { get json_schema() { return new FutureAnyObject(this._directive.next("json_schema")); } - /** (Optional) Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. */ + /** (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) Higher values decrease the likelihood of repeating previous tokens. */ + get frequency_penalty() { + return new FutureNumber(this._directive.next("frequency_penalty")); + } + /** (Optional) Higher values decrease the likelihood of repeated sequences. */ + get repetition_penalty() { + return new FutureNumber(this._directive.next("repetition_penalty")); + } + /** (Optional) Higher values increase the likelihood of new topics appearing. */ + get presence_penalty() { + return new FutureNumber(this._directive.next("presence_penalty")); + } + /** (Optional) Probability below which less likely tokens are filtered out. */ + get top_p() { + return new FutureNumber(this._directive.next("top_p")); + } /** (Optional) Maximum number of tokens to generate. */ get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); @@ -1094,6 +1129,10 @@ export class Mixtral8x7BInstructIn extends FutureObject { get prompt() { return new FutureString(this._directive.next("prompt")); } + /** (Optional) System prompt. */ + get system_prompt() { + return new FutureString(this._directive.next("system_prompt")); + } /** (Optional) Number of choices to generate. */ get num_choices() { return new FutureNumber(this._directive.next("num_choices")); @@ -1102,10 +1141,26 @@ export class Mixtral8x7BInstructIn extends FutureObject { get json_schema() { return new FutureAnyObject(this._directive.next("json_schema")); } - /** (Optional) Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. */ + /** (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) Higher values decrease the likelihood of repeating previous tokens. */ + get frequency_penalty() { + return new FutureNumber(this._directive.next("frequency_penalty")); + } + /** (Optional) Higher values decrease the likelihood of repeated sequences. */ + get repetition_penalty() { + return new FutureNumber(this._directive.next("repetition_penalty")); + } + /** (Optional) Higher values increase the likelihood of new topics appearing. */ + get presence_penalty() { + return new FutureNumber(this._directive.next("presence_penalty")); + } + /** (Optional) Probability below which less likely tokens are filtered out. */ + get top_p() { + return new FutureNumber(this._directive.next("top_p")); + } /** (Optional) Maximum number of tokens to generate. */ get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); @@ -1147,14 +1202,34 @@ export class Llama3Instruct8BIn extends FutureObject { get prompt() { return new FutureString(this._directive.next("prompt")); } + /** (Optional) System prompt. */ + get system_prompt() { + return new FutureString(this._directive.next("system_prompt")); + } /** (Optional) Number of choices to generate. */ get num_choices() { return new FutureNumber(this._directive.next("num_choices")); } - /** (Optional) Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. */ + /** (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) Higher values decrease the likelihood of repeating previous tokens. */ + get frequency_penalty() { + return new FutureNumber(this._directive.next("frequency_penalty")); + } + /** (Optional) Higher values decrease the likelihood of repeated sequences. */ + get repetition_penalty() { + return new FutureNumber(this._directive.next("repetition_penalty")); + } + /** (Optional) Higher values increase the likelihood of new topics appearing. */ + get presence_penalty() { + return new FutureNumber(this._directive.next("presence_penalty")); + } + /** (Optional) Probability below which less likely tokens are filtered out. */ + get top_p() { + return new FutureNumber(this._directive.next("top_p")); + } /** (Optional) Maximum number of tokens to generate. */ get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); @@ -1200,14 +1275,34 @@ export class Llama3Instruct70BIn extends FutureObject { get prompt() { return new FutureString(this._directive.next("prompt")); } + /** (Optional) System prompt. */ + get system_prompt() { + return new FutureString(this._directive.next("system_prompt")); + } /** (Optional) Number of choices to generate. */ get num_choices() { return new FutureNumber(this._directive.next("num_choices")); } - /** (Optional) Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. */ + /** (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) Higher values decrease the likelihood of repeating previous tokens. */ + get frequency_penalty() { + return new FutureNumber(this._directive.next("frequency_penalty")); + } + /** (Optional) Higher values decrease the likelihood of repeated sequences. */ + get repetition_penalty() { + return new FutureNumber(this._directive.next("repetition_penalty")); + } + /** (Optional) Higher values increase the likelihood of new topics appearing. */ + get presence_penalty() { + return new FutureNumber(this._directive.next("presence_penalty")); + } + /** (Optional) Probability below which less likely tokens are filtered out. */ + get top_p() { + return new FutureNumber(this._directive.next("top_p")); + } /** (Optional) Maximum number of tokens to generate. */ get max_tokens() { return new FutureNumber(this._directive.next("max_tokens")); @@ -1239,39 +1334,6 @@ export class Llama3Instruct70BOut extends FutureObject { return super.result() as Promise; } } -/** GenerateTextVisionIn */ -export class GenerateTextVisionIn extends FutureObject { - /** Text prompt. */ - get prompt() { - return new FutureString(this._directive.next("prompt")); - } - - /** Image prompts. */ - get image_uris() { - return new GenerateTextVisionInImageUris( - this._directive.next("image_uris"), - ); - } - /** (Optional) Maximum number of tokens to generate. */ - get max_tokens() { - return new FutureNumber(this._directive.next("max_tokens")); - } - /** returns the result for `GenerateTextVisionIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} -/** GenerateTextVisionOut */ -export class GenerateTextVisionOut extends FutureObject { - /** Text response. */ - get text() { - return new FutureString(this._directive.next("text")); - } - /** returns the result for `GenerateTextVisionOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} /** Firellava13BIn */ export class Firellava13BIn extends FutureObject { /** Text prompt. */ @@ -1569,6 +1631,10 @@ export class StableDiffusionXLControlNetIn extends FutureObject { get conditioning_scale() { return new FutureNumber(this._directive.next("conditioning_scale")); } + /** (Optional) Controls how much to transform the input image. */ + get strength() { + return new FutureNumber(this._directive.next("strength")); + } /** (Optional) Random noise seeds. Default is random seeds for each generation. */ get seeds() { @@ -1594,8 +1660,8 @@ export class StableDiffusionXLControlNetOut extends FutureObject { return super.result() as Promise; } } -/** GenerativeEditImageIn */ -export class GenerativeEditImageIn extends FutureObject { +/** InpaintImageIn */ +export class InpaintImageIn extends FutureObject { /** Original image. */ get image_uri() { return new FutureString(this._directive.next("image_uri")); @@ -1612,24 +1678,24 @@ export class GenerativeEditImageIn extends FutureObject { get store() { return new FutureString(this._directive.next("store")); } - /** returns the result for `GenerativeEditImageIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `InpaintImageIn` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } -/** GenerativeEditImageOut */ -export class GenerativeEditImageOut extends FutureObject { +/** InpaintImageOut */ +export class InpaintImageOut extends FutureObject { /** Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ get image_uri() { return new FutureString(this._directive.next("image_uri")); } - /** returns the result for `GenerativeEditImageOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `InpaintImageOut` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } -/** MultiGenerativeEditImageIn */ -export class MultiGenerativeEditImageIn extends FutureObject { +/** MultiInpaintImageIn */ +export class MultiInpaintImageIn extends FutureObject { /** Original image. */ get image_uri() { return new FutureString(this._directive.next("image_uri")); @@ -1650,22 +1716,20 @@ export class MultiGenerativeEditImageIn extends FutureObject { get store() { return new FutureString(this._directive.next("store")); } - /** returns the result for `MultiGenerativeEditImageIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `MultiInpaintImageIn` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } -/** MultiGenerativeEditImageOut */ -export class MultiGenerativeEditImageOut extends FutureObject { +/** MultiInpaintImageOut */ +export class MultiInpaintImageOut extends FutureObject { /** Generated images. */ get outputs() { - return new MultiGenerativeEditImageOutOutputs( - this._directive.next("outputs"), - ); + return new MultiInpaintImageOutOutputs(this._directive.next("outputs")); } - /** returns the result for `MultiGenerativeEditImageOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `MultiInpaintImageOut` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } /** StableDiffusionXLInpaintIn */ @@ -1763,8 +1827,8 @@ export class Point extends FutureObject { return super.result() as Promise; } } -/** FillMaskIn */ -export class FillMaskIn extends FutureObject { +/** EraseImageIn */ +export class EraseImageIn extends FutureObject { /** Input image. */ get image_uri() { return new FutureString(this._directive.next("image_uri")); @@ -1777,20 +1841,20 @@ export class FillMaskIn extends FutureObject { get store() { return new FutureString(this._directive.next("store")); } - /** returns the result for `FillMaskIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `EraseImageIn` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } -/** FillMaskOut */ -export class FillMaskOut extends FutureObject { +/** EraseImageOut */ +export class EraseImageOut extends FutureObject { /** Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ get image_uri() { return new FutureString(this._directive.next("image_uri")); } - /** returns the result for `FillMaskOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `EraseImageOut` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } /** BigLaMaIn */ @@ -1885,10 +1949,18 @@ export class DISISNetOut extends FutureObject { } /** UpscaleImageIn */ export class UpscaleImageIn extends FutureObject { + /** (Optional) Prompt to guide model on the content of image to upscale. */ + get prompt() { + return new FutureString(this._directive.next("prompt")); + } /** Input image. */ get image_uri() { return new FutureString(this._directive.next("image_uri")); } + /** (Optional) Resolution of the output image, in pixels. */ + get output_resolution() { + return new FutureNumber(this._directive.next("output_resolution")); + } /** (Optional) Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ get store() { return new FutureString(this._directive.next("store")); @@ -1909,32 +1981,6 @@ export class UpscaleImageOut extends FutureObject { return super.result() as Promise; } } -/** RealESRGANIn */ -export class RealESRGANIn extends FutureObject { - /** Input image. */ - get image_uri() { - return new FutureString(this._directive.next("image_uri")); - } - /** (Optional) Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ - get store() { - return new FutureString(this._directive.next("store")); - } - /** returns the result for `RealESRGANIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} -/** RealESRGANOut */ -export class RealESRGANOut extends FutureObject { - /** Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ - get image_uri() { - return new FutureString(this._directive.next("image_uri")); - } - /** returns the result for `RealESRGANOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} /** SegmentUnderPointIn */ export class SegmentUnderPointIn extends FutureObject { /** Input image. */ @@ -2003,8 +2049,8 @@ export class SegmentAnythingOut extends FutureObject { return super.result() as Promise; } } -/** TranscribeMediaIn */ -export class TranscribeMediaIn extends FutureObject { +/** TranscribeSpeechIn */ +export class TranscribeSpeechIn extends FutureObject { /** Input audio. */ get audio_uri() { return new FutureString(this._directive.next("audio_uri")); @@ -2033,9 +2079,9 @@ export class TranscribeMediaIn extends FutureObject { get suggest_chapters() { return new FutureBoolean(this._directive.next("suggest_chapters")); } - /** returns the result for `TranscribeMediaIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `TranscribeSpeechIn` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } /** TranscribedWord */ @@ -2104,8 +2150,8 @@ export class ChapterMarker extends FutureObject { return super.result() as Promise; } } -/** TranscribeMediaOut */ -export class TranscribeMediaOut extends FutureObject { +/** TranscribeSpeechOut */ +export class TranscribeSpeechOut extends FutureObject { /** Transcribed text. */ get text() { return new FutureString(this._directive.next("text")); @@ -2113,16 +2159,16 @@ export class TranscribeMediaOut extends FutureObject { /** (Optional) Transcribed segments, if `segment` is enabled. */ get segments() { - return new TranscribeMediaOutSegments(this._directive.next("segments")); + return new TranscribeSpeechOutSegments(this._directive.next("segments")); } /** (Optional) Chapter markers, if `suggest_chapters` is enabled. */ get chapters() { - return new TranscribeMediaOutChapters(this._directive.next("chapters")); + return new TranscribeSpeechOutChapters(this._directive.next("chapters")); } - /** returns the result for `TranscribeMediaOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `TranscribeSpeechOut` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } /** GenerateSpeechIn */ @@ -2473,8 +2519,8 @@ export class CLIPOut extends FutureObject { return super.result() as Promise; } } -/** CreateVectorStoreIn */ -export class CreateVectorStoreIn extends FutureObject { +/** FindOrCreateVectorStoreIn */ +export class FindOrCreateVectorStoreIn extends FutureObject { /** Vector store name. */ get collection_name() { return new FutureString(this._directive.next("collection_name")); @@ -2483,25 +2529,13 @@ export class CreateVectorStoreIn extends FutureObject { get model() { return new FutureString(this._directive.next("model")); } - /** (Optional) The max number of connections per layer for the index. */ - get m() { - return new FutureNumber(this._directive.next("m")); - } - /** (Optional) The size of the dynamic candidate list for constructing the index graph. */ - get ef_construction() { - return new FutureNumber(this._directive.next("ef_construction")); - } - /** (Optional) The distance metric to construct the index with. */ - get metric() { - return new FutureString(this._directive.next("metric")); - } - /** returns the result for `CreateVectorStoreIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `FindOrCreateVectorStoreIn` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } -/** CreateVectorStoreOut */ -export class CreateVectorStoreOut extends FutureObject { +/** FindOrCreateVectorStoreOut */ +export class FindOrCreateVectorStoreOut extends FutureObject { /** Vector store name. */ get collection_name() { return new FutureString(this._directive.next("collection_name")); @@ -2510,21 +2544,9 @@ export class CreateVectorStoreOut extends FutureObject { get model() { return new FutureString(this._directive.next("model")); } - /** The max number of connections per layer for the index. */ - get m() { - return new FutureNumber(this._directive.next("m")); - } - /** The size of the dynamic candidate list for constructing the index graph. */ - get ef_construction() { - return new FutureNumber(this._directive.next("ef_construction")); - } - /** The distance metric to construct the index with. */ - get metric() { - return new FutureString(this._directive.next("metric")); - } - /** returns the result for `CreateVectorStoreOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; + /** returns the result for `FindOrCreateVectorStoreOut` once it's node has been run. */ + protected override async result(): Promise { + return super.result() as Promise; } } /** ListVectorStoresIn */ @@ -2882,72 +2904,6 @@ export class Experimental extends Node { return super.output() as OpenAPI.components["schemas"]["ExperimentalOut"]; } } -export namespace RunPython { - /** - * RunPython Input - * https://www.substrate.run/nodes#RunPython - */ - export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["RunPythonIn"] - >; - - /** - * RunPython Output - * https://www.substrate.run/nodes#RunPython - */ - export type Output = OpenAPI.components["schemas"]["RunPythonOut"]; -} - -/** - * Run code using a Python interpreter. - * - * https://www.substrate.run/nodes#RunPython - */ -export class RunPython extends Node { - /** - * Input arguments: `code`, `input` (optional), `pip_install` (optional) - * - * Output fields: `stdout`, `output`, `stderr` - * - * https://www.substrate.run/nodes#RunPython - */ - constructor( - args: FutureExpandAny, - options?: Options, - ) { - super(args, options); - } - - /** - * Retrieve this node's output from a response. - * - * Output fields: `stdout`, `output`, `stderr` - * - * https://www.substrate.run/nodes#RunPython - */ - protected override async result(): Promise< - OpenAPI.components["schemas"]["RunPythonOut"] | undefined - > { - return Promise.resolve( - this._response ? this._response.get(this) : undefined, - ) as Promise; - } - - /** - * Future reference to this node's output. - * - * Output fields: `stdout`, `output`, `stderr` - * - * https://www.substrate.run/nodes#RunPython - */ - override get future(): RunPythonOut { - return new RunPythonOut(new Trace([], this)); - } - - protected override output(): OpenAPI.components["schemas"]["RunPythonOut"] { - return super.output() as OpenAPI.components["schemas"]["RunPythonOut"]; - } -} export namespace GenerateText { /** * GenerateText Input @@ -2971,7 +2927,7 @@ export namespace GenerateText { */ export class GenerateText extends Node { /** - * Input arguments: `prompt`, `temperature` (optional), `max_tokens` (optional), `node` (optional) + * Input arguments: `prompt`, `image_uris` (optional), `temperature` (optional), `max_tokens` (optional), `model` (optional) * * Output fields: `text` * @@ -3037,7 +2993,7 @@ export namespace MultiGenerateText { */ export class MultiGenerateText extends Node { /** - * Input arguments: `prompt`, `num_choices`, `temperature` (optional), `max_tokens` (optional), `node` (optional) + * Input arguments: `prompt`, `num_choices`, `temperature` (optional), `max_tokens` (optional), `model` (optional) * * Output fields: `choices` * @@ -3105,7 +3061,7 @@ export namespace BatchGenerateText { */ export class BatchGenerateText extends Node { /** - * Input arguments: `prompts`, `temperature` (optional), `max_tokens` (optional) + * Input arguments: `prompts`, `temperature` (optional), `max_tokens` (optional), `model` (optional) * * Output fields: `outputs` * @@ -3173,7 +3129,7 @@ export namespace BatchGenerateJSON { */ export class BatchGenerateJSON extends Node { /** - * Input arguments: `node` (optional), `prompts`, `json_schema`, `temperature` (optional), `max_tokens` (optional) + * Input arguments: `prompts`, `json_schema`, `temperature` (optional), `max_tokens` (optional), `model` (optional) * * Output fields: `outputs` * @@ -3241,7 +3197,7 @@ export namespace GenerateJSON { */ export class GenerateJSON extends Node { /** - * Input arguments: `prompt`, `json_schema`, `temperature` (optional), `max_tokens` (optional), `node` (optional) + * Input arguments: `prompt`, `json_schema`, `temperature` (optional), `max_tokens` (optional), `model` (optional) * * Output fields: `json_object` (optional), `text` (optional) * @@ -3307,7 +3263,7 @@ export namespace MultiGenerateJSON { */ export class MultiGenerateJSON extends Node { /** - * Input arguments: `prompt`, `json_schema`, `num_choices`, `temperature` (optional), `max_tokens` (optional), `node` (optional) + * Input arguments: `prompt`, `json_schema`, `num_choices`, `temperature` (optional), `max_tokens` (optional), `model` (optional) * * Output fields: `choices` * @@ -3352,76 +3308,6 @@ export class MultiGenerateJSON extends Node { return super.output() as OpenAPI.components["schemas"]["MultiGenerateJSONOut"]; } } -export namespace GenerateTextVision { - /** - * GenerateTextVision Input - * https://www.substrate.run/nodes#GenerateTextVision - */ - export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["GenerateTextVisionIn"] - >; - - /** - * GenerateTextVision Output - * https://www.substrate.run/nodes#GenerateTextVision - */ - export type Output = OpenAPI.components["schemas"]["GenerateTextVisionOut"]; -} - -/** - * Generate text with image input. - * - * https://www.substrate.run/nodes#GenerateTextVision - */ -export class GenerateTextVision extends Node { - /** - * Input arguments: `prompt`, `image_uris`, `max_tokens` (optional) - * - * Output fields: `text` - * - * https://www.substrate.run/nodes#GenerateTextVision - */ - constructor( - args: FutureExpandAny< - OpenAPI.components["schemas"]["GenerateTextVisionIn"] - >, - options?: Options, - ) { - super(args, options); - } - - /** - * Retrieve this node's output from a response. - * - * Output fields: `text` - * - * https://www.substrate.run/nodes#GenerateTextVision - */ - protected override async result(): Promise< - OpenAPI.components["schemas"]["GenerateTextVisionOut"] | undefined - > { - return Promise.resolve( - this._response ? this._response.get(this) : undefined, - ) as Promise< - OpenAPI.components["schemas"]["GenerateTextVisionOut"] | undefined - >; - } - - /** - * Future reference to this node's output. - * - * Output fields: `text` - * - * https://www.substrate.run/nodes#GenerateTextVision - */ - override get future(): GenerateTextVisionOut { - return new GenerateTextVisionOut(new Trace([], this)); - } - - protected override output(): OpenAPI.components["schemas"]["GenerateTextVisionOut"] { - return super.output() as OpenAPI.components["schemas"]["GenerateTextVisionOut"]; - } -} export namespace Mistral7BInstruct { /** * Mistral7BInstruct Input @@ -3445,7 +3331,7 @@ export namespace Mistral7BInstruct { */ export class Mistral7BInstruct extends Node { /** - * Input arguments: `prompt`, `num_choices` (optional), `json_schema` (optional), `temperature` (optional), `max_tokens` (optional) + * Input arguments: `prompt`, `system_prompt` (optional), `num_choices` (optional), `json_schema` (optional), `temperature` (optional), `frequency_penalty` (optional), `repetition_penalty` (optional), `presence_penalty` (optional), `top_p` (optional), `max_tokens` (optional) * * Output fields: `choices` * @@ -3513,7 +3399,7 @@ export namespace Mixtral8x7BInstruct { */ export class Mixtral8x7BInstruct extends Node { /** - * Input arguments: `prompt`, `num_choices` (optional), `json_schema` (optional), `temperature` (optional), `max_tokens` (optional) + * Input arguments: `prompt`, `system_prompt` (optional), `num_choices` (optional), `json_schema` (optional), `temperature` (optional), `frequency_penalty` (optional), `repetition_penalty` (optional), `presence_penalty` (optional), `top_p` (optional), `max_tokens` (optional) * * Output fields: `choices` * @@ -3583,7 +3469,7 @@ export namespace Llama3Instruct8B { */ export class Llama3Instruct8B extends Node { /** - * Input arguments: `prompt`, `num_choices` (optional), `temperature` (optional), `max_tokens` (optional), `json_schema` (optional) + * Input arguments: `prompt`, `system_prompt` (optional), `num_choices` (optional), `temperature` (optional), `frequency_penalty` (optional), `repetition_penalty` (optional), `presence_penalty` (optional), `top_p` (optional), `max_tokens` (optional), `json_schema` (optional) * * Output fields: `choices` * @@ -3651,7 +3537,7 @@ export namespace Llama3Instruct70B { */ export class Llama3Instruct70B extends Node { /** - * Input arguments: `prompt`, `num_choices` (optional), `temperature` (optional), `max_tokens` (optional) + * Input arguments: `prompt`, `system_prompt` (optional), `num_choices` (optional), `temperature` (optional), `frequency_penalty` (optional), `repetition_penalty` (optional), `presence_penalty` (optional), `top_p` (optional), `max_tokens` (optional) * * Output fields: `choices` * @@ -3898,39 +3784,37 @@ export class MultiGenerateImage extends Node { return super.output() as OpenAPI.components["schemas"]["MultiGenerateImageOut"]; } } -export namespace GenerativeEditImage { +export namespace InpaintImage { /** - * GenerativeEditImage Input - * https://www.substrate.run/nodes#GenerativeEditImage + * InpaintImage Input + * https://www.substrate.run/nodes#InpaintImage */ export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["GenerativeEditImageIn"] + OpenAPI.components["schemas"]["InpaintImageIn"] >; /** - * GenerativeEditImage Output - * https://www.substrate.run/nodes#GenerativeEditImage + * InpaintImage Output + * https://www.substrate.run/nodes#InpaintImage */ - export type Output = OpenAPI.components["schemas"]["GenerativeEditImageOut"]; + export type Output = OpenAPI.components["schemas"]["InpaintImageOut"]; } /** - * Edit an image using image generation. + * Edit an image using image generation inside part of the image or the full image. * - * https://www.substrate.run/nodes#GenerativeEditImage + * https://www.substrate.run/nodes#InpaintImage */ -export class GenerativeEditImage extends Node { +export class InpaintImage extends Node { /** * Input arguments: `image_uri`, `prompt`, `mask_image_uri` (optional), `store` (optional) * * Output fields: `image_uri` * - * https://www.substrate.run/nodes#GenerativeEditImage + * https://www.substrate.run/nodes#InpaintImage */ constructor( - args: FutureExpandAny< - OpenAPI.components["schemas"]["GenerativeEditImageIn"] - >, + args: FutureExpandAny, options?: Options, ) { super(args, options); @@ -3941,16 +3825,14 @@ export class GenerativeEditImage extends Node { * * Output fields: `image_uri` * - * https://www.substrate.run/nodes#GenerativeEditImage + * https://www.substrate.run/nodes#InpaintImage */ protected override async result(): Promise< - OpenAPI.components["schemas"]["GenerativeEditImageOut"] | undefined + OpenAPI.components["schemas"]["InpaintImageOut"] | undefined > { return Promise.resolve( this._response ? this._response.get(this) : undefined, - ) as Promise< - OpenAPI.components["schemas"]["GenerativeEditImageOut"] | undefined - >; + ) as Promise; } /** @@ -3958,118 +3840,47 @@ export class GenerativeEditImage extends Node { * * Output fields: `image_uri` * - * https://www.substrate.run/nodes#GenerativeEditImage + * https://www.substrate.run/nodes#InpaintImage */ - override get future(): GenerativeEditImageOut { - return new GenerativeEditImageOut(new Trace([], this)); + override get future(): InpaintImageOut { + return new InpaintImageOut(new Trace([], this)); } - protected override output(): OpenAPI.components["schemas"]["GenerativeEditImageOut"] { - return super.output() as OpenAPI.components["schemas"]["GenerativeEditImageOut"]; + protected override output(): OpenAPI.components["schemas"]["InpaintImageOut"] { + return super.output() as OpenAPI.components["schemas"]["InpaintImageOut"]; } } -export namespace MultiGenerativeEditImage { +export namespace MultiInpaintImage { /** - * MultiGenerativeEditImage Input - * https://www.substrate.run/nodes#MultiGenerativeEditImage + * MultiInpaintImage Input + * https://www.substrate.run/nodes#MultiInpaintImage */ export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["MultiGenerativeEditImageIn"] + OpenAPI.components["schemas"]["MultiInpaintImageIn"] >; /** - * MultiGenerativeEditImage Output - * https://www.substrate.run/nodes#MultiGenerativeEditImage + * MultiInpaintImage Output + * https://www.substrate.run/nodes#MultiInpaintImage */ - export type Output = - OpenAPI.components["schemas"]["MultiGenerativeEditImageOut"]; + export type Output = OpenAPI.components["schemas"]["MultiInpaintImageOut"]; } /** * Edit multiple images using image generation. * - * https://www.substrate.run/nodes#MultiGenerativeEditImage + * https://www.substrate.run/nodes#MultiInpaintImage */ -export class MultiGenerativeEditImage extends Node { +export class MultiInpaintImage extends Node { /** * Input arguments: `image_uri`, `prompt`, `mask_image_uri` (optional), `num_images`, `store` (optional) * * Output fields: `outputs` * - * https://www.substrate.run/nodes#MultiGenerativeEditImage - */ - constructor( - args: FutureExpandAny< - OpenAPI.components["schemas"]["MultiGenerativeEditImageIn"] - >, - options?: Options, - ) { - super(args, options); - } - - /** - * Retrieve this node's output from a response. - * - * Output fields: `outputs` - * - * https://www.substrate.run/nodes#MultiGenerativeEditImage - */ - protected override async result(): Promise< - OpenAPI.components["schemas"]["MultiGenerativeEditImageOut"] | undefined - > { - return Promise.resolve( - this._response ? this._response.get(this) : undefined, - ) as Promise< - OpenAPI.components["schemas"]["MultiGenerativeEditImageOut"] | undefined - >; - } - - /** - * Future reference to this node's output. - * - * Output fields: `outputs` - * - * https://www.substrate.run/nodes#MultiGenerativeEditImage - */ - override get future(): MultiGenerativeEditImageOut { - return new MultiGenerativeEditImageOut(new Trace([], this)); - } - - protected override output(): OpenAPI.components["schemas"]["MultiGenerativeEditImageOut"] { - return super.output() as OpenAPI.components["schemas"]["MultiGenerativeEditImageOut"]; - } -} -export namespace StableDiffusionXL { - /** - * StableDiffusionXL Input - * https://www.substrate.run/nodes#StableDiffusionXL - */ - export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["StableDiffusionXLIn"] - >; - - /** - * StableDiffusionXL Output - * https://www.substrate.run/nodes#StableDiffusionXL - */ - export type Output = OpenAPI.components["schemas"]["StableDiffusionXLOut"]; -} - -/** - * Generate an image using [Stable Diffusion XL](https://arxiv.org/abs/2307.01952). - * - * https://www.substrate.run/nodes#StableDiffusionXL - */ -export class StableDiffusionXL extends Node { - /** - * Input arguments: `prompt`, `negative_prompt` (optional), `steps` (optional), `num_images`, `store` (optional), `height` (optional), `width` (optional), `seeds` (optional), `guidance_scale` (optional) - * - * Output fields: `outputs` - * - * https://www.substrate.run/nodes#StableDiffusionXL + * https://www.substrate.run/nodes#MultiInpaintImage */ constructor( - args: FutureExpandAny, + args: FutureExpandAny, options?: Options, ) { super(args, options); @@ -4080,15 +3891,15 @@ export class StableDiffusionXL extends Node { * * Output fields: `outputs` * - * https://www.substrate.run/nodes#StableDiffusionXL + * https://www.substrate.run/nodes#MultiInpaintImage */ protected override async result(): Promise< - OpenAPI.components["schemas"]["StableDiffusionXLOut"] | undefined + OpenAPI.components["schemas"]["MultiInpaintImageOut"] | undefined > { return Promise.resolve( this._response ? this._response.get(this) : undefined, ) as Promise< - OpenAPI.components["schemas"]["StableDiffusionXLOut"] | undefined + OpenAPI.components["schemas"]["MultiInpaintImageOut"] | undefined >; } @@ -4097,14 +3908,14 @@ export class StableDiffusionXL extends Node { * * Output fields: `outputs` * - * https://www.substrate.run/nodes#StableDiffusionXL + * https://www.substrate.run/nodes#MultiInpaintImage */ - override get future(): StableDiffusionXLOut { - return new StableDiffusionXLOut(new Trace([], this)); + override get future(): MultiInpaintImageOut { + return new MultiInpaintImageOut(new Trace([], this)); } - protected override output(): OpenAPI.components["schemas"]["StableDiffusionXLOut"] { - return super.output() as OpenAPI.components["schemas"]["StableDiffusionXLOut"]; + protected override output(): OpenAPI.components["schemas"]["MultiInpaintImageOut"] { + return super.output() as OpenAPI.components["schemas"]["MultiInpaintImageOut"]; } } export namespace StableDiffusionXLLightning { @@ -4273,7 +4084,7 @@ export namespace StableDiffusionXLControlNet { */ export class StableDiffusionXLControlNet extends Node { /** - * Input arguments: `image_uri`, `control_method`, `prompt`, `num_images`, `output_resolution` (optional), `negative_prompt` (optional), `store` (optional), `conditioning_scale` (optional), `seeds` (optional) + * Input arguments: `image_uri`, `control_method`, `prompt`, `num_images`, `output_resolution` (optional), `negative_prompt` (optional), `store` (optional), `conditioning_scale` (optional), `strength` (optional), `seeds` (optional) * * Output fields: `outputs` * @@ -4321,108 +4132,37 @@ export class StableDiffusionXLControlNet extends Node { return super.output() as OpenAPI.components["schemas"]["StableDiffusionXLControlNetOut"]; } } -export namespace StableDiffusionXLIPAdapter { +export namespace TranscribeSpeech { /** - * StableDiffusionXLIPAdapter Input - * https://www.substrate.run/nodes#StableDiffusionXLIPAdapter + * TranscribeSpeech Input + * https://www.substrate.run/nodes#TranscribeSpeech */ export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterIn"] + OpenAPI.components["schemas"]["TranscribeSpeechIn"] >; /** - * StableDiffusionXLIPAdapter Output - * https://www.substrate.run/nodes#StableDiffusionXLIPAdapter + * TranscribeSpeech Output + * https://www.substrate.run/nodes#TranscribeSpeech */ - export type Output = - OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterOut"]; -} - -/** - * Generate an image with an image prompt, using Stable Diffusion XL with [IP-Adapter](https://arxiv.org/abs/2308.06721). - * - * https://www.substrate.run/nodes#StableDiffusionXLIPAdapter - */ -export class StableDiffusionXLIPAdapter extends Node { - /** - * Input arguments: `prompt`, `image_prompt_uri`, `num_images`, `ip_adapter_scale` (optional), `negative_prompt` (optional), `store` (optional), `width` (optional), `height` (optional), `seeds` (optional) - * - * Output fields: `outputs` - * - * https://www.substrate.run/nodes#StableDiffusionXLIPAdapter - */ - constructor( - args: FutureExpandAny< - OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterIn"] - >, - options?: Options, - ) { - super(args, options); - } - - /** - * Retrieve this node's output from a response. - * - * Output fields: `outputs` - * - * https://www.substrate.run/nodes#StableDiffusionXLIPAdapter - */ - protected override async result(): Promise< - OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterOut"] | undefined - > { - return Promise.resolve( - this._response ? this._response.get(this) : undefined, - ) as Promise< - OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterOut"] | undefined - >; - } - - /** - * Future reference to this node's output. - * - * Output fields: `outputs` - * - * https://www.substrate.run/nodes#StableDiffusionXLIPAdapter - */ - override get future(): StableDiffusionXLIPAdapterOut { - return new StableDiffusionXLIPAdapterOut(new Trace([], this)); - } - - protected override output(): OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterOut"] { - return super.output() as OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterOut"]; - } -} -export namespace TranscribeMedia { - /** - * TranscribeMedia Input - * https://www.substrate.run/nodes#TranscribeMedia - */ - export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["TranscribeMediaIn"] - >; - - /** - * TranscribeMedia Output - * https://www.substrate.run/nodes#TranscribeMedia - */ - export type Output = OpenAPI.components["schemas"]["TranscribeMediaOut"]; + export type Output = OpenAPI.components["schemas"]["TranscribeSpeechOut"]; } /** * Transcribe speech in an audio or video file. * - * https://www.substrate.run/nodes#TranscribeMedia + * https://www.substrate.run/nodes#TranscribeSpeech */ -export class TranscribeMedia extends Node { +export class TranscribeSpeech extends Node { /** * Input arguments: `audio_uri`, `prompt` (optional), `language` (optional), `segment` (optional), `align` (optional), `diarize` (optional), `suggest_chapters` (optional) * * Output fields: `text`, `segments` (optional), `chapters` (optional) * - * https://www.substrate.run/nodes#TranscribeMedia + * https://www.substrate.run/nodes#TranscribeSpeech */ constructor( - args: FutureExpandAny, + args: FutureExpandAny, options?: Options, ) { super(args, options); @@ -4433,15 +4173,15 @@ export class TranscribeMedia extends Node { * * Output fields: `text`, `segments` (optional), `chapters` (optional) * - * https://www.substrate.run/nodes#TranscribeMedia + * https://www.substrate.run/nodes#TranscribeSpeech */ protected override async result(): Promise< - OpenAPI.components["schemas"]["TranscribeMediaOut"] | undefined + OpenAPI.components["schemas"]["TranscribeSpeechOut"] | undefined > { return Promise.resolve( this._response ? this._response.get(this) : undefined, ) as Promise< - OpenAPI.components["schemas"]["TranscribeMediaOut"] | undefined + OpenAPI.components["schemas"]["TranscribeSpeechOut"] | undefined >; } @@ -4450,14 +4190,14 @@ export class TranscribeMedia extends Node { * * Output fields: `text`, `segments` (optional), `chapters` (optional) * - * https://www.substrate.run/nodes#TranscribeMedia + * https://www.substrate.run/nodes#TranscribeSpeech */ - override get future(): TranscribeMediaOut { - return new TranscribeMediaOut(new Trace([], this)); + override get future(): TranscribeSpeechOut { + return new TranscribeSpeechOut(new Trace([], this)); } - protected override output(): OpenAPI.components["schemas"]["TranscribeMediaOut"] { - return super.output() as OpenAPI.components["schemas"]["TranscribeMediaOut"]; + protected override output(): OpenAPI.components["schemas"]["TranscribeSpeechOut"] { + return super.output() as OpenAPI.components["schemas"]["TranscribeSpeechOut"]; } } export namespace GenerateSpeech { @@ -4528,72 +4268,6 @@ export class GenerateSpeech extends Node { return super.output() as OpenAPI.components["schemas"]["GenerateSpeechOut"]; } } -export namespace XTTSV2 { - /** - * XTTSV2 Input - * https://www.substrate.run/nodes#XTTSV2 - */ - export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["XTTSV2In"] - >; - - /** - * XTTSV2 Output - * https://www.substrate.run/nodes#XTTSV2 - */ - export type Output = OpenAPI.components["schemas"]["XTTSV2Out"]; -} - -/** - * Generate speech from text using [XTTS v2](https://docs.coqui.ai/en/latest/models/xtts.html). - * - * https://www.substrate.run/nodes#XTTSV2 - */ -export class XTTSV2 extends Node { - /** - * Input arguments: `text`, `audio_uri` (optional), `language` (optional), `store` (optional) - * - * Output fields: `audio_uri` - * - * https://www.substrate.run/nodes#XTTSV2 - */ - constructor( - args: FutureExpandAny, - options?: Options, - ) { - super(args, options); - } - - /** - * Retrieve this node's output from a response. - * - * Output fields: `audio_uri` - * - * https://www.substrate.run/nodes#XTTSV2 - */ - protected override async result(): Promise< - OpenAPI.components["schemas"]["XTTSV2Out"] | undefined - > { - return Promise.resolve( - this._response ? this._response.get(this) : undefined, - ) as Promise; - } - - /** - * Future reference to this node's output. - * - * Output fields: `audio_uri` - * - * https://www.substrate.run/nodes#XTTSV2 - */ - override get future(): XTTSV2Out { - return new XTTSV2Out(new Trace([], this)); - } - - protected override output(): OpenAPI.components["schemas"]["XTTSV2Out"] { - return super.output() as OpenAPI.components["schemas"]["XTTSV2Out"]; - } -} export namespace RemoveBackground { /** * RemoveBackground Input @@ -4611,7 +4285,7 @@ export namespace RemoveBackground { } /** - * Remove the background from an image, with the option to return the foreground as a mask. + * Remove the background from an image and return the foreground segment as a cut-out or a mask. * * https://www.substrate.run/nodes#RemoveBackground */ @@ -4662,37 +4336,37 @@ export class RemoveBackground extends Node { return super.output() as OpenAPI.components["schemas"]["RemoveBackgroundOut"]; } } -export namespace FillMask { +export namespace EraseImage { /** - * FillMask Input - * https://www.substrate.run/nodes#FillMask + * EraseImage Input + * https://www.substrate.run/nodes#EraseImage */ export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["FillMaskIn"] + OpenAPI.components["schemas"]["EraseImageIn"] >; /** - * FillMask Output - * https://www.substrate.run/nodes#FillMask + * EraseImage Output + * https://www.substrate.run/nodes#EraseImage */ - export type Output = OpenAPI.components["schemas"]["FillMaskOut"]; + export type Output = OpenAPI.components["schemas"]["EraseImageOut"]; } /** - * Fill (inpaint) part of an image, e.g. to 'remove' an object. + * Erase the masked part of an image, e.g. to 'remove' an object. * - * https://www.substrate.run/nodes#FillMask + * https://www.substrate.run/nodes#EraseImage */ -export class FillMask extends Node { +export class EraseImage extends Node { /** * Input arguments: `image_uri`, `mask_image_uri`, `store` (optional) * * Output fields: `image_uri` * - * https://www.substrate.run/nodes#FillMask + * https://www.substrate.run/nodes#EraseImage */ constructor( - args: FutureExpandAny, + args: FutureExpandAny, options?: Options, ) { super(args, options); @@ -4703,14 +4377,14 @@ export class FillMask extends Node { * * Output fields: `image_uri` * - * https://www.substrate.run/nodes#FillMask + * https://www.substrate.run/nodes#EraseImage */ protected override async result(): Promise< - OpenAPI.components["schemas"]["FillMaskOut"] | undefined + OpenAPI.components["schemas"]["EraseImageOut"] | undefined > { return Promise.resolve( this._response ? this._response.get(this) : undefined, - ) as Promise; + ) as Promise; } /** @@ -4718,14 +4392,14 @@ export class FillMask extends Node { * * Output fields: `image_uri` * - * https://www.substrate.run/nodes#FillMask + * https://www.substrate.run/nodes#EraseImage */ - override get future(): FillMaskOut { - return new FillMaskOut(new Trace([], this)); + override get future(): EraseImageOut { + return new EraseImageOut(new Trace([], this)); } - protected override output(): OpenAPI.components["schemas"]["FillMaskOut"] { - return super.output() as OpenAPI.components["schemas"]["FillMaskOut"]; + protected override output(): OpenAPI.components["schemas"]["EraseImageOut"] { + return super.output() as OpenAPI.components["schemas"]["EraseImageOut"]; } } export namespace UpscaleImage { @@ -4745,13 +4419,13 @@ export namespace UpscaleImage { } /** - * Upscale an image. + * Upscale an image using image generation. * * https://www.substrate.run/nodes#UpscaleImage */ export class UpscaleImage extends Node { /** - * Input arguments: `image_uri`, `store` (optional) + * Input arguments: `prompt` (optional), `image_uri`, `output_resolution` (optional), `store` (optional) * * Output fields: `image_uri` * @@ -5328,37 +5002,40 @@ export class CLIP extends Node { return super.output() as OpenAPI.components["schemas"]["CLIPOut"]; } } -export namespace CreateVectorStore { +export namespace FindOrCreateVectorStore { /** - * CreateVectorStore Input - * https://www.substrate.run/nodes#CreateVectorStore + * FindOrCreateVectorStore Input + * https://www.substrate.run/nodes#FindOrCreateVectorStore */ export type Input = FutureExpandAny< - OpenAPI.components["schemas"]["CreateVectorStoreIn"] + OpenAPI.components["schemas"]["FindOrCreateVectorStoreIn"] >; /** - * CreateVectorStore Output - * https://www.substrate.run/nodes#CreateVectorStore + * FindOrCreateVectorStore Output + * https://www.substrate.run/nodes#FindOrCreateVectorStore */ - export type Output = OpenAPI.components["schemas"]["CreateVectorStoreOut"]; + export type Output = + OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"]; } /** - * Create a vector store for storing and querying embeddings. + * Find a vector store matching the given collection name, or create a new vector store. * - * https://www.substrate.run/nodes#CreateVectorStore + * https://www.substrate.run/nodes#FindOrCreateVectorStore */ -export class CreateVectorStore extends Node { +export class FindOrCreateVectorStore extends Node { /** - * Input arguments: `collection_name`, `model`, `m` (optional), `ef_construction` (optional), `metric` (optional) + * Input arguments: `collection_name`, `model` * - * Output fields: `collection_name`, `model`, `m`, `ef_construction`, `metric` + * Output fields: `collection_name`, `model` * - * https://www.substrate.run/nodes#CreateVectorStore + * https://www.substrate.run/nodes#FindOrCreateVectorStore */ constructor( - args: FutureExpandAny, + args: FutureExpandAny< + OpenAPI.components["schemas"]["FindOrCreateVectorStoreIn"] + >, options?: Options, ) { super(args, options); @@ -5367,33 +5044,33 @@ export class CreateVectorStore extends Node { /** * Retrieve this node's output from a response. * - * Output fields: `collection_name`, `model`, `m`, `ef_construction`, `metric` + * Output fields: `collection_name`, `model` * - * https://www.substrate.run/nodes#CreateVectorStore + * https://www.substrate.run/nodes#FindOrCreateVectorStore */ protected override async result(): Promise< - OpenAPI.components["schemas"]["CreateVectorStoreOut"] | undefined + OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"] | undefined > { return Promise.resolve( this._response ? this._response.get(this) : undefined, ) as Promise< - OpenAPI.components["schemas"]["CreateVectorStoreOut"] | undefined + OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"] | undefined >; } /** * Future reference to this node's output. * - * Output fields: `collection_name`, `model`, `m`, `ef_construction`, `metric` + * Output fields: `collection_name`, `model` * - * https://www.substrate.run/nodes#CreateVectorStore + * https://www.substrate.run/nodes#FindOrCreateVectorStore */ - override get future(): CreateVectorStoreOut { - return new CreateVectorStoreOut(new Trace([], this)); + override get future(): FindOrCreateVectorStoreOut { + return new FindOrCreateVectorStoreOut(new Trace([], this)); } - protected override output(): OpenAPI.components["schemas"]["CreateVectorStoreOut"] { - return super.output() as OpenAPI.components["schemas"]["CreateVectorStoreOut"]; + protected override output(): OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"] { + return super.output() as OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"]; } } export namespace ListVectorStores { @@ -5800,14 +5477,12 @@ export class DeleteVectors extends Node { } export type AnyNode = | Experimental - | RunPython | GenerateText | MultiGenerateText | BatchGenerateText | BatchGenerateJSON | GenerateJSON | MultiGenerateJSON - | GenerateTextVision | Mistral7BInstruct | Mixtral8x7BInstruct | Llama3Instruct8B @@ -5815,18 +5490,15 @@ export type AnyNode = | Firellava13B | GenerateImage | MultiGenerateImage - | GenerativeEditImage - | MultiGenerativeEditImage - | StableDiffusionXL + | InpaintImage + | MultiInpaintImage | StableDiffusionXLLightning | StableDiffusionXLInpaint | StableDiffusionXLControlNet - | StableDiffusionXLIPAdapter - | TranscribeMedia + | TranscribeSpeech | GenerateSpeech - | XTTSV2 | RemoveBackground - | FillMask + | EraseImage | UpscaleImage | SegmentUnderPoint | SegmentAnything @@ -5836,7 +5508,7 @@ export type AnyNode = | MultiEmbedImage | JinaV2 | CLIP - | CreateVectorStore + | FindOrCreateVectorStore | ListVectorStores | DeleteVectorStore | QueryVectorStore @@ -5846,90 +5518,80 @@ export type AnyNode = export type NodeOutput = T extends Experimental ? OpenAPI.components["schemas"]["ExperimentalOut"] - : T extends RunPython - ? OpenAPI.components["schemas"]["RunPythonOut"] - : T extends GenerateText - ? OpenAPI.components["schemas"]["GenerateTextOut"] - : T extends MultiGenerateText - ? OpenAPI.components["schemas"]["MultiGenerateTextOut"] - : T extends BatchGenerateText - ? OpenAPI.components["schemas"]["BatchGenerateTextOut"] - : T extends BatchGenerateJSON - ? OpenAPI.components["schemas"]["BatchGenerateJSONOut"] - : T extends GenerateJSON - ? OpenAPI.components["schemas"]["GenerateJSONOut"] - : T extends MultiGenerateJSON - ? OpenAPI.components["schemas"]["MultiGenerateJSONOut"] - : T extends GenerateTextVision - ? OpenAPI.components["schemas"]["GenerateTextVisionOut"] - : 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 GenerativeEditImage - ? OpenAPI.components["schemas"]["GenerativeEditImageOut"] - : T extends MultiGenerativeEditImage - ? OpenAPI.components["schemas"]["MultiGenerativeEditImageOut"] - : T extends StableDiffusionXL - ? OpenAPI.components["schemas"]["StableDiffusionXLOut"] - : T extends StableDiffusionXLLightning - ? OpenAPI.components["schemas"]["StableDiffusionXLLightningOut"] - : T extends StableDiffusionXLInpaint - ? OpenAPI.components["schemas"]["StableDiffusionXLInpaintOut"] - : T extends StableDiffusionXLControlNet - ? OpenAPI.components["schemas"]["StableDiffusionXLControlNetOut"] - : T extends StableDiffusionXLIPAdapter - ? OpenAPI.components["schemas"]["StableDiffusionXLIPAdapterOut"] - : T extends TranscribeMedia - ? OpenAPI.components["schemas"]["TranscribeMediaOut"] - : T extends GenerateSpeech - ? OpenAPI.components["schemas"]["GenerateSpeechOut"] - : T extends XTTSV2 - ? OpenAPI.components["schemas"]["XTTSV2Out"] - : T extends RemoveBackground - ? OpenAPI.components["schemas"]["RemoveBackgroundOut"] - : T extends FillMask - ? OpenAPI.components["schemas"]["FillMaskOut"] - : T extends UpscaleImage - ? OpenAPI.components["schemas"]["UpscaleImageOut"] - : T extends SegmentUnderPoint - ? OpenAPI.components["schemas"]["SegmentUnderPointOut"] - : T extends SegmentAnything - ? OpenAPI.components["schemas"]["SegmentAnythingOut"] - : 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 CreateVectorStore - ? OpenAPI.components["schemas"]["CreateVectorStoreOut"] - : 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 GenerateText + ? OpenAPI.components["schemas"]["GenerateTextOut"] + : T extends MultiGenerateText + ? OpenAPI.components["schemas"]["MultiGenerateTextOut"] + : T extends BatchGenerateText + ? OpenAPI.components["schemas"]["BatchGenerateTextOut"] + : T extends BatchGenerateJSON + ? OpenAPI.components["schemas"]["BatchGenerateJSONOut"] + : T extends GenerateJSON + ? OpenAPI.components["schemas"]["GenerateJSONOut"] + : T extends MultiGenerateJSON + ? OpenAPI.components["schemas"]["MultiGenerateJSONOut"] + : 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 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 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 75dbd88..6695152 100644 --- a/src/OpenAPI.ts +++ b/src/OpenAPI.ts @@ -60,13 +60,6 @@ export interface paths { */ post: operations["MultiGenerateJSON"]; }; - "/GenerateTextVision": { - /** - * GenerateTextVision - * @description Generate text with image input. - */ - post: operations["GenerateTextVision"]; - }; "/Mistral7BInstruct": { /** * Mistral7BInstruct @@ -116,26 +109,19 @@ export interface paths { */ post: operations["MultiGenerateImage"]; }; - "/GenerativeEditImage": { + "/InpaintImage": { /** - * GenerativeEditImage - * @description Edit an image using image generation. + * InpaintImage + * @description Edit an image using image generation inside part of the image or the full image. */ - post: operations["GenerativeEditImage"]; + post: operations["InpaintImage"]; }; - "/MultiGenerativeEditImage": { + "/MultiInpaintImage": { /** - * MultiGenerativeEditImage + * MultiInpaintImage * @description Edit multiple images using image generation. */ - post: operations["MultiGenerativeEditImage"]; - }; - "/StableDiffusionXL": { - /** - * StableDiffusionXL - * @description Generate an image using [Stable Diffusion XL](https://arxiv.org/abs/2307.01952). - */ - post: operations["StableDiffusionXL"]; + post: operations["MultiInpaintImage"]; }; "/StableDiffusionXLLightning": { /** @@ -158,19 +144,12 @@ export interface paths { */ post: operations["StableDiffusionXLControlNet"]; }; - "/StableDiffusionXLIPAdapter": { - /** - * StableDiffusionXLIPAdapter - * @description Generate an image with an image prompt, using Stable Diffusion XL with [IP-Adapter](https://arxiv.org/abs/2308.06721). - */ - post: operations["StableDiffusionXLIPAdapter"]; - }; - "/TranscribeMedia": { + "/TranscribeSpeech": { /** - * TranscribeMedia + * TranscribeSpeech * @description Transcribe speech in an audio or video file. */ - post: operations["TranscribeMedia"]; + post: operations["TranscribeSpeech"]; }; "/GenerateSpeech": { /** @@ -179,31 +158,24 @@ export interface paths { */ post: operations["GenerateSpeech"]; }; - "/XTTSV2": { - /** - * XTTSV2 - * @description Generate speech from text using [XTTS v2](https://docs.coqui.ai/en/latest/models/xtts.html). - */ - post: operations["XTTSV2"]; - }; "/RemoveBackground": { /** * RemoveBackground - * @description Remove the background from an image, with the option to return the foreground as a mask. + * @description Remove the background from an image and return the foreground segment as a cut-out or a mask. */ post: operations["RemoveBackground"]; }; - "/FillMask": { + "/EraseImage": { /** - * FillMask - * @description Fill (inpaint) part of an image, e.g. to 'remove' an object. + * EraseImage + * @description Erase the masked part of an image, e.g. to 'remove' an object. */ - post: operations["FillMask"]; + post: operations["EraseImage"]; }; "/UpscaleImage": { /** * UpscaleImage - * @description Upscale an image. + * @description Upscale an image using image generation. */ post: operations["UpscaleImage"]; }; @@ -263,12 +235,12 @@ export interface paths { */ post: operations["CLIP"]; }; - "/CreateVectorStore": { + "/FindOrCreateVectorStore": { /** - * CreateVectorStore - * @description Create a vector store for storing and querying embeddings. + * FindOrCreateVectorStore + * @description Find a vector store matching the given collection name, or create a new vector store. */ - post: operations["CreateVectorStore"]; + post: operations["FindOrCreateVectorStore"]; }; "/ListVectorStores": { /** @@ -351,23 +323,25 @@ export interface components { }; /** RunPythonIn */ RunPythonIn: { - /** @description Python code to execute. In your code, access values from the `input` parameter using the `SB_IN` variable. Update the `SB_OUT` variable with results you want returned in `output`. */ - code: string; - /** @description Input to your code, accessible using the preloaded `SB_IN` variable. */ - input?: { + /** @description Pickled function. */ + pkl_function?: string; + /** @description Keyword arguments to your function. */ + kwargs: { [key: string]: unknown; }; + /** @description Python version. */ + python_version?: string; /** @description Python packages to install. You must import them in your code. */ pip_install?: string[]; }; /** RunPythonOut */ RunPythonOut: { + /** @description Return value of your function. */ + output?: unknown; + /** @description Pickled return value. */ + pkl_output?: string; /** @description Everything printed to stdout while running your code. */ stdout: string; - /** @description Contents of the `SB_OUT` variable after running your code. */ - output: { - [key: string]: unknown; - }; /** @description Contents of stderr if your code did not run successfully. */ stderr: string; }; @@ -375,6 +349,8 @@ export interface components { GenerateTextIn: { /** @description Input prompt. */ prompt: string; + /** @description Image prompts. */ + image_uris?: string[]; /** * Format: float * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. @@ -384,15 +360,16 @@ export interface components { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. `Firellava13B` is automatically selected when `image_uris` is provided. + * @default Llama3Instruct8B * @enum {string} */ - node?: + model?: | "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B" - | "Llama3Instruct70B"; + | "Llama3Instruct70B" + | "Firellava13B"; }; /** GenerateTextOut */ GenerateTextOut: { @@ -416,11 +393,11 @@ export interface components { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. + * @default Llama3Instruct8B * @enum {string} */ - node?: "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B"; + model?: "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B"; }; /** GenerateJSONOut */ GenerateJSONOut: { @@ -449,11 +426,11 @@ export interface components { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. + * @default Llama3Instruct8B * @enum {string} */ - node?: + model?: | "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B" @@ -479,6 +456,12 @@ export interface components { temperature?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; + /** + * @description Selected model. + * @default Llama3Instruct8B + * @enum {string} + */ + model?: "Mistral7BInstruct" | "Llama3Instruct8B"; }; /** BatchGenerateTextOut */ BatchGenerateTextOut: { @@ -510,11 +493,11 @@ export interface components { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. + * @default Llama3Instruct8B * @enum {string} */ - node?: "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B"; + model?: "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B"; }; /** MultiGenerateJSONOut */ MultiGenerateJSONOut: { @@ -530,12 +513,6 @@ export interface components { }; /** BatchGenerateJSONIn */ BatchGenerateJSONIn: { - /** - * @description Selected node. - * @default Mistral7BInstruct - * @enum {string} - */ - node?: "Mistral7BInstruct" | "Llama3Instruct8B"; /** @description Batch input prompts. */ prompts: string[]; /** @description JSON schema to guide `json_object` response. */ @@ -550,6 +527,12 @@ export interface components { temperature?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; + /** + * @description Selected model. + * @default Llama3Instruct8B + * @enum {string} + */ + model?: "Mistral7BInstruct" | "Llama3Instruct8B"; }; /** BatchGenerateJSONOut */ BatchGenerateJSONOut: { @@ -567,6 +550,8 @@ export interface components { Mistral7BInstructIn: { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -578,9 +563,33 @@ export interface components { }; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; @@ -609,6 +618,8 @@ export interface components { Mixtral8x7BInstructIn: { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -620,9 +631,33 @@ export interface components { }; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; @@ -651,6 +686,8 @@ export interface components { Llama3Instruct8BIn: { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -658,9 +695,33 @@ export interface components { num_choices?: number; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** @description JSON schema to guide response. */ @@ -693,6 +754,8 @@ export interface components { Llama3Instruct70BIn: { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -700,9 +763,33 @@ export interface components { num_choices?: number; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; @@ -719,33 +806,13 @@ export interface components { text?: string; }[]; }; - /** GenerateTextVisionIn */ - GenerateTextVisionIn: { - /** @description Text prompt. */ - prompt: string; - /** @description Image prompts. */ - image_uris: string[]; - /** - * @description Maximum number of tokens to generate. - * @default 800 - */ - max_tokens?: number; - }; - /** GenerateTextVisionOut */ - GenerateTextVisionOut: { - /** @description Text response. */ - text: string; - }; /** Firellava13BIn */ Firellava13BIn: { /** @description Text prompt. */ prompt: string; /** @description Image prompts. */ image_uris: string[]; - /** - * @description Maximum number of tokens to generate. - * @default 800 - */ + /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; /** Firellava13BOut */ @@ -927,7 +994,7 @@ export interface components { * @description Strategy to control generation using the input image. * @enum {string} */ - control_method: "edge" | "depth" | "illusion"; + control_method: "edge" | "depth" | "illusion" | "tile"; /** @description Text prompt. */ prompt: string; /** @@ -950,6 +1017,12 @@ export interface components { * @default 0.5 */ conditioning_scale?: number; + /** + * Format: float + * @description Controls how much to transform the input image. + * @default 0.5 + */ + strength?: number; /** @description Random noise seeds. Default is random seeds for each generation. */ seeds?: number[]; }; @@ -963,8 +1036,8 @@ export interface components { seed: number; }[]; }; - /** GenerativeEditImageIn */ - GenerativeEditImageIn: { + /** InpaintImageIn */ + InpaintImageIn: { /** @description Original image. */ image_uri: string; /** @description Text prompt. */ @@ -974,13 +1047,13 @@ export interface components { /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ store?: string; }; - /** GenerativeEditImageOut */ - GenerativeEditImageOut: { + /** InpaintImageOut */ + InpaintImageOut: { /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ image_uri: string; }; - /** MultiGenerativeEditImageIn */ - MultiGenerativeEditImageIn: { + /** MultiInpaintImageIn */ + MultiInpaintImageIn: { /** @description Original image. */ image_uri: string; /** @description Text prompt. */ @@ -995,8 +1068,8 @@ export interface components { /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ store?: string; }; - /** MultiGenerativeEditImageOut */ - MultiGenerativeEditImageOut: { + /** MultiInpaintImageOut */ + MultiInpaintImageOut: { /** @description Generated images. */ outputs: { /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ @@ -1074,8 +1147,8 @@ export interface components { /** @description Y position. */ y: number; }; - /** FillMaskIn */ - FillMaskIn: { + /** EraseImageIn */ + EraseImageIn: { /** @description Input image. */ image_uri: string; /** @description Mask image that controls which pixels are inpainted. */ @@ -1083,8 +1156,8 @@ export interface components { /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ store?: string; }; - /** FillMaskOut */ - FillMaskOut: { + /** EraseImageOut */ + EraseImageOut: { /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ image_uri: string; }; @@ -1135,8 +1208,15 @@ export interface components { }; /** UpscaleImageIn */ UpscaleImageIn: { + /** @description Prompt to guide model on the content of image to upscale. */ + prompt?: string; /** @description Input image. */ image_uri: string; + /** + * @description Resolution of the output image, in pixels. + * @default 1024 + */ + output_resolution?: number; /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ store?: string; }; @@ -1145,18 +1225,6 @@ export interface components { /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ image_uri: string; }; - /** RealESRGANIn */ - RealESRGANIn: { - /** @description Input image. */ - image_uri: string; - /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ - store?: string; - }; - /** RealESRGANOut */ - RealESRGANOut: { - /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ - image_uri: string; - }; /** SegmentUnderPointIn */ SegmentUnderPointIn: { /** @description Input image. */ @@ -1218,8 +1286,8 @@ export interface components { /** @description Detected segments in 'mask image' format. Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ mask_image_uri: string; }; - /** TranscribeMediaIn */ - TranscribeMediaIn: { + /** TranscribeSpeechIn */ + TranscribeSpeechIn: { /** @description Input audio. */ audio_uri: string; /** @description Prompt to guide model on the content and context of input audio. */ @@ -1311,8 +1379,8 @@ export interface components { */ start: number; }; - /** TranscribeMediaOut */ - TranscribeMediaOut: { + /** TranscribeSpeechOut */ + TranscribeSpeechOut: { /** @description Transcribed text. */ text: string; /** @description Transcribed segments, if `segment` is enabled. */ @@ -1633,8 +1701,8 @@ export interface components { }; }[]; }; - /** CreateVectorStoreIn */ - CreateVectorStoreIn: { + /** FindOrCreateVectorStoreIn */ + FindOrCreateVectorStoreIn: { /** @description Vector store name. */ collection_name: string; /** @@ -1642,25 +1710,9 @@ export interface components { * @enum {string} */ model: "jina-v2" | "clip"; - /** - * @description The max number of connections per layer for the index. - * @default 16 - */ - m?: number; - /** - * @description The size of the dynamic candidate list for constructing the index graph. - * @default 64 - */ - ef_construction?: number; - /** - * @description The distance metric to construct the index with. - * @default inner - * @enum {string} - */ - metric?: "cosine" | "l2" | "inner"; }; - /** CreateVectorStoreOut */ - CreateVectorStoreOut: { + /** FindOrCreateVectorStoreOut */ + FindOrCreateVectorStoreOut: { /** @description Vector store name. */ collection_name: string; /** @@ -1668,22 +1720,6 @@ export interface components { * @enum {string} */ model: "jina-v2" | "clip"; - /** - * @description The max number of connections per layer for the index. - * @default 16 - */ - m: number; - /** - * @description The size of the dynamic candidate list for constructing the index graph. - * @default 64 - */ - ef_construction: number; - /** - * @description The distance metric to construct the index with. - * @default inner - * @enum {string} - */ - metric: "cosine" | "l2" | "inner"; }; /** ListVectorStoresIn */ ListVectorStoresIn: Record; @@ -1698,22 +1734,6 @@ export interface components { * @enum {string} */ model: "jina-v2" | "clip"; - /** - * @description The max number of connections per layer for the index. - * @default 16 - */ - m: number; - /** - * @description The size of the dynamic candidate list for constructing the index graph. - * @default 64 - */ - ef_construction: number; - /** - * @description The distance metric to construct the index with. - * @default inner - * @enum {string} - */ - metric: "cosine" | "l2" | "inner"; }[]; }; /** DeleteVectorStoreIn */ @@ -1985,22 +2005,22 @@ export interface operations { content: { /** * @example { - * "code": "import numpy as np; print(SB_IN['foo']); SB_OUT['result']=np.sum([1,2]).item()", - * "input": { - * "foo": "bar" - * }, + * "pkl_function": "g2UjA5fX2t3ZGVmYXVsdHNfX5ROjAxfX2RlZmF1bHRzX1+UTowKX19tb2R1bGVfX5SMCF9fbWFpbl9flIwHX19kb2NfX5ROjAtfX2Nsb3N1cmVfX5ROjBdfY2xvdWRwaWNrbGVfc3VibW9kdWxlc5RdlIwLX19nbG9iYWxzX1+UfZR1hpSGUjAu", + * "kwargs": {}, * "pip_install": [ * "numpy" * ] * } */ "application/json": { - /** @description Python code to execute. In your code, access values from the `input` parameter using the `SB_IN` variable. Update the `SB_OUT` variable with results you want returned in `output`. */ - code: string; - /** @description Input to your code, accessible using the preloaded `SB_IN` variable. */ - input?: { + /** @description Pickled function. */ + pkl_function?: string; + /** @description Keyword arguments to your function. */ + kwargs: { [key: string]: unknown; }; + /** @description Python version. */ + python_version?: string; /** @description Python packages to install. You must import them in your code. */ pip_install?: string[]; }; @@ -2011,12 +2031,12 @@ export interface operations { 200: { content: { "application/json": { + /** @description Return value of your function. */ + output?: unknown; + /** @description Pickled return value. */ + pkl_output?: string; /** @description Everything printed to stdout while running your code. */ stdout: string; - /** @description Contents of the `SB_OUT` variable after running your code. */ - output: { - [key: string]: unknown; - }; /** @description Contents of stderr if your code did not run successfully. */ stderr: string; }; @@ -2041,6 +2061,8 @@ export interface operations { "application/json": { /** @description Input prompt. */ prompt: string; + /** @description Image prompts. */ + image_uris?: string[]; /** * Format: float * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. @@ -2050,15 +2072,16 @@ export interface operations { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. `Firellava13B` is automatically selected when `image_uris` is provided. + * @default Llama3Instruct8B * @enum {string} */ - node?: + model?: | "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B" - | "Llama3Instruct70B"; + | "Llama3Instruct70B" + | "Firellava13B"; }; }; }; @@ -2105,11 +2128,11 @@ export interface operations { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. + * @default Llama3Instruct8B * @enum {string} */ - node?: + model?: | "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B" @@ -2159,6 +2182,12 @@ export interface operations { temperature?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; + /** + * @description Selected model. + * @default Llama3Instruct8B + * @enum {string} + */ + model?: "Mistral7BInstruct" | "Llama3Instruct8B"; }; }; }; @@ -2207,12 +2236,6 @@ export interface operations { * } */ "application/json": { - /** - * @description Selected node. - * @default Mistral7BInstruct - * @enum {string} - */ - node?: "Mistral7BInstruct" | "Llama3Instruct8B"; /** @description Batch input prompts. */ prompts: string[]; /** @description JSON schema to guide `json_object` response. */ @@ -2227,6 +2250,12 @@ export interface operations { temperature?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; + /** + * @description Selected model. + * @default Llama3Instruct8B + * @enum {string} + */ + model?: "Mistral7BInstruct" | "Llama3Instruct8B"; }; }; }; @@ -2292,11 +2321,11 @@ export interface operations { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. + * @default Llama3Instruct8B * @enum {string} */ - node?: + model?: | "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B"; @@ -2368,11 +2397,11 @@ export interface operations { /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** - * @description Selected node. - * @default Mistral7BInstruct + * @description Selected model. + * @default Llama3Instruct8B * @enum {string} */ - node?: + model?: | "Mistral7BInstruct" | "Mixtral8x7BInstruct" | "Llama3Instruct8B"; @@ -2398,47 +2427,6 @@ export interface operations { }; }; }; - /** - * GenerateTextVision - * @description Generate text with image input. - */ - GenerateTextVision: { - requestBody?: { - content: { - /** - * @example { - * "prompt": "what are these paintings of and who made them?", - * "image_uris": [ - * "https://media.substrate.run/docs-fuji-red.jpg", - * "https://media.substrate.run/docs-fuji-blue.jpg" - * ] - * } - */ - "application/json": { - /** @description Text prompt. */ - prompt: string; - /** @description Image prompts. */ - image_uris: string[]; - /** - * @description Maximum number of tokens to generate. - * @default 800 - */ - max_tokens?: number; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - /** @description Text response. */ - text: string; - }; - }; - }; - }; - }; /** * Mistral7BInstruct * @description Generate text using [Mistral 7B Instruct](https://mistral.ai/news/announcing-mistral-7b). @@ -2457,6 +2445,8 @@ export interface operations { "application/json": { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -2468,9 +2458,33 @@ export interface operations { }; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; @@ -2513,6 +2527,8 @@ export interface operations { "application/json": { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -2524,9 +2540,33 @@ export interface operations { }; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; @@ -2569,6 +2609,8 @@ export interface operations { "application/json": { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -2576,9 +2618,33 @@ export interface operations { num_choices?: number; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; /** @description JSON schema to guide response. */ @@ -2625,6 +2691,8 @@ export interface operations { "application/json": { /** @description Input prompt. */ prompt: string; + /** @description System prompt. */ + system_prompt?: string; /** * @description Number of choices to generate. * @default 1 @@ -2632,9 +2700,33 @@ export interface operations { num_choices?: number; /** * Format: float - * @description Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic. + * @description Higher values make the output more random, lower values make the output more deterministic. */ temperature?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeating previous tokens. + * @default 0 + */ + frequency_penalty?: number; + /** + * Format: float + * @description Higher values decrease the likelihood of repeated sequences. + * @default 1 + */ + repetition_penalty?: number; + /** + * Format: float + * @description Higher values increase the likelihood of new topics appearing. + * @default 1.1 + */ + presence_penalty?: number; + /** + * Format: float + * @description Probability below which less likely tokens are filtered out. + * @default 0.95 + */ + top_p?: number; /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; @@ -2676,10 +2768,7 @@ export interface operations { prompt: string; /** @description Image prompts. */ image_uris: string[]; - /** - * @description Maximum number of tokens to generate. - * @default 800 - */ + /** @description Maximum number of tokens to generate. */ max_tokens?: number; }; }; @@ -2772,10 +2861,10 @@ export interface operations { }; }; /** - * GenerativeEditImage - * @description Edit an image using image generation. + * InpaintImage + * @description Edit an image using image generation inside part of the image or the full image. */ - GenerativeEditImage: { + InpaintImage: { requestBody?: { content: { /** @@ -2811,10 +2900,10 @@ export interface operations { }; }; /** - * MultiGenerativeEditImage + * MultiInpaintImage * @description Edit multiple images using image generation. */ - MultiGenerativeEditImage: { + MultiInpaintImage: { requestBody?: { content: { /** @@ -2858,81 +2947,6 @@ export interface operations { }; }; }; - /** - * StableDiffusionXL - * @description Generate an image using [Stable Diffusion XL](https://arxiv.org/abs/2307.01952). - */ - StableDiffusionXL: { - requestBody?: { - content: { - /** - * @example { - * "prompt": "hokusai futuristic supercell spiral cloud with glowing core over turbulent ocean", - * "negative_prompt": "night, moon", - * "store": "hosted", - * "guidance_scale": 7, - * "num_images": 2, - * "seeds": [ - * 3306990332671669000, - * 13641924104177017000 - * ] - * } - */ - "application/json": { - /** @description Text prompt. */ - prompt: string; - /** @description Negative input prompt. */ - negative_prompt?: string; - /** - * @description Number of diffusion steps. - * @default 30 - */ - steps?: number; - /** - * @description Number of images to generate. - * @default 1 - */ - num_images: number; - /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ - store?: string; - /** - * @description Height of output image, in pixels. - * @default 1024 - */ - height?: number; - /** - * @description Width of output image, in pixels. - * @default 1024 - */ - width?: number; - /** @description Seeds for deterministic generation. Default is a random seed. */ - seeds?: number[]; - /** - * Format: float - * @description Higher values adhere to the text prompt more strongly, typically at the expense of image quality. - * @default 7 - */ - guidance_scale?: number; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - /** @description Generated images. */ - outputs: { - /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ - image_uri: string; - /** @description The random noise seed used for generation. */ - seed: number; - }[]; - }; - }; - }; - }; - }; /** * StableDiffusionXLLightning * @description Generate an image using [Stable Diffusion XL Lightning](https://arxiv.org/abs/2402.13929). @@ -3079,7 +3093,8 @@ export interface operations { * "image_uri": "https://media.substrate.run/spiral-logo.jpeg", * "prompt": "the futuristic solarpunk city of atlantis at sunset, cinematic bokeh HD", * "control_method": "illusion", - * "conditioning_scale": 0.5, + * "conditioning_scale": 1, + * "strength": 1, * "store": "hosted", * "num_images": 2, * "seeds": [ @@ -3095,7 +3110,7 @@ export interface operations { * @description Strategy to control generation using the input image. * @enum {string} */ - control_method: "edge" | "depth" | "illusion"; + control_method: "edge" | "depth" | "illusion" | "tile"; /** @description Text prompt. */ prompt: string; /** @@ -3118,79 +3133,12 @@ export interface operations { * @default 0.5 */ conditioning_scale?: number; - /** @description Random noise seeds. Default is random seeds for each generation. */ - seeds?: number[]; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - /** @description Generated images. */ - outputs: { - /** @description Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided. */ - image_uri: string; - /** @description The random noise seed used for generation. */ - seed: number; - }[]; - }; - }; - }; - }; - }; - /** - * StableDiffusionXLIPAdapter - * @description Generate an image with an image prompt, using Stable Diffusion XL with [IP-Adapter](https://arxiv.org/abs/2308.06721). - */ - StableDiffusionXLIPAdapter: { - requestBody?: { - content: { - /** - * @example { - * "prompt": "woodblock wave at sunset", - * "negative_prompt": "low quality, low resolution", - * "image_prompt_uri": "https://guides.substrate.run/hokusai.jpeg", - * "store": "hosted", - * "num_images": 2, - * "ip_adapter_scale": 0.9, - * "seeds": [ - * 6565750906821528000, - * 9762512681041689000 - * ] - * } - */ - "application/json": { - /** @description Text prompt. */ - prompt: string; - /** @description Image prompt. */ - image_prompt_uri: string; - /** - * @description Number of images to generate. - * @default 1 - */ - num_images: number; /** * Format: float - * @description Controls the influence of the image prompt on the generated output. + * @description Controls how much to transform the input image. * @default 0.5 */ - ip_adapter_scale?: number; - /** @description Negative input prompt. */ - negative_prompt?: string; - /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ - store?: string; - /** - * @description Width of output image, in pixels. - * @default 1024 - */ - width?: number; - /** - * @description Height of output image, in pixels. - * @default 1024 - */ - height?: number; + strength?: number; /** @description Random noise seeds. Default is random seeds for each generation. */ seeds?: number[]; }; @@ -3214,10 +3162,10 @@ export interface operations { }; }; /** - * TranscribeMedia + * TranscribeSpeech * @description Transcribe speech in an audio or video file. */ - TranscribeMedia: { + TranscribeSpeech: { requestBody?: { content: { /** @@ -3352,50 +3300,9 @@ export interface operations { }; }; }; - /** - * XTTSV2 - * @description Generate speech from text using [XTTS v2](https://docs.coqui.ai/en/latest/models/xtts.html). - */ - XTTSV2: { - requestBody?: { - content: { - /** - * @example { - * "text": "Substrate: an underlying substance or layer.", - * "audio_uri": "https://media.substrate.run/docs-speaker.wav", - * "store": "hosted" - * } - */ - "application/json": { - /** @description Input text. */ - text: string; - /** @description Reference audio used to synthesize the speaker. If unset, a default speaker voice will be used. */ - audio_uri?: string; - /** - * @description Language of input text. Supported languages: `en, de, fr, es, it, pt, pl, zh, ar, cs, ru, nl, tr, hu, ko`. - * @default en - */ - language?: string; - /** @description Use "hosted" to return an audio URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the audio data will be returned as a base64-encoded string. */ - store?: string; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": { - /** @description Base 64-encoded WAV audio bytes, or a hosted audio url if `store` is provided. */ - audio_uri: string; - }; - }; - }; - }; - }; /** * RemoveBackground - * @description Remove the background from an image, with the option to return the foreground as a mask. + * @description Remove the background from an image and return the foreground segment as a cut-out or a mask. */ RemoveBackground: { requestBody?: { @@ -3434,10 +3341,10 @@ export interface operations { }; }; /** - * FillMask - * @description Fill (inpaint) part of an image, e.g. to 'remove' an object. + * EraseImage + * @description Erase the masked part of an image, e.g. to 'remove' an object. */ - FillMask: { + EraseImage: { requestBody?: { content: { /** @@ -3471,20 +3378,28 @@ export interface operations { }; /** * UpscaleImage - * @description Upscale an image. + * @description Upscale an image using image generation. */ UpscaleImage: { requestBody?: { content: { /** * @example { - * "image_uri": "https://media.substrate.run/docs-seurat.jpg", + * "prompt": "high resolution detailed spiral shell", + * "image_uri": "https://media.substrate.run/docs-shell-emoji.jpg", * "store": "hosted" * } */ "application/json": { + /** @description Prompt to guide model on the content of image to upscale. */ + prompt?: string; /** @description Input image. */ image_uri: string; + /** + * @description Resolution of the output image, in pixels. + * @default 1024 + */ + output_resolution?: number; /** @description Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string. */ store?: string; }; @@ -3996,10 +3911,10 @@ export interface operations { }; }; /** - * CreateVectorStore - * @description Create a vector store for storing and querying embeddings. + * FindOrCreateVectorStore + * @description Find a vector store matching the given collection name, or create a new vector store. */ - CreateVectorStore: { + FindOrCreateVectorStore: { requestBody?: { content: { /** @@ -4016,22 +3931,6 @@ export interface operations { * @enum {string} */ model: "jina-v2" | "clip"; - /** - * @description The max number of connections per layer for the index. - * @default 16 - */ - m?: number; - /** - * @description The size of the dynamic candidate list for constructing the index graph. - * @default 64 - */ - ef_construction?: number; - /** - * @description The distance metric to construct the index with. - * @default inner - * @enum {string} - */ - metric?: "cosine" | "l2" | "inner"; }; }; }; @@ -4047,22 +3946,6 @@ export interface operations { * @enum {string} */ model: "jina-v2" | "clip"; - /** - * @description The max number of connections per layer for the index. - * @default 16 - */ - m: number; - /** - * @description The size of the dynamic candidate list for constructing the index graph. - * @default 64 - */ - ef_construction: number; - /** - * @description The distance metric to construct the index with. - * @default inner - * @enum {string} - */ - metric: "cosine" | "l2" | "inner"; }; }; }; @@ -4093,22 +3976,6 @@ export interface operations { * @enum {string} */ model: "jina-v2" | "clip"; - /** - * @description The max number of connections per layer for the index. - * @default 16 - */ - m: number; - /** - * @description The size of the dynamic candidate list for constructing the index graph. - * @default 64 - */ - ef_construction: number; - /** - * @description The distance metric to construct the index with. - * @default inner - * @enum {string} - */ - metric: "cosine" | "l2" | "inner"; }[]; }; }; diff --git a/src/Substrate.ts b/src/Substrate.ts index 2e82718..43532c7 100644 --- a/src/Substrate.ts +++ b/src/Substrate.ts @@ -228,6 +228,7 @@ export class Substrate { headers.append("User-Agent", `APIClient/JS ${VERSION}`); headers.append("X-Substrate-Version", this.apiVersion); headers.append("X-Substrate-Request-Id", randomString(32)); + headers.append("X-Substrate-Backend", "v1"); // Auth headers.append("Authorization", `Bearer ${this.apiKey}`); diff --git a/src/index.ts b/src/index.ts index 992f9f0..2812247 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,20 +1,18 @@ /** * 𐃏 Substrate TypeScript SDK * @generated file - * 20240530.20240531 + * 20240612.20240613 */ export { SubstrateError } from "substrate/Error"; export { Experimental, - RunPython, GenerateText, MultiGenerateText, BatchGenerateText, BatchGenerateJSON, GenerateJSON, MultiGenerateJSON, - GenerateTextVision, Mistral7BInstruct, Mixtral8x7BInstruct, Llama3Instruct8B, @@ -22,18 +20,15 @@ export { Firellava13B, GenerateImage, MultiGenerateImage, - GenerativeEditImage, - MultiGenerativeEditImage, - StableDiffusionXL, + InpaintImage, + MultiInpaintImage, StableDiffusionXLLightning, StableDiffusionXLInpaint, StableDiffusionXLControlNet, - StableDiffusionXLIPAdapter, - TranscribeMedia, + TranscribeSpeech, GenerateSpeech, - XTTSV2, RemoveBackground, - FillMask, + EraseImage, UpscaleImage, SegmentUnderPoint, SegmentAnything, @@ -43,7 +38,7 @@ export { MultiEmbedImage, JinaV2, CLIP, - CreateVectorStore, + FindOrCreateVectorStore, ListVectorStores, DeleteVectorStore, QueryVectorStore, diff --git a/src/openapi.json b/src/openapi.json index 6c26a3c..bf1226a 100644 --- a/src/openapi.json +++ b/src/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Substrate API", - "version": "2024-05-30", + "version": "2024-06-12", "contact": { "email": "support@substrate.run" }, @@ -72,14 +72,21 @@ "title": "RunPythonIn", "type": "object", "properties": { - "code": { + "pkl_function": { "type": "string", - "description": "Python code to execute. In your code, access values from the `input` parameter using the `SB_IN` variable. Update the `SB_OUT` variable with results you want returned in `output`." + "description": "Pickled function.", + "x-loggable": true }, - "input": { + "kwargs": { "type": "object", - "description": "Input to your code, accessible using the preloaded `SB_IN` variable.", - "additionalProperties": true + "description": "Keyword arguments to your function.", + "additionalProperties": true, + "x-loggable": true + }, + "python_version": { + "type": "string", + "description": "Python version.", + "x-loggable": true }, "pip_install": { "description": "Python packages to install. You must import them in your code.", @@ -90,27 +97,29 @@ "x-loggable": true } }, - "required": ["code"] + "required": ["kwargs"] }, "RunPythonOut": { "title": "RunPythonOut", "type": "object", "properties": { + "output": { + "description": "Return value of your function." + }, + "pkl_output": { + "type": "string", + "description": "Pickled return value." + }, "stdout": { "type": "string", "description": "Everything printed to stdout while running your code." }, - "output": { - "type": "object", - "description": "Contents of the `SB_OUT` variable after running your code.", - "additionalProperties": true - }, "stderr": { "type": "string", "description": "Contents of stderr if your code did not run successfully." } }, - "required": ["stdout", "output", "stderr"] + "required": ["stdout", "stderr"] }, "GenerateTextIn": { "title": "GenerateTextIn", @@ -120,6 +129,13 @@ "type": "string", "description": "Input prompt." }, + "image_uris": { + "description": "Image prompts.", + "type": "array", + "items": { + "type": "string" + } + }, "temperature": { "type": "number", "format": "float", @@ -134,16 +150,17 @@ "description": "Maximum number of tokens to generate.", "x-loggable": true }, - "node": { + "model": { "type": "string", "enum": [ "Mistral7BInstruct", "Mixtral8x7BInstruct", "Llama3Instruct8B", - "Llama3Instruct70B" + "Llama3Instruct70B", + "Firellava13B" ], - "description": "Selected node.", - "default": "Mistral7BInstruct", + "description": "Selected model. `Firellava13B` is automatically selected when `image_uris` is provided.", + "default": "Llama3Instruct8B", "x-loggable": true } }, @@ -187,15 +204,15 @@ "description": "Maximum number of tokens to generate.", "x-loggable": true }, - "node": { + "model": { "type": "string", "enum": [ "Mistral7BInstruct", "Mixtral8x7BInstruct", "Llama3Instruct8B" ], - "description": "Selected node.", - "default": "Mistral7BInstruct", + "description": "Selected model.", + "default": "Llama3Instruct8B", "x-loggable": true } }, @@ -247,7 +264,7 @@ "description": "Maximum number of tokens to generate.", "x-loggable": true }, - "node": { + "model": { "type": "string", "enum": [ "Mistral7BInstruct", @@ -255,8 +272,8 @@ "Llama3Instruct8B", "Llama3Instruct70B" ], - "description": "Selected node.", - "default": "Mistral7BInstruct" + "description": "Selected model.", + "default": "Llama3Instruct8B" } }, "required": ["prompt", "num_choices"] @@ -299,6 +316,13 @@ "type": "integer", "description": "Maximum number of tokens to generate.", "x-loggable": true + }, + "model": { + "type": "string", + "enum": ["Mistral7BInstruct", "Llama3Instruct8B"], + "description": "Selected model.", + "default": "Llama3Instruct8B", + "x-loggable": true } }, "required": ["prompts"] @@ -352,15 +376,15 @@ "description": "Maximum number of tokens to generate.", "x-loggable": true }, - "node": { + "model": { "type": "string", "enum": [ "Mistral7BInstruct", "Mixtral8x7BInstruct", "Llama3Instruct8B" ], - "description": "Selected node.", - "default": "Mistral7BInstruct", + "description": "Selected model.", + "default": "Llama3Instruct8B", "x-loggable": true } }, @@ -384,13 +408,6 @@ "title": "BatchGenerateJSONIn", "type": "object", "properties": { - "node": { - "type": "string", - "enum": ["Mistral7BInstruct", "Llama3Instruct8B"], - "description": "Selected node.", - "default": "Mistral7BInstruct", - "x-loggable": true - }, "prompts": { "description": "Batch input prompts.", "type": "array", @@ -416,6 +433,13 @@ "type": "integer", "description": "Maximum number of tokens to generate.", "x-loggable": true + }, + "model": { + "type": "string", + "enum": ["Mistral7BInstruct", "Llama3Instruct8B"], + "description": "Selected model.", + "default": "Llama3Instruct8B", + "x-loggable": true } }, "required": ["prompts", "json_schema"] @@ -442,6 +466,10 @@ "type": "string", "description": "Input prompt." }, + "system_prompt": { + "type": "string", + "description": "System prompt." + }, "num_choices": { "type": "integer", "description": "Number of choices to generate.", @@ -460,7 +488,43 @@ "format": "float", "minimum": 0, "maximum": 1, - "description": "Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.", + "description": "Higher values make the output more random, lower values make the output more deterministic.", + "x-loggable": true + }, + "frequency_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 0.0, + "description": "Higher values decrease the likelihood of repeating previous tokens.", + "x-loggable": true + }, + "repetition_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.0, + "description": "Higher values decrease the likelihood of repeated sequences.", + "x-loggable": true + }, + "presence_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.1, + "description": "Higher values increase the likelihood of new topics appearing.", + "x-loggable": true + }, + "top_p": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1.0, + "default": 0.95, + "description": "Probability below which less likely tokens are filtered out.", "x-loggable": true }, "max_tokens": { @@ -508,6 +572,10 @@ "type": "string", "description": "Input prompt." }, + "system_prompt": { + "type": "string", + "description": "System prompt." + }, "num_choices": { "type": "integer", "description": "Number of choices to generate.", @@ -526,7 +594,43 @@ "format": "float", "minimum": 0, "maximum": 1, - "description": "Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.", + "description": "Higher values make the output more random, lower values make the output more deterministic.", + "x-loggable": true + }, + "frequency_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 0.0, + "description": "Higher values decrease the likelihood of repeating previous tokens.", + "x-loggable": true + }, + "repetition_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.0, + "description": "Higher values decrease the likelihood of repeated sequences.", + "x-loggable": true + }, + "presence_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.1, + "description": "Higher values increase the likelihood of new topics appearing.", + "x-loggable": true + }, + "top_p": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1.0, + "default": 0.95, + "description": "Probability below which less likely tokens are filtered out.", "x-loggable": true }, "max_tokens": { @@ -574,6 +678,10 @@ "type": "string", "description": "Input prompt." }, + "system_prompt": { + "type": "string", + "description": "System prompt." + }, "num_choices": { "type": "integer", "description": "Number of choices to generate.", @@ -587,7 +695,43 @@ "format": "float", "minimum": 0, "maximum": 1, - "description": "Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.", + "description": "Higher values make the output more random, lower values make the output more deterministic.", + "x-loggable": true + }, + "frequency_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 0.0, + "description": "Higher values decrease the likelihood of repeating previous tokens.", + "x-loggable": true + }, + "repetition_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.0, + "description": "Higher values decrease the likelihood of repeated sequences.", + "x-loggable": true + }, + "presence_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.1, + "description": "Higher values increase the likelihood of new topics appearing.", + "x-loggable": true + }, + "top_p": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1.0, + "default": 0.95, + "description": "Probability below which less likely tokens are filtered out.", "x-loggable": true }, "max_tokens": { @@ -640,6 +784,10 @@ "type": "string", "description": "Input prompt." }, + "system_prompt": { + "type": "string", + "description": "System prompt." + }, "num_choices": { "type": "integer", "description": "Number of choices to generate.", @@ -653,7 +801,43 @@ "format": "float", "minimum": 0, "maximum": 1, - "description": "Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.", + "description": "Higher values make the output more random, lower values make the output more deterministic.", + "x-loggable": true + }, + "frequency_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 0.0, + "description": "Higher values decrease the likelihood of repeating previous tokens.", + "x-loggable": true + }, + "repetition_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.0, + "description": "Higher values decrease the likelihood of repeated sequences.", + "x-loggable": true + }, + "presence_penalty": { + "type": "number", + "format": "float", + "minimum": -2.0, + "maximum": 2.0, + "default": 1.1, + "description": "Higher values increase the likelihood of new topics appearing.", + "x-loggable": true + }, + "top_p": { + "type": "number", + "format": "float", + "minimum": 0, + "maximum": 1.0, + "default": 0.95, + "description": "Probability below which less likely tokens are filtered out.", "x-loggable": true }, "max_tokens": { @@ -688,41 +872,6 @@ }, "required": ["choices"] }, - "GenerateTextVisionIn": { - "title": "GenerateTextVisionIn", - "type": "object", - "properties": { - "prompt": { - "type": "string", - "description": "Text prompt." - }, - "image_uris": { - "description": "Image prompts.", - "type": "array", - "items": { - "type": "string" - } - }, - "max_tokens": { - "type": "integer", - "description": "Maximum number of tokens to generate.", - "default": 800, - "x-loggable": true - } - }, - "required": ["prompt", "image_uris"] - }, - "GenerateTextVisionOut": { - "title": "GenerateTextVisionOut", - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "Text response." - } - }, - "required": ["text"] - }, "Firellava13BIn": { "title": "Firellava13BIn", "type": "object", @@ -741,7 +890,6 @@ "max_tokens": { "type": "integer", "description": "Maximum number of tokens to generate.", - "default": 800, "x-loggable": true } }, @@ -1071,7 +1219,7 @@ }, "control_method": { "type": "string", - "enum": ["edge", "depth", "illusion"], + "enum": ["edge", "depth", "illusion", "tile"], "description": "Strategy to control generation using the input image.", "x-loggable": true }, @@ -1091,6 +1239,8 @@ "type": "integer", "description": "Resolution of the output image, in pixels.", "default": 1024, + "minimum": 512, + "maximum": 2048, "x-loggable": true }, "negative_prompt": { @@ -1110,6 +1260,15 @@ "default": 0.5, "x-loggable": true }, + "strength": { + "type": "number", + "format": "float", + "description": "Controls how much to transform the input image.", + "minimum": 0, + "maximum": 1, + "default": 0.5, + "x-loggable": true + }, "seeds": { "description": "Random noise seeds. Default is random seeds for each generation.", "type": "array", @@ -1135,8 +1294,8 @@ }, "required": ["outputs"] }, - "GenerativeEditImageIn": { - "title": "GenerativeEditImageIn", + "InpaintImageIn": { + "title": "InpaintImageIn", "type": "object", "properties": { "image_uri": { @@ -1158,8 +1317,8 @@ }, "required": ["image_uri", "prompt"] }, - "GenerativeEditImageOut": { - "title": "GenerativeEditImageOut", + "InpaintImageOut": { + "title": "InpaintImageOut", "type": "object", "properties": { "image_uri": { @@ -1169,8 +1328,8 @@ }, "required": ["image_uri"] }, - "MultiGenerativeEditImageIn": { - "title": "MultiGenerativeEditImageIn", + "MultiInpaintImageIn": { + "title": "MultiInpaintImageIn", "type": "object", "properties": { "image_uri": { @@ -1200,15 +1359,15 @@ }, "required": ["image_uri", "prompt", "num_images"] }, - "MultiGenerativeEditImageOut": { - "title": "MultiGenerativeEditImageOut", + "MultiInpaintImageOut": { + "title": "MultiInpaintImageOut", "type": "object", "properties": { "outputs": { "type": "array", "description": "Generated images.", "items": { - "$ref": "#/components/schemas/GenerativeEditImageOut" + "$ref": "#/components/schemas/InpaintImageOut" } } }, @@ -1242,6 +1401,8 @@ "type": "integer", "description": "Resolution of the output image, in pixels.", "default": 1024, + "minimum": 512, + "maximum": 2048, "x-loggable": true }, "negative_prompt": { @@ -1328,8 +1489,8 @@ }, "required": ["x", "y"] }, - "FillMaskIn": { - "title": "FillMaskIn", + "EraseImageIn": { + "title": "EraseImageIn", "type": "object", "properties": { "image_uri": { @@ -1347,8 +1508,8 @@ }, "required": ["image_uri", "mask_image_uri"] }, - "FillMaskOut": { - "title": "FillMaskOut", + "EraseImageOut": { + "title": "EraseImageOut", "type": "object", "properties": { "image_uri": { @@ -1454,36 +1615,22 @@ "title": "UpscaleImageIn", "type": "object", "properties": { - "image_uri": { + "prompt": { "type": "string", - "description": "Input image." + "description": "Prompt to guide model on the content of image to upscale." }, - "store": { - "type": "string", - "description": "Use \"hosted\" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string." - } - }, - "required": ["image_uri"] - }, - "UpscaleImageOut": { - "title": "UpscaleImageOut", - "type": "object", - "properties": { - "image_uri": { - "type": "string", - "description": "Base 64-encoded JPEG image bytes, or a hosted image url if `store` is provided." - } - }, - "required": ["image_uri"] - }, - "RealESRGANIn": { - "title": "RealESRGANIn", - "type": "object", - "properties": { "image_uri": { "type": "string", "description": "Input image." }, + "output_resolution": { + "type": "integer", + "description": "Resolution of the output image, in pixels.", + "default": 1024, + "minimum": 512, + "maximum": 2048, + "x-loggable": true + }, "store": { "type": "string", "description": "Use \"hosted\" to return an image URL hosted on Substrate. You can also provide a URL to a registered [file store](https://guides.substrate.run/guides/external-file-storage). If unset, the image data will be returned as a base64-encoded string." @@ -1491,8 +1638,8 @@ }, "required": ["image_uri"] }, - "RealESRGANOut": { - "title": "RealESRGANOut", + "UpscaleImageOut": { + "title": "UpscaleImageOut", "type": "object", "properties": { "image_uri": { @@ -1576,8 +1723,8 @@ }, "required": ["mask_image_uri"] }, - "TranscribeMediaIn": { - "title": "TranscribeMediaIn", + "TranscribeSpeechIn": { + "title": "TranscribeSpeechIn", "type": "object", "properties": { "audio_uri": { @@ -1694,8 +1841,8 @@ }, "required": ["title", "start"] }, - "TranscribeMediaOut": { - "title": "TranscribeMediaOut", + "TranscribeSpeechOut": { + "title": "TranscribeSpeechOut", "type": "object", "properties": { "text": { @@ -2117,8 +2264,8 @@ }, "required": ["embeddings"] }, - "CreateVectorStoreIn": { - "title": "CreateVectorStoreIn", + "FindOrCreateVectorStoreIn": { + "title": "FindOrCreateVectorStoreIn", "type": "object", "properties": { "collection_name": { @@ -2132,35 +2279,12 @@ "description": "Selected embedding model.", "enum": ["jina-v2", "clip"], "x-loggable": true - }, - "m": { - "type": "integer", - "minimum": 1, - "maximum": 64, - "default": 16, - "description": "The max number of connections per layer for the index.", - "x-loggable": true - }, - "ef_construction": { - "type": "integer", - "minimum": 1, - "maximum": 128, - "description": "The size of the dynamic candidate list for constructing the index graph.", - "default": 64, - "x-loggable": true - }, - "metric": { - "type": "string", - "enum": ["cosine", "l2", "inner"], - "default": "inner", - "description": "The distance metric to construct the index with.", - "x-loggable": true } }, "required": ["collection_name", "model"] }, - "CreateVectorStoreOut": { - "title": "CreateVectorStoreOut", + "FindOrCreateVectorStoreOut": { + "title": "FindOrCreateVectorStoreOut", "type": "object", "properties": { "collection_name": { @@ -2173,35 +2297,9 @@ "type": "string", "description": "Selected embedding model.", "enum": ["jina-v2", "clip"] - }, - "m": { - "type": "integer", - "minimum": 1, - "maximum": 64, - "default": 16, - "description": "The max number of connections per layer for the index." - }, - "ef_construction": { - "type": "integer", - "minimum": 1, - "maximum": 128, - "description": "The size of the dynamic candidate list for constructing the index graph.", - "default": 64 - }, - "metric": { - "type": "string", - "enum": ["cosine", "l2", "inner"], - "default": "inner", - "description": "The distance metric to construct the index with." } }, - "required": [ - "collection_name", - "model", - "m", - "ef_construction", - "metric" - ] + "required": ["collection_name", "model"] }, "ListVectorStoresIn": { "title": "ListVectorStoresIn", @@ -2216,7 +2314,7 @@ "type": "array", "description": "List of vector stores.", "items": { - "$ref": "#/components/schemas/CreateVectorStoreOut" + "$ref": "#/components/schemas/FindOrCreateVectorStoreOut" } } } @@ -2610,8 +2708,8 @@ "$ref": "#/components/schemas/RunPythonIn" }, "example": { - "code": "import numpy as np; print(SB_IN['foo']); SB_OUT['result']=np.sum([1,2]).item()", - "input": { "foo": "bar" }, + "pkl_function": "g2UjA5fX2t3ZGVmYXVsdHNfX5ROjAxfX2RlZmF1bHRzX1+UTowKX19tb2R1bGVfX5SMCF9fbWFpbl9flIwHX19kb2NfX5ROjAtfX2Nsb3N1cmVfX5ROjBdfY2xvdWRwaWNrbGVfc3VibW9kdWxlc5RdlIwLX19nbG9iYWxzX1+UfZR1hpSGUjAu", + "kwargs": {}, "pip_install": ["numpy"] } } @@ -2626,10 +2724,7 @@ "$ref": "#/components/schemas/RunPythonOut" }, "example": { - "stdout": "bar", - "output": { - "result": 3 - }, + "stdout": "foo\n", "stderr": "" } } @@ -2642,7 +2737,7 @@ "post": { "summary": "GenerateText", "operationId": "GenerateText", - "tags": ["category:language-generation"], + "tags": ["category:language"], "description": "Generate text using a language model.", "requestBody": { "content": { @@ -2679,7 +2774,7 @@ "post": { "summary": "MultiGenerateText", "operationId": "MultiGenerateText", - "tags": ["category:language-generation"], + "tags": ["category:language"], "description": "Generate multiple text choices using a language model.", "requestBody": { "content": { @@ -2723,7 +2818,7 @@ "post": { "summary": "BatchGenerateText", "operationId": "BatchGenerateText", - "tags": ["category:language-generation"], + "tags": ["category:language"], "description": "Generate text for multiple prompts in batch using a language model.", "requestBody": { "content": { @@ -2766,7 +2861,7 @@ "post": { "summary": "BatchGenerateJSON", "operationId": "BatchGenerateJSON", - "tags": ["category:language-generation"], + "tags": ["category:language"], "description": "Generate JSON for multiple prompts in batch using a language model.", "requestBody": { "content": { @@ -2822,7 +2917,7 @@ "post": { "summary": "GenerateJSON", "operationId": "GenerateJSON", - "tags": ["category:language-generation"], + "tags": ["category:language"], "description": "Generate JSON using a language model.", "requestBody": { "content": { @@ -2872,7 +2967,7 @@ "post": { "summary": "MultiGenerateJSON", "operationId": "MultiGenerateJSON", - "tags": ["category:language-generation"], + "tags": ["category:language"], "description": "Generate multiple JSON choices using a language model.", "requestBody": { "content": { @@ -2926,50 +3021,11 @@ } } }, - "/GenerateTextVision": { - "post": { - "summary": "GenerateTextVision", - "operationId": "GenerateTextVision", - "tags": ["category:language-generation"], - "description": "Generate text with image input.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateTextVisionIn" - }, - "example": { - "prompt": "what are these paintings of and who made them?", - "image_uris": [ - "https://media.substrate.run/docs-fuji-red.jpg", - "https://media.substrate.run/docs-fuji-blue.jpg" - ] - } - } - } - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateTextVisionOut" - }, - "example": { - "text": "The artist who created these paintings is Hokusai Katsushika, a renowned Japanese artist known for his woodblock prints and paintings." - } - } - } - } - } - } - }, "/Mistral7BInstruct": { "post": { "summary": "Mistral7BInstruct", "operationId": "Mistral7BInstruct", - "tags": ["category:language-generation", "type:low-level"], + "tags": ["category:language", "type:low-level"], "description": "Generate text using [Mistral 7B Instruct](https://mistral.ai/news/announcing-mistral-7b).", "requestBody": { "content": { @@ -3014,7 +3070,7 @@ "post": { "summary": "Mixtral8x7BInstruct", "operationId": "Mixtral8x7BInstruct", - "tags": ["category:language-generation", "type:low-level"], + "tags": ["category:language", "type:low-level"], "description": "Generate text using instruct-tuned [Mixtral 8x7B](https://mistral.ai/news/mixtral-of-experts/).", "requestBody": { "content": { @@ -3059,7 +3115,7 @@ "post": { "summary": "Llama3Instruct8B", "operationId": "Llama3Instruct8B", - "tags": ["category:language-generation", "type:low-level"], + "tags": ["category:language", "type:low-level"], "description": "Generate text using instruct-tuned [Llama 3 8B](https://llama.meta.com/llama3/).", "requestBody": { "content": { @@ -3104,7 +3160,7 @@ "post": { "summary": "Llama3Instruct70B", "operationId": "Llama3Instruct70B", - "tags": ["category:language-generation", "type:low-level"], + "tags": ["category:language", "type:low-level"], "description": "Generate text using instruct-tuned [Llama 3 70B](https://llama.meta.com/llama3/).", "requestBody": { "content": { @@ -3149,7 +3205,7 @@ "post": { "summary": "Firellava13B", "operationId": "Firellava13B", - "tags": ["category:language-generation", "type:low-level"], + "tags": ["category:language", "type:low-level"], "description": "Generate text with image input using [FireLLaVA 13B](https://fireworks.ai/blog/firellava-the-first-commercially-permissive-oss-llava-model).", "requestBody": { "content": { @@ -3188,7 +3244,7 @@ "post": { "summary": "GenerateImage", "operationId": "GenerateImage", - "tags": ["category:image-generation"], + "tags": ["category:image"], "description": "Generate an image.", "requestBody": { "content": { @@ -3224,7 +3280,7 @@ "post": { "summary": "MultiGenerateImage", "operationId": "MultiGenerateImage", - "tags": ["category:image-generation"], + "tags": ["category:image"], "description": "Generate multiple images.", "requestBody": { "content": { @@ -3264,17 +3320,17 @@ } } }, - "/GenerativeEditImage": { + "/InpaintImage": { "post": { - "summary": "GenerativeEditImage", - "operationId": "GenerativeEditImage", - "tags": ["category:image-generation"], - "description": "Edit an image using image generation.", + "summary": "InpaintImage", + "operationId": "InpaintImage", + "tags": ["category:image"], + "description": "Edit an image using image generation inside part of the image or the full image.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerativeEditImageIn" + "$ref": "#/components/schemas/InpaintImageIn" }, "example": { "image_uri": "https://media.substrate.run/docs-klimt-park.jpg", @@ -3291,7 +3347,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerativeEditImageOut" + "$ref": "#/components/schemas/InpaintImageOut" }, "example": { "image_uri": "https://assets.substrate.run/84848484.jpg" @@ -3302,17 +3358,17 @@ } } }, - "/MultiGenerativeEditImage": { + "/MultiInpaintImage": { "post": { - "summary": "MultiGenerativeEditImage", - "operationId": "MultiGenerativeEditImage", - "tags": ["category:image-generation"], + "summary": "MultiInpaintImage", + "operationId": "MultiInpaintImage", + "tags": ["category:image"], "description": "Edit multiple images using image generation.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MultiGenerativeEditImageIn" + "$ref": "#/components/schemas/MultiInpaintImageIn" }, "example": { "image_uri": "https://media.substrate.run/docs-klimt-park.jpg", @@ -3330,7 +3386,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MultiGenerativeEditImageOut" + "$ref": "#/components/schemas/MultiInpaintImageOut" }, "example": { "outputs": [ @@ -3348,60 +3404,11 @@ } } }, - "/StableDiffusionXL": { - "post": { - "summary": "StableDiffusionXL", - "operationId": "StableDiffusionXL", - "tags": ["category:image-generation", "type:low-level"], - "description": "Generate an image using [Stable Diffusion XL](https://arxiv.org/abs/2307.01952).", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StableDiffusionXLIn" - }, - "example": { - "prompt": "hokusai futuristic supercell spiral cloud with glowing core over turbulent ocean", - "negative_prompt": "night, moon", - "store": "hosted", - "guidance_scale": 7, - "num_images": 2, - "seeds": [3306990332671669418, 13641924104177017164] - } - } - } - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StableDiffusionXLOut" - }, - "example": { - "outputs": [ - { - "image_uri": "https://assets.substrate.run/84848484.jpg", - "seed": 3306990332671669418 - }, - { - "image_uri": "https://assets.substrate.run/48484848.jpg", - "seed": 13641924104177017164 - } - ] - } - } - } - } - } - } - }, "/StableDiffusionXLLightning": { "post": { "summary": "StableDiffusionXLLightning", "operationId": "StableDiffusionXLLightning", - "tags": ["category:image-generation", "type:low-level"], + "tags": ["category:image", "type:low-level"], "description": "Generate an image using [Stable Diffusion XL Lightning](https://arxiv.org/abs/2402.13929).", "requestBody": { "content": { @@ -3449,7 +3456,7 @@ "post": { "summary": "StableDiffusionXLInpaint", "operationId": "StableDiffusionXLInpaint", - "tags": ["category:image-generation", "type:low-level"], + "tags": ["category:image", "type:low-level"], "description": "Edit an image using [Stable Diffusion XL](https://arxiv.org/abs/2307.01952). Supports inpainting (edit part of the image with a mask) and image-to-image (edit the full image).", "requestBody": { "content": { @@ -3500,7 +3507,7 @@ "post": { "summary": "StableDiffusionXLControlNet", "operationId": "StableDiffusionXLControlNet", - "tags": ["category:image-generation"], + "tags": ["category:image"], "description": "Generate an image with generation structured by an input image, using Stable Diffusion XL with [ControlNet](https://arxiv.org/abs/2302.05543).", "requestBody": { "content": { @@ -3512,7 +3519,8 @@ "image_uri": "https://media.substrate.run/spiral-logo.jpeg", "prompt": "the futuristic solarpunk city of atlantis at sunset, cinematic bokeh HD", "control_method": "illusion", - "conditioning_scale": 0.5, + "conditioning_scale": 1.0, + "strength": 1.0, "store": "hosted", "num_images": 2, "seeds": [16072680593433107326, 17203982922585031095] @@ -3546,67 +3554,17 @@ } } }, - "/StableDiffusionXLIPAdapter": { - "post": { - "summary": "StableDiffusionXLIPAdapter", - "operationId": "StableDiffusionXLIPAdapter", - "tags": ["category:image-generation", "type:low-level"], - "description": "Generate an image with an image prompt, using Stable Diffusion XL with [IP-Adapter](https://arxiv.org/abs/2308.06721).", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StableDiffusionXLIPAdapterIn" - }, - "example": { - "prompt": "woodblock wave at sunset", - "negative_prompt": "low quality, low resolution", - "image_prompt_uri": "https://guides.substrate.run/hokusai.jpeg", - "store": "hosted", - "num_images": 2, - "ip_adapter_scale": 0.9, - "seeds": [6565750906821527600, 9762512681041688800] - } - } - } - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StableDiffusionXLIPAdapterOut" - }, - "example": { - "outputs": [ - { - "image_uri": "https://assets.substrate.run/84848484.jpg", - "seed": 6565750906821527600 - }, - { - "image_uri": "https://assets.substrate.run/48484848.jpg", - "seed": 9762512681041688800 - } - ] - } - } - } - } - } - } - }, - "/TranscribeMedia": { + "/TranscribeSpeech": { "post": { - "summary": "TranscribeMedia", - "operationId": "TranscribeMedia", + "summary": "TranscribeSpeech", + "operationId": "TranscribeSpeech", "tags": ["category:audio"], "description": "Transcribe speech in an audio or video file.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TranscribeMediaIn" + "$ref": "#/components/schemas/TranscribeSpeechIn" }, "example": { "audio_uri": "https://media.substrate.run/dfw-clip.m4a", @@ -3625,7 +3583,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TranscribeMediaOut" + "$ref": "#/components/schemas/TranscribeSpeechOut" }, "example": { "text": "language like that, the wounded inner child, the inner pain, is part of a kind of pop psychological movement in the United States that is a sort of popular Freudianism that ...", @@ -3704,49 +3662,12 @@ } } }, - "/XTTSV2": { - "post": { - "summary": "XTTSV2", - "operationId": "XTTSV2", - "tags": ["category:audio", "type:low-level"], - "description": "Generate speech from text using [XTTS v2](https://docs.coqui.ai/en/latest/models/xtts.html).", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/XTTSV2In" - }, - "example": { - "text": "Substrate: an underlying substance or layer.", - "audio_uri": "https://media.substrate.run/docs-speaker.wav", - "store": "hosted" - } - } - } - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/XTTSV2Out" - }, - "example": { - "audio_uri": "https://assets.substrate.run/84848484.wav" - } - } - } - } - } - } - }, "/RemoveBackground": { "post": { "summary": "RemoveBackground", "operationId": "RemoveBackground", - "tags": ["category:image-utility"], - "description": "Remove the background from an image, with the option to return the foreground as a mask.", + "tags": ["category:segmentation"], + "description": "Remove the background from an image and return the foreground segment as a cut-out or a mask.", "requestBody": { "content": { "application/json": { @@ -3777,17 +3698,17 @@ } } }, - "/FillMask": { + "/EraseImage": { "post": { - "summary": "FillMask", - "operationId": "FillMask", - "tags": ["category:image-utility"], - "description": "Fill (inpaint) part of an image, e.g. to 'remove' an object.", + "summary": "EraseImage", + "operationId": "EraseImage", + "tags": ["category:image"], + "description": "Erase the masked part of an image, e.g. to 'remove' an object.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FillMaskIn" + "$ref": "#/components/schemas/EraseImageIn" }, "example": { "image_uri": "https://media.substrate.run/apple-forest.jpeg", @@ -3803,7 +3724,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FillMaskOut" + "$ref": "#/components/schemas/EraseImageOut" }, "example": { "image_uri": "https://assets.substrate.run/84848484.jpg" @@ -3818,8 +3739,8 @@ "post": { "summary": "UpscaleImage", "operationId": "UpscaleImage", - "tags": ["category:image-utility"], - "description": "Upscale an image.", + "tags": ["category:image"], + "description": "Upscale an image using image generation.", "requestBody": { "content": { "application/json": { @@ -3827,7 +3748,8 @@ "$ref": "#/components/schemas/UpscaleImageIn" }, "example": { - "image_uri": "https://media.substrate.run/docs-seurat.jpg", + "prompt": "high resolution detailed spiral shell", + "image_uri": "https://media.substrate.run/docs-shell-emoji.jpg", "store": "hosted" } } @@ -3854,7 +3776,7 @@ "post": { "summary": "SegmentUnderPoint", "operationId": "SegmentUnderPoint", - "tags": ["category:image-utility"], + "tags": ["category:segmentation"], "description": "Segment an image under a point and return the segment.", "requestBody": { "content": { @@ -3894,7 +3816,7 @@ "post": { "summary": "SegmentAnything", "operationId": "SegmentAnything", - "tags": ["category:image-utility", "type:low-level"], + "tags": ["category:segmentation", "type:low-level"], "description": "Segment an image using [SegmentAnything](https://github.com/facebookresearch/segment-anything).", "requestBody": { "content": { @@ -4293,17 +4215,17 @@ } } }, - "/CreateVectorStore": { + "/FindOrCreateVectorStore": { "post": { "tags": ["category:vector-store"], - "summary": "CreateVectorStore", - "operationId": "CreateVectorStore", - "description": "Create a vector store for storing and querying embeddings.", + "summary": "FindOrCreateVectorStore", + "operationId": "FindOrCreateVectorStore", + "description": "Find a vector store matching the given collection name, or create a new vector store.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateVectorStoreIn" + "$ref": "#/components/schemas/FindOrCreateVectorStoreIn" }, "example": { "collection_name": "smoke_tests", @@ -4318,14 +4240,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateVectorStoreOut" + "$ref": "#/components/schemas/FindOrCreateVectorStoreOut" }, "example": { "collection_name": "smoke_tests", - "model": "jina-v2", - "m": 16, - "ef_construction": 64, - "metric": "inner" + "model": "jina-v2" } } } @@ -4361,17 +4280,11 @@ "items": [ { "collection_name": "comments", - "model": "jina-v2", - "m": 16, - "ef_construction": 64, - "metric": "inner" + "model": "jina-v2" }, { "collection_name": "images", - "model": "jina-v2", - "m": 16, - "ef_construction": 64, - "metric": "inner" + "model": "jina-v2" } ] } diff --git a/src/version.ts b/src/version.ts index 7a899f3..37f6716 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = "120240530.0.14"; +export const VERSION = "120240612.0.14"; From 4391702f0c1b2d886a6ac46c6ee2adbe4aa894ba Mon Sep 17 00:00:00 2001 From: benzguo Date: Thu, 13 Jun 2024 17:49:00 -0400 Subject: [PATCH 2/6] codegen --- src/Nodes.ts | 60 ---------------------------------------------------- 1 file changed, 60 deletions(-) diff --git a/src/Nodes.ts b/src/Nodes.ts index 24cba84..0ac6b30 100644 --- a/src/Nodes.ts +++ b/src/Nodes.ts @@ -45,19 +45,6 @@ type FutureExpandAny = T extends (infer U)[][] export class ExperimentalInArgs extends FutureAnyObject {} export class ExperimentalOutOutput extends FutureAnyObject {} -export class RunPythonInKwargs extends FutureAnyObject {} -/** Python packages to install. You must import them in your code. */ -export class RunPythonInPipInstall extends FutureArray { - /** Returns `FutureString` at given index. */ - override at(index: number) { - return new FutureString(this._directive.next(index)); - } - /** Returns the result for `RunPythonInPipInstall` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} -export class RunPythonInPipInstallItem extends FutureString {} /** Image prompts. */ export class GenerateTextInImageUris extends FutureArray { /** Returns `FutureString` at given index. */ @@ -770,53 +757,6 @@ export class ExperimentalOut extends FutureObject { return super.result() as Promise; } } -/** RunPythonIn */ -export class RunPythonIn extends FutureObject { - /** (Optional) Pickled function. */ - get pkl_function() { - return new FutureString(this._directive.next("pkl_function")); - } - /** Keyword arguments to your function. */ - get kwargs() { - return new FutureAnyObject(this._directive.next("kwargs")); - } - /** (Optional) Python version. */ - get python_version() { - return new FutureString(this._directive.next("python_version")); - } - - /** (Optional) Python packages to install. You must import them in your code. */ - get pip_install() { - return new RunPythonInPipInstall(this._directive.next("pip_install")); - } - /** returns the result for `RunPythonIn` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} -/** RunPythonOut */ -export class RunPythonOut extends FutureObject { - /** (Optional) Return value of your function. */ - get output() { - return new (this._directive.next("output"))(); - } - /** (Optional) Pickled return value. */ - get pkl_output() { - return new FutureString(this._directive.next("pkl_output")); - } - /** Everything printed to stdout while running your code. */ - get stdout() { - return new FutureString(this._directive.next("stdout")); - } - /** Contents of stderr if your code did not run successfully. */ - get stderr() { - return new FutureString(this._directive.next("stderr")); - } - /** returns the result for `RunPythonOut` once it's node has been run. */ - protected override async result(): Promise { - return super.result() as Promise; - } -} /** GenerateTextIn */ export class GenerateTextIn extends FutureObject { /** Input prompt. */ From 782863b29d3a424169d9dab36ef2b70188e22d63 Mon Sep 17 00:00:00 2001 From: benzguo Date: Thu, 13 Jun 2024 18:16:22 -0400 Subject: [PATCH 3/6] codegen --- src/Nodes.ts | 10 +++------- src/OpenAPI.ts | 10 ---------- src/openapi.json | 8 +------- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/Nodes.ts b/src/Nodes.ts index 0ac6b30..0b73579 100644 --- a/src/Nodes.ts +++ b/src/Nodes.ts @@ -2769,10 +2769,6 @@ export class QueryVectorStoreOut extends FutureObject { get model() { return new FutureString(this._directive.next("model")); } - /** (Optional) The distance metric used for the query. */ - get metric() { - return new FutureString(this._directive.next("metric")); - } /** returns the result for `QueryVectorStoreOut` once it's node has been run. */ protected override async result(): Promise { return super.result() as Promise; @@ -5174,7 +5170,7 @@ export class QueryVectorStore extends Node { /** * Input arguments: `collection_name`, `model`, `query_strings` (optional), `query_image_uris` (optional), `query_vectors` (optional), `query_ids` (optional), `top_k` (optional), `ef_search` (optional), `include_values` (optional), `include_metadata` (optional), `filters` (optional) * - * Output fields: `results`, `collection_name` (optional), `model` (optional), `metric` (optional) + * Output fields: `results`, `collection_name` (optional), `model` (optional) * * https://www.substrate.run/nodes#QueryVectorStore */ @@ -5188,7 +5184,7 @@ export class QueryVectorStore extends Node { /** * Retrieve this node's output from a response. * - * Output fields: `results`, `collection_name` (optional), `model` (optional), `metric` (optional) + * Output fields: `results`, `collection_name` (optional), `model` (optional) * * https://www.substrate.run/nodes#QueryVectorStore */ @@ -5205,7 +5201,7 @@ export class QueryVectorStore extends Node { /** * Future reference to this node's output. * - * Output fields: `results`, `collection_name` (optional), `model` (optional), `metric` (optional) + * Output fields: `results`, `collection_name` (optional), `model` (optional) * * https://www.substrate.run/nodes#QueryVectorStore */ diff --git a/src/OpenAPI.ts b/src/OpenAPI.ts index 6695152..09a7dea 100644 --- a/src/OpenAPI.ts +++ b/src/OpenAPI.ts @@ -1933,11 +1933,6 @@ export interface components { * @enum {string} */ model?: "jina-v2" | "clip"; - /** - * @description The distance metric used for the query. - * @enum {string} - */ - metric?: "cosine" | "l2" | "inner"; }; }; responses: never; @@ -4113,11 +4108,6 @@ export interface operations { * @enum {string} */ model?: "jina-v2" | "clip"; - /** - * @description The distance metric used for the query. - * @enum {string} - */ - metric?: "cosine" | "l2" | "inner"; }; }; }; diff --git a/src/openapi.json b/src/openapi.json index bf1226a..e6b3c4b 100644 --- a/src/openapi.json +++ b/src/openapi.json @@ -2647,11 +2647,6 @@ "type": "string", "description": "Selected embedding model.", "enum": ["jina-v2", "clip"] - }, - "metric": { - "type": "string", - "enum": ["cosine", "l2", "inner"], - "description": "The distance metric used for the query." } }, "required": ["results"] @@ -4387,8 +4382,7 @@ ] ], "collection_name": "comments", - "model": "jina-v2", - "metric": "inner" + "model": "jina-v2" } } } From 6c0e6c3e11465fc2aa4690a0c53aeb16d3637340 Mon Sep 17 00:00:00 2001 From: benzguo Date: Thu, 13 Jun 2024 18:17:29 -0400 Subject: [PATCH 4/6] update --- DEVELOPMENT.md | 3 --- Makefile | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3a2fff5..3aacae5 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -31,9 +31,6 @@ make generate # in SubstrateLabs/substrate-typescript: copy the generated files make sync-codegen -# format the code -make format-fix - # ensure the package builds make build ``` diff --git a/Makefile b/Makefile index 75906d0..4e780f5 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ update-version: ensure sync-codegen: ensure bin/sync-codegen.ts make update-version + make format-fix .PHONY: format-check format-check: ensure From 5fda2d54c14ac881ccc4c0d10fdae70b84ffb264 Mon Sep 17 00:00:00 2001 From: benzguo Date: Fri, 14 Jun 2024 00:39:34 -0400 Subject: [PATCH 5/6] 120240612.0.0 --- DEVELOPMENT.md | 2 ++ bin/update-version.ts | 2 +- examples/streaming/nextjs-basic/app/globals.css | 8 -------- examples/streaming/nextjs-multiple-nodes/app/globals.css | 8 -------- package-lock.json | 4 ++-- package.json | 2 +- src/version.ts | 2 +- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3aacae5..b2349cf 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -121,6 +121,8 @@ After making changes, you should: - Make sure to bump the `SDK_VERSION` in the `bin/update-version.ts` script - Then run `make update-version` to ensure the `package.json` and `src/version.ts` are set correctly. +**NOTE:** If the API version (the date string) has changed, you should reset the minor and patch version to `0.0`. + **NOTE:** The `make update-version` task will run after every `make sync-codegen` too! ## CI & Git Hooks diff --git a/bin/update-version.ts b/bin/update-version.ts index a067043..4f46819 100755 --- a/bin/update-version.ts +++ b/bin/update-version.ts @@ -5,7 +5,7 @@ import { execSync } from "node:child_process"; // NOTE: Merged with API version to produce the full SDK version string // https://docs.substrate.run/versioning -const SDK_VERSION = "1.0.14"; +const SDK_VERSION = "1.0.0"; const ok = (message: string) => console.log("\x1b[32m✓\x1b[0m", message); diff --git a/examples/streaming/nextjs-basic/app/globals.css b/examples/streaming/nextjs-basic/app/globals.css index 875c01e..599bbad 100644 --- a/examples/streaming/nextjs-basic/app/globals.css +++ b/examples/streaming/nextjs-basic/app/globals.css @@ -8,14 +8,6 @@ --background-end-rgb: 255, 255, 255; } -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -} - body { color: rgb(var(--foreground-rgb)); background: linear-gradient( diff --git a/examples/streaming/nextjs-multiple-nodes/app/globals.css b/examples/streaming/nextjs-multiple-nodes/app/globals.css index 875c01e..599bbad 100644 --- a/examples/streaming/nextjs-multiple-nodes/app/globals.css +++ b/examples/streaming/nextjs-multiple-nodes/app/globals.css @@ -8,14 +8,6 @@ --background-end-rgb: 255, 255, 255; } -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -} - body { color: rgb(var(--foreground-rgb)); background: linear-gradient( diff --git a/package-lock.json b/package-lock.json index eb57377..3b69dcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "substrate", - "version": "120240612.0.14", + "version": "120240612.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "substrate", - "version": "120240612.0.14", + "version": "120240612.0.0", "license": "MIT", "dependencies": { "@types/node-fetch": "^2.6.11", diff --git a/package.json b/package.json index db2a3ec..75f301c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "substrate", - "version": "120240612.0.14", + "version": "120240612.0.0", "description": "The official SDK for the Substrate API", "repository": { "type": "git", diff --git a/src/version.ts b/src/version.ts index 37f6716..c0fdd76 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = "120240612.0.14"; +export const VERSION = "120240612.0.0"; From 7509aef339611d0ccaf1e24601c759ae0b0070ac Mon Sep 17 00:00:00 2001 From: benzguo Date: Fri, 14 Jun 2024 00:40:19 -0400 Subject: [PATCH 6/6] update readme --- DEVELOPMENT.md | 1 - 1 file changed, 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b2349cf..b2bd4b9 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -158,7 +158,6 @@ that we'd like to publish. 1. Preview the "pack" (tarball we publish to npm): `make publish-preview` 2. Publish to NPM & push tag to GitHub: `make publish` -3. Create new Release on GitHub (using the web UI). Add release notes, mentions, etc. **Non-Production Releases**