Packages

Elixir SDK for Bifrost, the LLM gateway by Maxim

Current section

Files

Jump to
ex_bifrost lib ex_bifrost model open_ai_text_completion_request.ex
Raw

lib/ex_bifrost/model/open_ai_text_completion_request.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.23.0 (https://openapi-generator.tech)
# using the Elixir SDK Generator template (https://github.com/houllette/elixir-sdk-generator).
# Do not edit this file manually — edit the templates and regenerate instead.
defmodule ExBifrost.Model.OpenAiTextCompletionRequest do
@moduledoc """
OpenAiTextCompletionRequest model.
"""
@derive JSON.Encoder
defstruct [
:model,
:prompt,
:stream,
:max_tokens,
:temperature,
:top_p,
:frequency_penalty,
:presence_penalty,
:logit_bias,
:logprobs,
:n,
:stop,
:suffix,
:echo,
:best_of,
:user,
:seed,
:fallbacks
]
@type t :: %__MODULE__{
:model => String.t(),
:prompt => ExBifrost.Model.ChatCompletionRequestStop.t(),
:stream => boolean() | nil,
:max_tokens => integer() | nil,
:temperature => number() | nil,
:top_p => number() | nil,
:frequency_penalty => number() | nil,
:presence_penalty => number() | nil,
:logit_bias => %{optional(String.t()) => number()} | nil,
:logprobs => integer() | nil,
:n => integer() | nil,
:stop => ExBifrost.Model.ChatCompletionRequestStop.t() | nil,
:suffix => String.t() | nil,
:echo => boolean() | nil,
:best_of => integer() | nil,
:user => String.t() | nil,
:seed => integer() | nil,
:fallbacks => [String.t()] | nil
}
alias ExBifrost.Deserializer
def decode(value) do
value
|> Deserializer.deserialize(:prompt, :struct, ExBifrost.Model.ChatCompletionRequestStop)
|> Deserializer.deserialize(:stop, :struct, ExBifrost.Model.ChatCompletionRequestStop)
end
end