GenAI.InferenceProvider.DefaultProvider (GenAI Core v0.3.1)

Copy Markdown

Inference Provider Default Provider.

Summary

Functions

Sends a chat completion request to the Mistral API. This function constructs the request body based on the provided messages, tools, and settings, sends the request to the Mistral API, and returns a GenAI.ChatCompletion struct with the response.

Low level inference, pass in model, messages, tools, and various settings to prepare final provider specific API requires.

Obtain map of effective settings: settings, model_settings, provider_settings, config_settings, etc.

Prepare endpoint and method to make inference call to

Run inference and return completion response and updated session

Run inference in streaming mode and return completion response and updated session

Functions

chat(module, messages, tools, settings)

Sends a chat completion request to the Mistral API. This function constructs the request body based on the provided messages, tools, and settings, sends the request to the Mistral API, and returns a GenAI.ChatCompletion struct with the response.

chat(module, model, messages, tools, hyper_parameters, provider_settings \\ [], context \\ nil, options \\ nil)

Low level inference, pass in model, messages, tools, and various settings to prepare final provider specific API requires.

do_chat(module, messages, tools, settings)

do_chat(module, model, messages, tools, hyper_parameters, provider_settings \\ [], context \\ nil, options \\ nil)

do_effective_settings(module, model, session, context, options)

do_endpoint(_, model, settings, session, context, options)

do_headers(module, model, settings, session, context, options)

do_request_body(module, model, messages, tools, settings, session, context, options)

do_run(module, session, context, options \\ nil)

do_run_or_stream(mode, module, session, context, options \\ nil)

do_stream(module, session, context, options \\ nil)

effective_settings(module, model, session, context, options \\ nil)

Obtain map of effective settings: settings, model_settings, provider_settings, config_settings, etc.

endpoint(module, model, settings, session, context, options \\ nil)

Prepare endpoint and method to make inference call to

headers(module, options)

headers(module, model, settings, session, context, options \\ nil)

Prepare request headers

request_body(module, model, messages, tools, settings, session, context, options \\ nil)

Prepare request body to be passed to inference call.

run(module, session, context, options \\ nil)

Run inference and return completion response and updated session

standardize_model(model)

standardize_model(module, encoder, model)

stream(module, session, context, options \\ nil)

Run inference in streaming mode and return completion response and updated session