sparseembedding

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sparseembedding provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmbedBm25EmbedBm25PostRequest

func NewEmbedBm25EmbedBm25PostRequest(server string, body EmbedBm25EmbedBm25PostJSONRequestBody) (*http.Request, error)

NewEmbedBm25EmbedBm25PostRequest calls the generic EmbedBm25EmbedBm25Post builder with application/json body

func NewEmbedBm25EmbedBm25PostRequestWithBody

func NewEmbedBm25EmbedBm25PostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewEmbedBm25EmbedBm25PostRequestWithBody generates requests for EmbedBm25EmbedBm25Post with any type of body

func NewRootGetRequest

func NewRootGetRequest(server string) (*http.Request, error)

NewRootGetRequest generates requests for RootGet

Types

type BM25EmbedRequest

type BM25EmbedRequest struct {
	AverageWordCount *int `json:"average_word_count,omitempty"`

	// Language Supported languages.
	Language *Language `json:"language,omitempty"`
	Text     string    `json:"text"`
}

BM25EmbedRequest defines model for BM25EmbedRequest.

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) EmbedBm25EmbedBm25Post

func (c *Client) EmbedBm25EmbedBm25Post(ctx context.Context, body EmbedBm25EmbedBm25PostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) EmbedBm25EmbedBm25PostWithBody

func (c *Client) EmbedBm25EmbedBm25PostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RootGet

func (c *Client) RootGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// RootGet request
	RootGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// EmbedBm25EmbedBm25PostWithBody request with any body
	EmbedBm25EmbedBm25PostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	EmbedBm25EmbedBm25Post(ctx context.Context, body EmbedBm25EmbedBm25PostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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) EmbedBm25EmbedBm25PostWithBodyWithResponse

func (c *ClientWithResponses) EmbedBm25EmbedBm25PostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EmbedBm25EmbedBm25PostResponse, error)

EmbedBm25EmbedBm25PostWithBodyWithResponse request with arbitrary body returning *EmbedBm25EmbedBm25PostResponse

func (*ClientWithResponses) EmbedBm25EmbedBm25PostWithResponse

func (c *ClientWithResponses) EmbedBm25EmbedBm25PostWithResponse(ctx context.Context, body EmbedBm25EmbedBm25PostJSONRequestBody, reqEditors ...RequestEditorFn) (*EmbedBm25EmbedBm25PostResponse, error)

func (*ClientWithResponses) RootGetWithResponse

func (c *ClientWithResponses) RootGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RootGetResponse, error)

RootGetWithResponse request returning *RootGetResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// RootGetWithResponse request
	RootGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RootGetResponse, error)

	// EmbedBm25EmbedBm25PostWithBodyWithResponse request with any body
	EmbedBm25EmbedBm25PostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EmbedBm25EmbedBm25PostResponse, error)

	EmbedBm25EmbedBm25PostWithResponse(ctx context.Context, body EmbedBm25EmbedBm25PostJSONRequestBody, reqEditors ...RequestEditorFn) (*EmbedBm25EmbedBm25PostResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type EmbedBm25EmbedBm25PostJSONRequestBody

type EmbedBm25EmbedBm25PostJSONRequestBody = BM25EmbedRequest

EmbedBm25EmbedBm25PostJSONRequestBody defines body for EmbedBm25EmbedBm25Post for application/json ContentType.

type EmbedBm25EmbedBm25PostResponse

type EmbedBm25EmbedBm25PostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SparseEmbedding
	JSON422      *HTTPValidationError
}

func ParseEmbedBm25EmbedBm25PostResponse

func ParseEmbedBm25EmbedBm25PostResponse(rsp *http.Response) (*EmbedBm25EmbedBm25PostResponse, error)

ParseEmbedBm25EmbedBm25PostResponse parses an HTTP response from a EmbedBm25EmbedBm25PostWithResponse call

func (EmbedBm25EmbedBm25PostResponse) Status

Status returns HTTPResponse.Status

func (EmbedBm25EmbedBm25PostResponse) StatusCode

func (r EmbedBm25EmbedBm25PostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPValidationError

type HTTPValidationError struct {
	Detail *[]ValidationError `json:"detail,omitempty"`
}

HTTPValidationError defines model for HTTPValidationError.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Language

type Language string

Language Supported languages.

const (
	Arabic     Language = "arabic"
	Basque     Language = "basque"
	Catalan    Language = "catalan"
	Danish     Language = "danish"
	Dutch      Language = "dutch"
	English    Language = "english"
	Finnish    Language = "finnish"
	French     Language = "french"
	German     Language = "german"
	Greek      Language = "greek"
	Hungarian  Language = "hungarian"
	Indonesian Language = "indonesian"
	Italian    Language = "italian"
	Norwegian  Language = "norwegian"
	Portuguese Language = "portuguese"
	Romanian   Language = "romanian"
	Russian    Language = "russian"
	Spanish    Language = "spanish"
	Swedish    Language = "swedish"
	Turkish    Language = "turkish"
)

Defines values for Language.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RootGetResponse

type RootGetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseRootGetResponse

func ParseRootGetResponse(rsp *http.Response) (*RootGetResponse, error)

ParseRootGetResponse parses an HTTP response from a RootGetWithResponse call

func (RootGetResponse) Status

func (r RootGetResponse) Status() string

Status returns HTTPResponse.Status

func (RootGetResponse) StatusCode

func (r RootGetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SparseEmbedding

type SparseEmbedding struct {
	Indices []int     `json:"indices"`
	Values  []float32 `json:"values"`
}

SparseEmbedding defines model for SparseEmbedding.

type ValidationError

type ValidationError struct {
	Loc  []ValidationErrorLocInner `json:"loc"`
	Msg  string                    `json:"msg"`
	Type string                    `json:"type"`
}

ValidationError defines model for ValidationError.

type ValidationErrorLocInner

type ValidationErrorLocInner struct {
	// contains filtered or unexported fields
}

ValidationErrorLocInner defines model for ValidationError_loc_inner.

func (ValidationErrorLocInner) AsValidationErrorLocInner0

func (t ValidationErrorLocInner) AsValidationErrorLocInner0() (ValidationErrorLocInner0, error)

AsValidationErrorLocInner0 returns the union data inside the ValidationErrorLocInner as a ValidationErrorLocInner0

func (ValidationErrorLocInner) AsValidationErrorLocInner1

func (t ValidationErrorLocInner) AsValidationErrorLocInner1() (ValidationErrorLocInner1, error)

AsValidationErrorLocInner1 returns the union data inside the ValidationErrorLocInner as a ValidationErrorLocInner1

func (*ValidationErrorLocInner) FromValidationErrorLocInner0

func (t *ValidationErrorLocInner) FromValidationErrorLocInner0(v ValidationErrorLocInner0) error

FromValidationErrorLocInner0 overwrites any union data inside the ValidationErrorLocInner as the provided ValidationErrorLocInner0

func (*ValidationErrorLocInner) FromValidationErrorLocInner1

func (t *ValidationErrorLocInner) FromValidationErrorLocInner1(v ValidationErrorLocInner1) error

FromValidationErrorLocInner1 overwrites any union data inside the ValidationErrorLocInner as the provided ValidationErrorLocInner1

func (ValidationErrorLocInner) MarshalJSON

func (t ValidationErrorLocInner) MarshalJSON() ([]byte, error)

func (*ValidationErrorLocInner) MergeValidationErrorLocInner0

func (t *ValidationErrorLocInner) MergeValidationErrorLocInner0(v ValidationErrorLocInner0) error

MergeValidationErrorLocInner0 performs a merge with any union data inside the ValidationErrorLocInner, using the provided ValidationErrorLocInner0

func (*ValidationErrorLocInner) MergeValidationErrorLocInner1

func (t *ValidationErrorLocInner) MergeValidationErrorLocInner1(v ValidationErrorLocInner1) error

MergeValidationErrorLocInner1 performs a merge with any union data inside the ValidationErrorLocInner, using the provided ValidationErrorLocInner1

func (*ValidationErrorLocInner) UnmarshalJSON

func (t *ValidationErrorLocInner) UnmarshalJSON(b []byte) error

type ValidationErrorLocInner0

type ValidationErrorLocInner0 = string

ValidationErrorLocInner0 defines model for .

type ValidationErrorLocInner1

type ValidationErrorLocInner1 = int

ValidationErrorLocInner1 defines model for .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL