Documentation
¶
Overview ¶
Perform chat completion inference
Index ¶
- Variables
- type ChatCompletionUnified
- func (r ChatCompletionUnified) Do(providedCtx context.Context) (Response, error)
- func (r *ChatCompletionUnified) ErrorTrace(errortrace bool) *ChatCompletionUnified
- func (r *ChatCompletionUnified) FilterPath(filterpaths ...string) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Header(key, value string) *ChatCompletionUnified
- func (r *ChatCompletionUnified) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *ChatCompletionUnified) Human(human bool) *ChatCompletionUnified
- func (r *ChatCompletionUnified) MaxCompletionTokens(maxcompletiontokens int64) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Messages(messages ...types.MessageVariant) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Model(model string) *ChatCompletionUnified
- func (r ChatCompletionUnified) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *ChatCompletionUnified) Pretty(pretty bool) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Raw(raw io.Reader) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Request(req *Request) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Stop(stops ...string) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Temperature(temperature float32) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Timeout(duration string) *ChatCompletionUnified
- func (r *ChatCompletionUnified) ToolChoice(completiontooltype types.CompletionToolTypeVariant) *ChatCompletionUnified
- func (r *ChatCompletionUnified) Tools(tools ...types.CompletionToolVariant) *ChatCompletionUnified
- func (r *ChatCompletionUnified) TopP(topp float32) *ChatCompletionUnified
- type NewChatCompletionUnified
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type ChatCompletionUnified ¶
type ChatCompletionUnified struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *ChatCompletionUnified
Perform chat completion inference
https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-unified-inference
func (ChatCompletionUnified) Do ¶
func (r ChatCompletionUnified) Do(providedCtx context.Context) (Response, error)
Do runs the request through the transport, handle the response and returns a chatcompletionunified.Response
func (*ChatCompletionUnified) ErrorTrace ¶
func (r *ChatCompletionUnified) ErrorTrace(errortrace bool) *ChatCompletionUnified
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*ChatCompletionUnified) FilterPath ¶
func (r *ChatCompletionUnified) FilterPath(filterpaths ...string) *ChatCompletionUnified
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*ChatCompletionUnified) Header ¶
func (r *ChatCompletionUnified) Header(key, value string) *ChatCompletionUnified
Header set a key, value pair in the ChatCompletionUnified headers map.
func (*ChatCompletionUnified) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*ChatCompletionUnified) Human ¶
func (r *ChatCompletionUnified) Human(human bool) *ChatCompletionUnified
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (*ChatCompletionUnified) MaxCompletionTokens ¶
func (r *ChatCompletionUnified) MaxCompletionTokens(maxcompletiontokens int64) *ChatCompletionUnified
The upper bound limit for the number of tokens that can be generated for a completion request. API name: max_completion_tokens
func (*ChatCompletionUnified) Messages ¶
func (r *ChatCompletionUnified) Messages(messages ...types.MessageVariant) *ChatCompletionUnified
A list of objects representing the conversation. API name: messages
func (*ChatCompletionUnified) Model ¶
func (r *ChatCompletionUnified) Model(model string) *ChatCompletionUnified
The ID of the model to use. API name: model
func (ChatCompletionUnified) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*ChatCompletionUnified) Pretty ¶
func (r *ChatCompletionUnified) Pretty(pretty bool) *ChatCompletionUnified
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*ChatCompletionUnified) Raw ¶
func (r *ChatCompletionUnified) Raw(raw io.Reader) *ChatCompletionUnified
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*ChatCompletionUnified) Request ¶
func (r *ChatCompletionUnified) Request(req *Request) *ChatCompletionUnified
Request allows to set the request property with the appropriate payload.
func (*ChatCompletionUnified) Stop ¶
func (r *ChatCompletionUnified) Stop(stops ...string) *ChatCompletionUnified
A sequence of strings to control when the model should stop generating additional tokens. API name: stop
func (*ChatCompletionUnified) Temperature ¶
func (r *ChatCompletionUnified) Temperature(temperature float32) *ChatCompletionUnified
The sampling temperature to use. API name: temperature
func (*ChatCompletionUnified) Timeout ¶
func (r *ChatCompletionUnified) Timeout(duration string) *ChatCompletionUnified
Timeout Specifies the amount of time to wait for the inference request to complete. API name: timeout
func (*ChatCompletionUnified) ToolChoice ¶
func (r *ChatCompletionUnified) ToolChoice(completiontooltype types.CompletionToolTypeVariant) *ChatCompletionUnified
Controls which tool is called by the model. API name: tool_choice
func (*ChatCompletionUnified) Tools ¶
func (r *ChatCompletionUnified) Tools(tools ...types.CompletionToolVariant) *ChatCompletionUnified
A list of tools that the model can call. API name: tools
func (*ChatCompletionUnified) TopP ¶
func (r *ChatCompletionUnified) TopP(topp float32) *ChatCompletionUnified
Nucleus sampling, an alternative to sampling with temperature. API name: top_p
type NewChatCompletionUnified ¶
type NewChatCompletionUnified func(inferenceid string) *ChatCompletionUnified
NewChatCompletionUnified type alias for index.
func NewChatCompletionUnifiedFunc ¶
func NewChatCompletionUnifiedFunc(tp elastictransport.Interface) NewChatCompletionUnified
NewChatCompletionUnifiedFunc returns a new instance of ChatCompletionUnified with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request = types.RequestChatCompletion
Request holds the request body struct for the package chatcompletionunified