Documentation
¶
Overview ¶
Package worker's module provides multipart form data utilities.
This module extends oapi-codegen Go bindings with multipart writers, enabling request parameter encoding for inter-node communication (gateway, orchestrator, runner).
Package worker provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.2.0 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func NewAudioToTextMultipartWriter(w io.Writer, req GenAudioToTextMultipartRequestBody) (*multipart.Writer, error)
- func NewGenAudioToTextRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenImageToImageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenImageToTextRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenImageToVideoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenLLMRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenLLMRequestWithFormdataBody(server string, body GenLLMFormdataRequestBody) (*http.Request, error)
- func NewGenSegmentAnything2RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenTextToImageRequest(server string, body GenTextToImageJSONRequestBody) (*http.Request, error)
- func NewGenTextToImageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGenUpscaleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewHealthRequest(server string) (*http.Request, error)
- func NewImageToImageMultipartWriter(w io.Writer, req GenImageToImageMultipartRequestBody) (*multipart.Writer, error)
- func NewImageToTextMultipartWriter(w io.Writer, req GenImageToTextMultipartRequestBody) (*multipart.Writer, error)
- func NewImageToVideoMultipartWriter(w io.Writer, req GenImageToVideoMultipartRequestBody) (*multipart.Writer, error)
- func NewLLMMultipartWriter(w io.Writer, req BodyGenLLM) (*multipart.Writer, error)
- func NewSegmentAnything2MultipartWriter(w io.Writer, req GenSegmentAnything2MultipartRequestBody) (*multipart.Writer, error)
- func NewUpscaleMultipartWriter(w io.Writer, req GenUpscaleMultipartRequestBody) (*multipart.Writer, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func ReadImageB64DataUrl(url string, w io.Writer) error
- func SaveImageB64DataUrl(url, outputPath string) error
- type APIError
- type BodyGenAudioToText
- type BodyGenAudioToTextReturnTimestamps0
- type BodyGenAudioToTextReturnTimestamps1
- type BodyGenAudioToText_ReturnTimestamps
- func (t BodyGenAudioToText_ReturnTimestamps) AsBodyGenAudioToTextReturnTimestamps0() (BodyGenAudioToTextReturnTimestamps0, error)
- func (t BodyGenAudioToText_ReturnTimestamps) AsBodyGenAudioToTextReturnTimestamps1() (BodyGenAudioToTextReturnTimestamps1, error)
- func (t *BodyGenAudioToText_ReturnTimestamps) FromBodyGenAudioToTextReturnTimestamps0(v BodyGenAudioToTextReturnTimestamps0) error
- func (t *BodyGenAudioToText_ReturnTimestamps) FromBodyGenAudioToTextReturnTimestamps1(v BodyGenAudioToTextReturnTimestamps1) error
- func (t BodyGenAudioToText_ReturnTimestamps) MarshalJSON() ([]byte, error)
- func (t *BodyGenAudioToText_ReturnTimestamps) MergeBodyGenAudioToTextReturnTimestamps0(v BodyGenAudioToTextReturnTimestamps0) error
- func (t *BodyGenAudioToText_ReturnTimestamps) MergeBodyGenAudioToTextReturnTimestamps1(v BodyGenAudioToTextReturnTimestamps1) error
- func (t *BodyGenAudioToText_ReturnTimestamps) UnmarshalJSON(b []byte) error
- type BodyGenImageToImage
- type BodyGenImageToText
- type BodyGenImageToVideo
- type BodyGenLLM
- type BodyGenSegmentAnything2
- type BodyGenUpscale
- type ChiServerOptions
- type Chunk
- type Client
- func (c *Client) GenAudioToTextWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenImageToImageWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenImageToTextWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenImageToVideoWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenLLMWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenLLMWithFormdataBody(ctx context.Context, body GenLLMFormdataRequestBody, ...) (*http.Response, error)
- func (c *Client) GenSegmentAnything2WithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenTextToImage(ctx context.Context, body GenTextToImageJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) GenTextToImageWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GenUpscaleWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GenAudioToTextWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenAudioToTextResponse, error)
- func (c *ClientWithResponses) GenImageToImageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenImageToImageResponse, error)
- func (c *ClientWithResponses) GenImageToTextWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenImageToTextResponse, error)
- func (c *ClientWithResponses) GenImageToVideoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenImageToVideoResponse, error)
- func (c *ClientWithResponses) GenLLMWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenLLMResponse, error)
- func (c *ClientWithResponses) GenLLMWithFormdataBodyWithResponse(ctx context.Context, body GenLLMFormdataRequestBody, ...) (*GenLLMResponse, error)
- func (c *ClientWithResponses) GenSegmentAnything2WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenSegmentAnything2Response, error)
- func (c *ClientWithResponses) GenTextToImageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenTextToImageResponse, error)
- func (c *ClientWithResponses) GenTextToImageWithResponse(ctx context.Context, body GenTextToImageJSONRequestBody, ...) (*GenTextToImageResponse, error)
- func (c *ClientWithResponses) GenUpscaleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GenUpscaleResponse, error)
- func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
- type ClientWithResponsesInterface
- type DockerManager
- func (m *DockerManager) Borrow(ctx context.Context, pipeline, modelID string) (*RunnerContainer, error)
- func (m *DockerManager) HasCapacity(ctx context.Context, pipeline, modelID string) bool
- func (m *DockerManager) Return(rc *RunnerContainer)
- func (m *DockerManager) Stop(ctx context.Context) error
- func (m *DockerManager) Warm(ctx context.Context, pipeline string, modelID string, ...) error
- type EnvValue
- type GenAudioToTextMultipartRequestBody
- type GenAudioToTextResponse
- type GenImageToImageMultipartRequestBody
- type GenImageToImageResponse
- type GenImageToTextMultipartRequestBody
- type GenImageToTextResponse
- type GenImageToVideoMultipartRequestBody
- type GenImageToVideoResponse
- type GenLLMFormdataRequestBody
- type GenLLMResponse
- type GenSegmentAnything2MultipartRequestBody
- type GenSegmentAnything2Response
- type GenTextToImageJSONRequestBody
- type GenTextToImageResponse
- type GenUpscaleMultipartRequestBody
- type GenUpscaleResponse
- type HTTPError
- type HTTPValidationError
- type HealthCheck
- type HealthResponse
- type HttpRequestDoer
- type ImageResponse
- type ImageToTextResponse
- type InvalidParamFormatError
- type LLMResponse
- type LlmStreamChunk
- type MasksResponse
- type Media
- type MiddlewareFunc
- type OptimizationFlags
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type RunnerContainer
- type RunnerContainerConfig
- type RunnerContainerType
- type RunnerEndpoint
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GenAudioToText(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenImageToImage(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenImageToText(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenImageToVideo(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenLLM(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenSegmentAnything2(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenTextToImage(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenUpscale(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Health(w http.ResponseWriter, r *http.Request)
- type TextResponse
- type TextToImageParams
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) GenAudioToText(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenImageToImage(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenImageToText(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenImageToVideo(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenLLM(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenSegmentAnything2(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenTextToImage(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GenUpscale(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) Health(w http.ResponseWriter, r *http.Request)
- type UnmarshalingParamError
- type ValidationError
- type ValidationErrorLoc0
- type ValidationErrorLoc1
- type ValidationError_Loc_Item
- func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error)
- func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error)
- func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error
- func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error
- func (t ValidationError_Loc_Item) MarshalJSON() ([]byte, error)
- func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error
- func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error
- func (t *ValidationError_Loc_Item) UnmarshalJSON(b []byte) error
- type VideoResponse
- type Worker
- func (w *Worker) AudioToText(ctx context.Context, req GenAudioToTextMultipartRequestBody) (*TextResponse, error)
- func (w *Worker) HasCapacity(pipeline, modelID string) bool
- func (w *Worker) ImageToImage(ctx context.Context, req GenImageToImageMultipartRequestBody) (*ImageResponse, error)
- func (w *Worker) ImageToText(ctx context.Context, req GenImageToTextMultipartRequestBody) (*ImageToTextResponse, error)
- func (w *Worker) ImageToVideo(ctx context.Context, req GenImageToVideoMultipartRequestBody) (*VideoResponse, error)
- func (w *Worker) LLM(ctx context.Context, req GenLLMFormdataRequestBody) (interface{}, error)
- func (w *Worker) SegmentAnything2(ctx context.Context, req GenSegmentAnything2MultipartRequestBody) (*MasksResponse, error)
- func (w *Worker) Stop(ctx context.Context) error
- func (w *Worker) TextToImage(ctx context.Context, req GenTextToImageJSONRequestBody) (*ImageResponse, error)
- func (w *Worker) Upscale(ctx context.Context, req GenUpscaleMultipartRequestBody) (*ImageResponse, error)
- func (w *Worker) Warm(ctx context.Context, pipeline string, modelID string, endpoint RunnerEndpoint, ...) error
Constants ¶
const (
HTTPBearerScopes = "HTTPBearer.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func NewGenAudioToTextRequestWithBody ¶ added in v0.3.0
func NewGenAudioToTextRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenAudioToTextRequestWithBody generates requests for GenAudioToText with any type of body
func NewGenImageToImageRequestWithBody ¶ added in v0.3.0
func NewGenImageToImageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenImageToImageRequestWithBody generates requests for GenImageToImage with any type of body
func NewGenImageToTextRequestWithBody ¶ added in v0.8.0
func NewGenImageToTextRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenImageToTextRequestWithBody generates requests for GenImageToText with any type of body
func NewGenImageToVideoRequestWithBody ¶ added in v0.3.0
func NewGenImageToVideoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenImageToVideoRequestWithBody generates requests for GenImageToVideo with any type of body
func NewGenLLMRequestWithBody ¶ added in v0.7.0
func NewGenLLMRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenLLMRequestWithBody generates requests for GenLLM with any type of body
func NewGenLLMRequestWithFormdataBody ¶ added in v0.7.0
func NewGenLLMRequestWithFormdataBody(server string, body GenLLMFormdataRequestBody) (*http.Request, error)
NewGenLLMRequestWithFormdataBody calls the generic GenLLM builder with application/x-www-form-urlencoded body
func NewGenSegmentAnything2RequestWithBody ¶ added in v0.3.0
func NewGenSegmentAnything2RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenSegmentAnything2RequestWithBody generates requests for GenSegmentAnything2 with any type of body
func NewGenTextToImageRequest ¶ added in v0.3.0
func NewGenTextToImageRequest(server string, body GenTextToImageJSONRequestBody) (*http.Request, error)
NewGenTextToImageRequest calls the generic GenTextToImage builder with application/json body
func NewGenTextToImageRequestWithBody ¶ added in v0.3.0
func NewGenTextToImageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenTextToImageRequestWithBody generates requests for GenTextToImage with any type of body
func NewGenUpscaleRequestWithBody ¶ added in v0.3.0
func NewGenUpscaleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGenUpscaleRequestWithBody generates requests for GenUpscale with any type of body
func NewHealthRequest ¶
NewHealthRequest generates requests for Health
func NewImageToTextMultipartWriter ¶ added in v0.8.0
func NewLLMMultipartWriter ¶ added in v0.7.0
func NewSegmentAnything2MultipartWriter ¶ added in v0.2.0
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func SaveImageB64DataUrl ¶
Types ¶
type APIError ¶
type APIError struct {
// Msg The error message.
Msg string `json:"msg"`
}
APIError API error response model.
type BodyGenAudioToText ¶ added in v0.3.0
type BodyGenAudioToText struct {
// Audio Uploaded audio file to be transcribed.
Audio openapi_types.File `json:"audio"`
// ModelId Hugging Face model ID used for transcription.
ModelId *string `json:"model_id,omitempty"`
// ReturnTimestamps Return timestamps for the transcribed text. Supported values: 'sentence', 'word', or a boolean. Default is True ('sentence'). False means no timestamps. 'word' means word-based timestamps.
ReturnTimestamps *BodyGenAudioToText_ReturnTimestamps `json:"return_timestamps,omitempty"`
}
BodyGenAudioToText defines model for Body_genAudioToText.
type BodyGenAudioToTextReturnTimestamps0 ¶ added in v0.9.1
type BodyGenAudioToTextReturnTimestamps0 = string
BodyGenAudioToTextReturnTimestamps0 defines model for .
type BodyGenAudioToTextReturnTimestamps1 ¶ added in v0.9.1
type BodyGenAudioToTextReturnTimestamps1 = bool
BodyGenAudioToTextReturnTimestamps1 defines model for .
type BodyGenAudioToText_ReturnTimestamps ¶ added in v0.9.1
type BodyGenAudioToText_ReturnTimestamps struct {
// contains filtered or unexported fields
}
BodyGenAudioToText_ReturnTimestamps Return timestamps for the transcribed text. Supported values: 'sentence', 'word', or a boolean. Default is True ('sentence'). False means no timestamps. 'word' means word-based timestamps.
func (BodyGenAudioToText_ReturnTimestamps) AsBodyGenAudioToTextReturnTimestamps0 ¶ added in v0.9.1
func (t BodyGenAudioToText_ReturnTimestamps) AsBodyGenAudioToTextReturnTimestamps0() (BodyGenAudioToTextReturnTimestamps0, error)
AsBodyGenAudioToTextReturnTimestamps0 returns the union data inside the BodyGenAudioToText_ReturnTimestamps as a BodyGenAudioToTextReturnTimestamps0
func (BodyGenAudioToText_ReturnTimestamps) AsBodyGenAudioToTextReturnTimestamps1 ¶ added in v0.9.1
func (t BodyGenAudioToText_ReturnTimestamps) AsBodyGenAudioToTextReturnTimestamps1() (BodyGenAudioToTextReturnTimestamps1, error)
AsBodyGenAudioToTextReturnTimestamps1 returns the union data inside the BodyGenAudioToText_ReturnTimestamps as a BodyGenAudioToTextReturnTimestamps1
func (*BodyGenAudioToText_ReturnTimestamps) FromBodyGenAudioToTextReturnTimestamps0 ¶ added in v0.9.1
func (t *BodyGenAudioToText_ReturnTimestamps) FromBodyGenAudioToTextReturnTimestamps0(v BodyGenAudioToTextReturnTimestamps0) error
FromBodyGenAudioToTextReturnTimestamps0 overwrites any union data inside the BodyGenAudioToText_ReturnTimestamps as the provided BodyGenAudioToTextReturnTimestamps0
func (*BodyGenAudioToText_ReturnTimestamps) FromBodyGenAudioToTextReturnTimestamps1 ¶ added in v0.9.1
func (t *BodyGenAudioToText_ReturnTimestamps) FromBodyGenAudioToTextReturnTimestamps1(v BodyGenAudioToTextReturnTimestamps1) error
FromBodyGenAudioToTextReturnTimestamps1 overwrites any union data inside the BodyGenAudioToText_ReturnTimestamps as the provided BodyGenAudioToTextReturnTimestamps1
func (BodyGenAudioToText_ReturnTimestamps) MarshalJSON ¶ added in v0.9.1
func (t BodyGenAudioToText_ReturnTimestamps) MarshalJSON() ([]byte, error)
func (*BodyGenAudioToText_ReturnTimestamps) MergeBodyGenAudioToTextReturnTimestamps0 ¶ added in v0.9.1
func (t *BodyGenAudioToText_ReturnTimestamps) MergeBodyGenAudioToTextReturnTimestamps0(v BodyGenAudioToTextReturnTimestamps0) error
MergeBodyGenAudioToTextReturnTimestamps0 performs a merge with any union data inside the BodyGenAudioToText_ReturnTimestamps, using the provided BodyGenAudioToTextReturnTimestamps0
func (*BodyGenAudioToText_ReturnTimestamps) MergeBodyGenAudioToTextReturnTimestamps1 ¶ added in v0.9.1
func (t *BodyGenAudioToText_ReturnTimestamps) MergeBodyGenAudioToTextReturnTimestamps1(v BodyGenAudioToTextReturnTimestamps1) error
MergeBodyGenAudioToTextReturnTimestamps1 performs a merge with any union data inside the BodyGenAudioToText_ReturnTimestamps, using the provided BodyGenAudioToTextReturnTimestamps1
func (*BodyGenAudioToText_ReturnTimestamps) UnmarshalJSON ¶ added in v0.9.1
func (t *BodyGenAudioToText_ReturnTimestamps) UnmarshalJSON(b []byte) error
type BodyGenImageToImage ¶ added in v0.3.0
type BodyGenImageToImage struct {
// GuidanceScale Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality).
GuidanceScale *float32 `json:"guidance_scale,omitempty"`
// Image Uploaded image to modify with the pipeline.
Image openapi_types.File `json:"image"`
// ImageGuidanceScale Degree to which the generated image is pushed towards the initial image.
ImageGuidanceScale *float32 `json:"image_guidance_scale,omitempty"`
// Loras A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}.
Loras *string `json:"loras,omitempty"`
// ModelId Hugging Face model ID used for image generation.
ModelId *string `json:"model_id,omitempty"`
// NegativePrompt Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1.
NegativePrompt *string `json:"negative_prompt,omitempty"`
// NumImagesPerPrompt Number of images to generate per prompt.
NumImagesPerPrompt *int `json:"num_images_per_prompt,omitempty"`
// NumInferenceSteps Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength.
NumInferenceSteps *int `json:"num_inference_steps,omitempty"`
// Prompt Text prompt(s) to guide image generation.
Prompt string `json:"prompt"`
// SafetyCheck Perform a safety check to estimate if generated images could be offensive or harmful.
SafetyCheck *bool `json:"safety_check,omitempty"`
// Seed Seed for random number generation.
Seed *int `json:"seed,omitempty"`
// Strength Degree of transformation applied to the reference image (0 to 1).
Strength *float32 `json:"strength,omitempty"`
}
BodyGenImageToImage defines model for Body_genImageToImage.
type BodyGenImageToText ¶ added in v0.8.0
type BodyGenImageToText struct {
// Image Uploaded image to transform with the pipeline.
Image openapi_types.File `json:"image"`
// ModelId Hugging Face model ID used for transformation.
ModelId *string `json:"model_id,omitempty"`
// Prompt Text prompt(s) to guide transformation.
Prompt *string `json:"prompt,omitempty"`
}
BodyGenImageToText defines model for Body_genImageToText.
type BodyGenImageToVideo ¶ added in v0.3.0
type BodyGenImageToVideo struct {
// Fps The frames per second of the generated video.
Fps *int `json:"fps,omitempty"`
// Height The height in pixels of the generated video.
Height *int `json:"height,omitempty"`
// Image Uploaded image to generate a video from.
Image openapi_types.File `json:"image"`
// ModelId Hugging Face model ID used for video generation.
ModelId *string `json:"model_id,omitempty"`
// MotionBucketId Used for conditioning the amount of motion for the generation. The higher the number the more motion will be in the video.
MotionBucketId *int `json:"motion_bucket_id,omitempty"`
// NoiseAugStrength Amount of noise added to the conditioning image. Higher values reduce resemblance to the conditioning image and increase motion.
NoiseAugStrength *float32 `json:"noise_aug_strength,omitempty"`
// NumInferenceSteps Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength.
NumInferenceSteps *int `json:"num_inference_steps,omitempty"`
// SafetyCheck Perform a safety check to estimate if generated images could be offensive or harmful.
SafetyCheck *bool `json:"safety_check,omitempty"`
// Seed Seed for random number generation.
Seed *int `json:"seed,omitempty"`
// Width The width in pixels of the generated video.
Width *int `json:"width,omitempty"`
}
BodyGenImageToVideo defines model for Body_genImageToVideo.
type BodyGenLLM ¶ added in v0.7.0
type BodyGenLLM struct {
History *string `json:"history,omitempty"`
MaxTokens *int `json:"max_tokens,omitempty"`
ModelId *string `json:"model_id,omitempty"`
Prompt string `json:"prompt"`
Stream *bool `json:"stream,omitempty"`
SystemMsg *string `json:"system_msg,omitempty"`
Temperature *float32 `json:"temperature,omitempty"`
}
BodyGenLLM defines model for Body_genLLM.
type BodyGenSegmentAnything2 ¶ added in v0.3.0
type BodyGenSegmentAnything2 struct {
// Box A length 4 array given as a box prompt to the model, in XYXY format.
Box *string `json:"box,omitempty"`
// Image Image to segment.
Image openapi_types.File `json:"image"`
// MaskInput A low-resolution mask input to the model, typically from a previous prediction iteration, with the form 1xHxW (H=W=256 for SAM).
MaskInput *string `json:"mask_input,omitempty"`
// ModelId Hugging Face model ID used for image generation.
ModelId *string `json:"model_id,omitempty"`
// MultimaskOutput If true, the model will return three masks for ambiguous input prompts, often producing better masks than a single prediction.
MultimaskOutput *bool `json:"multimask_output,omitempty"`
// NormalizeCoords If true, the point coordinates will be normalized to the range [0,1], with point_coords expected to be with respect to image dimensions.
NormalizeCoords *bool `json:"normalize_coords,omitempty"`
// PointCoords Nx2 array of point prompts to the model, where each point is in (X,Y) in pixels.
PointCoords *string `json:"point_coords,omitempty"`
// PointLabels Labels for the point prompts, where 1 indicates a foreground point and 0 indicates a background point.
PointLabels *string `json:"point_labels,omitempty"`
// ReturnLogits If true, returns un-thresholded mask logits instead of a binary mask.
ReturnLogits *bool `json:"return_logits,omitempty"`
}
BodyGenSegmentAnything2 defines model for Body_genSegmentAnything2.
type BodyGenUpscale ¶ added in v0.3.0
type BodyGenUpscale struct {
// Image Uploaded image to modify with the pipeline.
Image openapi_types.File `json:"image"`
// ModelId Hugging Face model ID used for upscaled image generation.
ModelId *string `json:"model_id,omitempty"`
// NumInferenceSteps Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength.
NumInferenceSteps *int `json:"num_inference_steps,omitempty"`
// Prompt Text prompt(s) to guide upscaled image generation.
Prompt string `json:"prompt"`
// SafetyCheck Perform a safety check to estimate if generated images could be offensive or harmful.
SafetyCheck *bool `json:"safety_check,omitempty"`
// Seed Seed for random number generation.
Seed *int `json:"seed,omitempty"`
}
BodyGenUpscale defines model for Body_genUpscale.
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type Chunk ¶
type Chunk struct {
// Text The text of the chunk.
Text string `json:"text"`
// Timestamp The timestamp of the chunk.
Timestamp []interface{} `json:"timestamp"`
}
Chunk A chunk of text with a timestamp.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GenAudioToTextWithBody ¶ added in v0.3.0
func (*Client) GenImageToImageWithBody ¶ added in v0.3.0
func (*Client) GenImageToTextWithBody ¶ added in v0.8.0
func (*Client) GenImageToVideoWithBody ¶ added in v0.3.0
func (*Client) GenLLMWithBody ¶ added in v0.7.0
func (*Client) GenLLMWithFormdataBody ¶ added in v0.7.0
func (c *Client) GenLLMWithFormdataBody(ctx context.Context, body GenLLMFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GenSegmentAnything2WithBody ¶ added in v0.3.0
func (*Client) GenTextToImage ¶ added in v0.3.0
func (c *Client) GenTextToImage(ctx context.Context, body GenTextToImageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GenTextToImageWithBody ¶ added in v0.3.0
func (*Client) GenUpscaleWithBody ¶ added in v0.3.0
type ClientInterface ¶
type ClientInterface interface {
// GenAudioToTextWithBody request with any body
GenAudioToTextWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// Health request
Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenImageToImageWithBody request with any body
GenImageToImageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenImageToTextWithBody request with any body
GenImageToTextWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenImageToVideoWithBody request with any body
GenImageToVideoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenLLMWithBody request with any body
GenLLMWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
GenLLMWithFormdataBody(ctx context.Context, body GenLLMFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenSegmentAnything2WithBody request with any body
GenSegmentAnything2WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenTextToImageWithBody request with any body
GenTextToImageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
GenTextToImage(ctx context.Context, body GenTextToImageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GenUpscaleWithBody request with any body
GenUpscaleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GenAudioToTextWithBodyWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenAudioToTextWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenAudioToTextResponse, error)
GenAudioToTextWithBodyWithResponse request with arbitrary body returning *GenAudioToTextResponse
func (*ClientWithResponses) GenImageToImageWithBodyWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenImageToImageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenImageToImageResponse, error)
GenImageToImageWithBodyWithResponse request with arbitrary body returning *GenImageToImageResponse
func (*ClientWithResponses) GenImageToTextWithBodyWithResponse ¶ added in v0.8.0
func (c *ClientWithResponses) GenImageToTextWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenImageToTextResponse, error)
GenImageToTextWithBodyWithResponse request with arbitrary body returning *GenImageToTextResponse
func (*ClientWithResponses) GenImageToVideoWithBodyWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenImageToVideoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenImageToVideoResponse, error)
GenImageToVideoWithBodyWithResponse request with arbitrary body returning *GenImageToVideoResponse
func (*ClientWithResponses) GenLLMWithBodyWithResponse ¶ added in v0.7.0
func (c *ClientWithResponses) GenLLMWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenLLMResponse, error)
GenLLMWithBodyWithResponse request with arbitrary body returning *GenLLMResponse
func (*ClientWithResponses) GenLLMWithFormdataBodyWithResponse ¶ added in v0.7.0
func (c *ClientWithResponses) GenLLMWithFormdataBodyWithResponse(ctx context.Context, body GenLLMFormdataRequestBody, reqEditors ...RequestEditorFn) (*GenLLMResponse, error)
func (*ClientWithResponses) GenSegmentAnything2WithBodyWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenSegmentAnything2WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenSegmentAnything2Response, error)
GenSegmentAnything2WithBodyWithResponse request with arbitrary body returning *GenSegmentAnything2Response
func (*ClientWithResponses) GenTextToImageWithBodyWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenTextToImageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenTextToImageResponse, error)
GenTextToImageWithBodyWithResponse request with arbitrary body returning *GenTextToImageResponse
func (*ClientWithResponses) GenTextToImageWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenTextToImageWithResponse(ctx context.Context, body GenTextToImageJSONRequestBody, reqEditors ...RequestEditorFn) (*GenTextToImageResponse, error)
func (*ClientWithResponses) GenUpscaleWithBodyWithResponse ¶ added in v0.3.0
func (c *ClientWithResponses) GenUpscaleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenUpscaleResponse, error)
GenUpscaleWithBodyWithResponse request with arbitrary body returning *GenUpscaleResponse
func (*ClientWithResponses) HealthWithResponse ¶
func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
HealthWithResponse request returning *HealthResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GenAudioToTextWithBodyWithResponse request with any body
GenAudioToTextWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenAudioToTextResponse, error)
// HealthWithResponse request
HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
// GenImageToImageWithBodyWithResponse request with any body
GenImageToImageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenImageToImageResponse, error)
// GenImageToTextWithBodyWithResponse request with any body
GenImageToTextWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenImageToTextResponse, error)
// GenImageToVideoWithBodyWithResponse request with any body
GenImageToVideoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenImageToVideoResponse, error)
// GenLLMWithBodyWithResponse request with any body
GenLLMWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenLLMResponse, error)
GenLLMWithFormdataBodyWithResponse(ctx context.Context, body GenLLMFormdataRequestBody, reqEditors ...RequestEditorFn) (*GenLLMResponse, error)
// GenSegmentAnything2WithBodyWithResponse request with any body
GenSegmentAnything2WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenSegmentAnything2Response, error)
// GenTextToImageWithBodyWithResponse request with any body
GenTextToImageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenTextToImageResponse, error)
GenTextToImageWithResponse(ctx context.Context, body GenTextToImageJSONRequestBody, reqEditors ...RequestEditorFn) (*GenTextToImageResponse, error)
// GenUpscaleWithBodyWithResponse request with any body
GenUpscaleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GenUpscaleResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type DockerManager ¶
type DockerManager struct {
// contains filtered or unexported fields
}
func NewDockerManager ¶
func NewDockerManager(defaultImage string, gpus []string, modelDir string) (*DockerManager, error)
func (*DockerManager) Borrow ¶
func (m *DockerManager) Borrow(ctx context.Context, pipeline, modelID string) (*RunnerContainer, error)
func (*DockerManager) HasCapacity ¶
func (m *DockerManager) HasCapacity(ctx context.Context, pipeline, modelID string) bool
HasCapacity checks if an unused managed container exists or if a GPU is available for a new container.
func (*DockerManager) Return ¶
func (m *DockerManager) Return(rc *RunnerContainer)
func (*DockerManager) Warm ¶
func (m *DockerManager) Warm(ctx context.Context, pipeline string, modelID string, optimizationFlags OptimizationFlags) error
type EnvValue ¶
type EnvValue string
EnvValue unmarshals JSON booleans as strings for compatibility with env variables.
func (*EnvValue) UnmarshalJSON ¶
UnmarshalJSON converts JSON booleans to strings for EnvValue.
type GenAudioToTextMultipartRequestBody ¶ added in v0.3.0
type GenAudioToTextMultipartRequestBody = BodyGenAudioToText
GenAudioToTextMultipartRequestBody defines body for GenAudioToText for multipart/form-data ContentType.
type GenAudioToTextResponse ¶ added in v0.3.0
type GenAudioToTextResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TextResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON413 *HTTPError
JSON415 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenAudioToTextResponse ¶ added in v0.3.0
func ParseGenAudioToTextResponse(rsp *http.Response) (*GenAudioToTextResponse, error)
ParseGenAudioToTextResponse parses an HTTP response from a GenAudioToTextWithResponse call
func (GenAudioToTextResponse) Status ¶ added in v0.3.0
func (r GenAudioToTextResponse) Status() string
Status returns HTTPResponse.Status
func (GenAudioToTextResponse) StatusCode ¶ added in v0.3.0
func (r GenAudioToTextResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenImageToImageMultipartRequestBody ¶ added in v0.3.0
type GenImageToImageMultipartRequestBody = BodyGenImageToImage
GenImageToImageMultipartRequestBody defines body for GenImageToImage for multipart/form-data ContentType.
type GenImageToImageResponse ¶ added in v0.3.0
type GenImageToImageResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ImageResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenImageToImageResponse ¶ added in v0.3.0
func ParseGenImageToImageResponse(rsp *http.Response) (*GenImageToImageResponse, error)
ParseGenImageToImageResponse parses an HTTP response from a GenImageToImageWithResponse call
func (GenImageToImageResponse) Status ¶ added in v0.3.0
func (r GenImageToImageResponse) Status() string
Status returns HTTPResponse.Status
func (GenImageToImageResponse) StatusCode ¶ added in v0.3.0
func (r GenImageToImageResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenImageToTextMultipartRequestBody ¶ added in v0.8.0
type GenImageToTextMultipartRequestBody = BodyGenImageToText
GenImageToTextMultipartRequestBody defines body for GenImageToText for multipart/form-data ContentType.
type GenImageToTextResponse ¶ added in v0.8.0
type GenImageToTextResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ImageToTextResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON413 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenImageToTextResponse ¶ added in v0.8.0
func ParseGenImageToTextResponse(rsp *http.Response) (*GenImageToTextResponse, error)
ParseGenImageToTextResponse parses an HTTP response from a GenImageToTextWithResponse call
func (GenImageToTextResponse) Status ¶ added in v0.8.0
func (r GenImageToTextResponse) Status() string
Status returns HTTPResponse.Status
func (GenImageToTextResponse) StatusCode ¶ added in v0.8.0
func (r GenImageToTextResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenImageToVideoMultipartRequestBody ¶ added in v0.3.0
type GenImageToVideoMultipartRequestBody = BodyGenImageToVideo
GenImageToVideoMultipartRequestBody defines body for GenImageToVideo for multipart/form-data ContentType.
type GenImageToVideoResponse ¶ added in v0.3.0
type GenImageToVideoResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *VideoResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenImageToVideoResponse ¶ added in v0.3.0
func ParseGenImageToVideoResponse(rsp *http.Response) (*GenImageToVideoResponse, error)
ParseGenImageToVideoResponse parses an HTTP response from a GenImageToVideoWithResponse call
func (GenImageToVideoResponse) Status ¶ added in v0.3.0
func (r GenImageToVideoResponse) Status() string
Status returns HTTPResponse.Status
func (GenImageToVideoResponse) StatusCode ¶ added in v0.3.0
func (r GenImageToVideoResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenLLMFormdataRequestBody ¶ added in v0.7.0
type GenLLMFormdataRequestBody = BodyGenLLM
GenLLMFormdataRequestBody defines body for GenLLM for application/x-www-form-urlencoded ContentType.
type GenLLMResponse ¶ added in v0.7.0
type GenLLMResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *LLMResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenLLMResponse ¶ added in v0.7.0
func ParseGenLLMResponse(rsp *http.Response) (*GenLLMResponse, error)
ParseGenLLMResponse parses an HTTP response from a GenLLMWithResponse call
func (GenLLMResponse) Status ¶ added in v0.7.0
func (r GenLLMResponse) Status() string
Status returns HTTPResponse.Status
func (GenLLMResponse) StatusCode ¶ added in v0.7.0
func (r GenLLMResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenSegmentAnything2MultipartRequestBody ¶ added in v0.3.0
type GenSegmentAnything2MultipartRequestBody = BodyGenSegmentAnything2
GenSegmentAnything2MultipartRequestBody defines body for GenSegmentAnything2 for multipart/form-data ContentType.
type GenSegmentAnything2Response ¶ added in v0.3.0
type GenSegmentAnything2Response struct {
Body []byte
HTTPResponse *http.Response
JSON200 *MasksResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenSegmentAnything2Response ¶ added in v0.3.0
func ParseGenSegmentAnything2Response(rsp *http.Response) (*GenSegmentAnything2Response, error)
ParseGenSegmentAnything2Response parses an HTTP response from a GenSegmentAnything2WithResponse call
func (GenSegmentAnything2Response) Status ¶ added in v0.3.0
func (r GenSegmentAnything2Response) Status() string
Status returns HTTPResponse.Status
func (GenSegmentAnything2Response) StatusCode ¶ added in v0.3.0
func (r GenSegmentAnything2Response) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenTextToImageJSONRequestBody ¶ added in v0.3.0
type GenTextToImageJSONRequestBody = TextToImageParams
GenTextToImageJSONRequestBody defines body for GenTextToImage for application/json ContentType.
type GenTextToImageResponse ¶ added in v0.3.0
type GenTextToImageResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ImageResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenTextToImageResponse ¶ added in v0.3.0
func ParseGenTextToImageResponse(rsp *http.Response) (*GenTextToImageResponse, error)
ParseGenTextToImageResponse parses an HTTP response from a GenTextToImageWithResponse call
func (GenTextToImageResponse) Status ¶ added in v0.3.0
func (r GenTextToImageResponse) Status() string
Status returns HTTPResponse.Status
func (GenTextToImageResponse) StatusCode ¶ added in v0.3.0
func (r GenTextToImageResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GenUpscaleMultipartRequestBody ¶ added in v0.3.0
type GenUpscaleMultipartRequestBody = BodyGenUpscale
GenUpscaleMultipartRequestBody defines body for GenUpscale for multipart/form-data ContentType.
type GenUpscaleResponse ¶ added in v0.3.0
type GenUpscaleResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ImageResponse
JSON400 *HTTPError
JSON401 *HTTPError
JSON422 *HTTPValidationError
JSON500 *HTTPError
}
func ParseGenUpscaleResponse ¶ added in v0.3.0
func ParseGenUpscaleResponse(rsp *http.Response) (*GenUpscaleResponse, error)
ParseGenUpscaleResponse parses an HTTP response from a GenUpscaleWithResponse call
func (GenUpscaleResponse) Status ¶ added in v0.3.0
func (r GenUpscaleResponse) Status() string
Status returns HTTPResponse.Status
func (GenUpscaleResponse) StatusCode ¶ added in v0.3.0
func (r GenUpscaleResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HTTPError ¶
type HTTPError struct {
// Detail Detailed error information.
Detail APIError `json:"detail"`
}
HTTPError HTTP error response model.
type HTTPValidationError ¶
type HTTPValidationError struct {
Detail *[]ValidationError `json:"detail,omitempty"`
}
HTTPValidationError defines model for HTTPValidationError.
type HealthCheck ¶
type HealthCheck struct {
Status *string `json:"status,omitempty"`
}
HealthCheck defines model for HealthCheck.
type HealthResponse ¶
type HealthResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *HealthCheck
}
func ParseHealthResponse ¶
func ParseHealthResponse(rsp *http.Response) (*HealthResponse, error)
ParseHealthResponse parses an HTTP response from a HealthWithResponse call
func (HealthResponse) Status ¶
func (r HealthResponse) Status() string
Status returns HTTPResponse.Status
func (HealthResponse) StatusCode ¶
func (r HealthResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ImageResponse ¶
type ImageResponse struct {
// Images The generated images.
Images []Media `json:"images"`
}
ImageResponse Response model for image generation.
type ImageToTextResponse ¶ added in v0.8.0
type ImageToTextResponse struct {
// Text The generated text.
Text string `json:"text"`
}
ImageToTextResponse Response model for text generation.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type LLMResponse ¶ added in v0.7.0
LLMResponse defines model for LLMResponse.
type LlmStreamChunk ¶ added in v0.7.0
type MasksResponse ¶ added in v0.2.0
type MasksResponse struct {
// Logits The raw, unnormalized predictions (logits) for the masks.
Logits string `json:"logits"`
// Masks The generated masks.
Masks string `json:"masks"`
// Scores The model's confidence scores for each generated mask.
Scores string `json:"scores"`
}
MasksResponse Response model for object segmentation.
type Media ¶
type Media struct {
// Nsfw Whether the media was flagged as NSFW.
Nsfw bool `json:"nsfw"`
// Seed The seed used to generate the media.
Seed int `json:"seed"`
// Url The URL where the media can be accessed.
Url string `json:"url"`
}
Media A media object containing information about the generated media.
type OptimizationFlags ¶
OptimizationFlags is a map of optimization flags to be passed to the pipeline.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type RunnerContainer ¶
type RunnerContainer struct {
RunnerContainerConfig
Name string
Client *ClientWithResponses
}
func NewRunnerContainer ¶
func NewRunnerContainer(ctx context.Context, cfg RunnerContainerConfig, name string) (*RunnerContainer, error)
type RunnerContainerConfig ¶
type RunnerContainerConfig struct {
Type RunnerContainerType
Pipeline string
ModelID string
Endpoint RunnerEndpoint
ContainerImageID string
// For managed containers only
ID string
GPU string
KeepWarm bool
// contains filtered or unexported fields
}
type RunnerContainerType ¶
type RunnerContainerType int
const ( Managed RunnerContainerType = iota External )
type RunnerEndpoint ¶
type ServerInterface ¶
type ServerInterface interface {
// Audio To Text
// (POST /audio-to-text)
GenAudioToText(w http.ResponseWriter, r *http.Request)
// Health
// (GET /health)
Health(w http.ResponseWriter, r *http.Request)
// Image To Image
// (POST /image-to-image)
GenImageToImage(w http.ResponseWriter, r *http.Request)
// Image To Text
// (POST /image-to-text)
GenImageToText(w http.ResponseWriter, r *http.Request)
// Image To Video
// (POST /image-to-video)
GenImageToVideo(w http.ResponseWriter, r *http.Request)
// LLM
// (POST /llm)
GenLLM(w http.ResponseWriter, r *http.Request)
// Segment Anything 2
// (POST /segment-anything-2)
GenSegmentAnything2(w http.ResponseWriter, r *http.Request)
// Text To Image
// (POST /text-to-image)
GenTextToImage(w http.ResponseWriter, r *http.Request)
// Upscale
// (POST /upscale)
GenUpscale(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GenAudioToText ¶ added in v0.3.0
func (siw *ServerInterfaceWrapper) GenAudioToText(w http.ResponseWriter, r *http.Request)
GenAudioToText operation middleware
func (*ServerInterfaceWrapper) GenImageToImage ¶ added in v0.3.0
func (siw *ServerInterfaceWrapper) GenImageToImage(w http.ResponseWriter, r *http.Request)
GenImageToImage operation middleware
func (*ServerInterfaceWrapper) GenImageToText ¶ added in v0.8.0
func (siw *ServerInterfaceWrapper) GenImageToText(w http.ResponseWriter, r *http.Request)
GenImageToText operation middleware
func (*ServerInterfaceWrapper) GenImageToVideo ¶ added in v0.3.0
func (siw *ServerInterfaceWrapper) GenImageToVideo(w http.ResponseWriter, r *http.Request)
GenImageToVideo operation middleware
func (*ServerInterfaceWrapper) GenLLM ¶ added in v0.7.0
func (siw *ServerInterfaceWrapper) GenLLM(w http.ResponseWriter, r *http.Request)
GenLLM operation middleware
func (*ServerInterfaceWrapper) GenSegmentAnything2 ¶ added in v0.3.0
func (siw *ServerInterfaceWrapper) GenSegmentAnything2(w http.ResponseWriter, r *http.Request)
GenSegmentAnything2 operation middleware
func (*ServerInterfaceWrapper) GenTextToImage ¶ added in v0.3.0
func (siw *ServerInterfaceWrapper) GenTextToImage(w http.ResponseWriter, r *http.Request)
GenTextToImage operation middleware
func (*ServerInterfaceWrapper) GenUpscale ¶ added in v0.3.0
func (siw *ServerInterfaceWrapper) GenUpscale(w http.ResponseWriter, r *http.Request)
GenUpscale operation middleware
func (*ServerInterfaceWrapper) Health ¶
func (siw *ServerInterfaceWrapper) Health(w http.ResponseWriter, r *http.Request)
Health operation middleware
type TextResponse ¶
type TextResponse struct {
// Chunks The generated text chunks.
Chunks []Chunk `json:"chunks"`
// Text The generated text.
Text string `json:"text"`
}
TextResponse Response model for text generation.
type TextToImageParams ¶
type TextToImageParams struct {
// GuidanceScale Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality).
GuidanceScale *float32 `json:"guidance_scale,omitempty"`
// Height The height in pixels of the generated image.
Height *int `json:"height,omitempty"`
// Loras A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}.
Loras *string `json:"loras,omitempty"`
// ModelId Hugging Face model ID used for image generation.
ModelId *string `json:"model_id,omitempty"`
// NegativePrompt Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1.
NegativePrompt *string `json:"negative_prompt,omitempty"`
// NumImagesPerPrompt Number of images to generate per prompt.
NumImagesPerPrompt *int `json:"num_images_per_prompt,omitempty"`
// NumInferenceSteps Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength.
NumInferenceSteps *int `json:"num_inference_steps,omitempty"`
// Prompt Text prompt(s) to guide image generation. Separate multiple prompts with '|' if supported by the model.
Prompt string `json:"prompt"`
// SafetyCheck Perform a safety check to estimate if generated images could be offensive or harmful.
SafetyCheck *bool `json:"safety_check,omitempty"`
// Seed Seed for random number generation.
Seed *int `json:"seed,omitempty"`
// Width The width in pixels of the generated image.
Width *int `json:"width,omitempty"`
}
TextToImageParams defines model for TextToImageParams.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) GenAudioToText ¶ added in v0.3.0
func (_ Unimplemented) GenAudioToText(w http.ResponseWriter, r *http.Request)
Audio To Text (POST /audio-to-text)
func (Unimplemented) GenImageToImage ¶ added in v0.3.0
func (_ Unimplemented) GenImageToImage(w http.ResponseWriter, r *http.Request)
Image To Image (POST /image-to-image)
func (Unimplemented) GenImageToText ¶ added in v0.8.0
func (_ Unimplemented) GenImageToText(w http.ResponseWriter, r *http.Request)
Image To Text (POST /image-to-text)
func (Unimplemented) GenImageToVideo ¶ added in v0.3.0
func (_ Unimplemented) GenImageToVideo(w http.ResponseWriter, r *http.Request)
Image To Video (POST /image-to-video)
func (Unimplemented) GenLLM ¶ added in v0.7.0
func (_ Unimplemented) GenLLM(w http.ResponseWriter, r *http.Request)
LLM (POST /llm)
func (Unimplemented) GenSegmentAnything2 ¶ added in v0.3.0
func (_ Unimplemented) GenSegmentAnything2(w http.ResponseWriter, r *http.Request)
Segment Anything 2 (POST /segment-anything-2)
func (Unimplemented) GenTextToImage ¶ added in v0.3.0
func (_ Unimplemented) GenTextToImage(w http.ResponseWriter, r *http.Request)
Text To Image (POST /text-to-image)
func (Unimplemented) GenUpscale ¶ added in v0.3.0
func (_ Unimplemented) GenUpscale(w http.ResponseWriter, r *http.Request)
Upscale (POST /upscale)
func (Unimplemented) Health ¶
func (_ Unimplemented) Health(w http.ResponseWriter, r *http.Request)
Health (GET /health)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type ValidationError ¶
type ValidationError struct {
Loc []ValidationError_Loc_Item `json:"loc"`
Msg string `json:"msg"`
Type string `json:"type"`
}
ValidationError defines model for ValidationError.
type ValidationErrorLoc0 ¶
type ValidationErrorLoc0 = string
ValidationErrorLoc0 defines model for .
type ValidationError_Loc_Item ¶
type ValidationError_Loc_Item struct {
// contains filtered or unexported fields
}
ValidationError_Loc_Item defines model for ValidationError.loc.Item.
func (ValidationError_Loc_Item) AsValidationErrorLoc0 ¶
func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error)
AsValidationErrorLoc0 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc0
func (ValidationError_Loc_Item) AsValidationErrorLoc1 ¶
func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error)
AsValidationErrorLoc1 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc1
func (*ValidationError_Loc_Item) FromValidationErrorLoc0 ¶
func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error
FromValidationErrorLoc0 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc0
func (*ValidationError_Loc_Item) FromValidationErrorLoc1 ¶
func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error
FromValidationErrorLoc1 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc1
func (ValidationError_Loc_Item) MarshalJSON ¶
func (t ValidationError_Loc_Item) MarshalJSON() ([]byte, error)
func (*ValidationError_Loc_Item) MergeValidationErrorLoc0 ¶
func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error
MergeValidationErrorLoc0 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc0
func (*ValidationError_Loc_Item) MergeValidationErrorLoc1 ¶
func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error
MergeValidationErrorLoc1 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc1
func (*ValidationError_Loc_Item) UnmarshalJSON ¶
func (t *ValidationError_Loc_Item) UnmarshalJSON(b []byte) error
type VideoResponse ¶
type VideoResponse struct {
// Frames The generated video frames.
Frames [][]Media `json:"frames"`
}
VideoResponse Response model for video generation.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) AudioToText ¶
func (w *Worker) AudioToText(ctx context.Context, req GenAudioToTextMultipartRequestBody) (*TextResponse, error)
func (*Worker) HasCapacity ¶
HasCapacity returns true if the worker has capacity for the given pipeline and model ID.
func (*Worker) ImageToImage ¶
func (w *Worker) ImageToImage(ctx context.Context, req GenImageToImageMultipartRequestBody) (*ImageResponse, error)
func (*Worker) ImageToText ¶ added in v0.8.0
func (w *Worker) ImageToText(ctx context.Context, req GenImageToTextMultipartRequestBody) (*ImageToTextResponse, error)
func (*Worker) ImageToVideo ¶
func (w *Worker) ImageToVideo(ctx context.Context, req GenImageToVideoMultipartRequestBody) (*VideoResponse, error)
func (*Worker) LLM ¶ added in v0.7.0
func (w *Worker) LLM(ctx context.Context, req GenLLMFormdataRequestBody) (interface{}, error)
func (*Worker) SegmentAnything2 ¶ added in v0.2.0
func (w *Worker) SegmentAnything2(ctx context.Context, req GenSegmentAnything2MultipartRequestBody) (*MasksResponse, error)
func (*Worker) TextToImage ¶
func (w *Worker) TextToImage(ctx context.Context, req GenTextToImageJSONRequestBody) (*ImageResponse, error)
func (*Worker) Upscale ¶
func (w *Worker) Upscale(ctx context.Context, req GenUpscaleMultipartRequestBody) (*ImageResponse, error)
func (*Worker) Warm ¶
func (w *Worker) Warm(ctx context.Context, pipeline string, modelID string, endpoint RunnerEndpoint, optimizationFlags OptimizationFlags) error