|
| 1 | +# Copyright 2019 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# NOTE: This file is auto generated by the elixir code generator program. |
| 16 | +# Do not edit this file manually. |
| 17 | + |
| 18 | +defmodule GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3GeneratorModelParameter do |
| 19 | + @moduledoc """ |
| 20 | + Parameters to be passed to the LLM. If not set, default values will be used. |
| 21 | +
|
| 22 | + ## Attributes |
| 23 | +
|
| 24 | + * `maxDecodeSteps` (*type:* `integer()`, *default:* `nil`) - The maximum number of tokens to generate. |
| 25 | + * `temperature` (*type:* `number()`, *default:* `nil`) - The temperature used for sampling. Temperature sampling occurs after both topP and topK have been applied. Valid range: [0.0, 1.0] Low temperature = less random. High temperature = more random. |
| 26 | + * `topK` (*type:* `integer()`, *default:* `nil`) - If set, the sampling process in each step is limited to the top_k tokens with highest probabilities. Valid range: [1, 40] or 1000+. Small topK = less random. Large topK = more random. |
| 27 | + * `topP` (*type:* `number()`, *default:* `nil`) - If set, only the tokens comprising the top top_p probability mass are considered. If both top_p and top_k are set, top_p will be used for further refining candidates selected with top_k. Valid range: (0.0, 1.0]. Small topP = less random. Large topP = more random. |
| 28 | + """ |
| 29 | + |
| 30 | + use GoogleApi.Gax.ModelBase |
| 31 | + |
| 32 | + @type t :: %__MODULE__{ |
| 33 | + :maxDecodeSteps => integer() | nil, |
| 34 | + :temperature => number() | nil, |
| 35 | + :topK => integer() | nil, |
| 36 | + :topP => number() | nil |
| 37 | + } |
| 38 | + |
| 39 | + field(:maxDecodeSteps) |
| 40 | + field(:temperature) |
| 41 | + field(:topK) |
| 42 | + field(:topP) |
| 43 | +end |
| 44 | + |
| 45 | +defimpl Poison.Decoder, |
| 46 | + for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3GeneratorModelParameter do |
| 47 | + def decode(value, options) do |
| 48 | + GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3GeneratorModelParameter.decode( |
| 49 | + value, |
| 50 | + options |
| 51 | + ) |
| 52 | + end |
| 53 | +end |
| 54 | + |
| 55 | +defimpl Poison.Encoder, |
| 56 | + for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3GeneratorModelParameter do |
| 57 | + def encode(value, options) do |
| 58 | + GoogleApi.Gax.ModelBase.encode(value, options) |
| 59 | + end |
| 60 | +end |
0 commit comments