AWS SDK for C++

AWS SDK for C++ Version 1.11.925

Loading...
Searching...
No Matches
SamplingParams.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/sagemakertrainingsessionruntime/SageMakerTrainingSessionRuntime_EXPORTS.h>
10
11#include <utility>
12
13namespace Aws {
14namespace Utils {
15namespace Json {
16class JsonValue;
17class JsonView;
18} // namespace Json
19} // namespace Utils
20namespace SageMakerTrainingSessionRuntime {
21namespace Model {
22
30 public:
31 AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API SamplingParams() = default;
32 AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API SamplingParams(Aws::Utils::Json::JsonView jsonValue);
33 AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API SamplingParams& operator=(Aws::Utils::Json::JsonView jsonValue);
34 AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const;
35
37
40 inline int GetMaxTokens() const { return m_maxTokens; }
41 inline bool MaxTokensHasBeenSet() const { return m_maxTokensHasBeenSet; }
42 inline void SetMaxTokens(int value) {
43 m_maxTokensHasBeenSet = true;
44 m_maxTokens = value;
45 }
46 inline SamplingParams& WithMaxTokens(int value) {
47 SetMaxTokens(value);
48 return *this;
49 }
51
53
57 inline double GetTemperature() const { return m_temperature; }
58 inline bool TemperatureHasBeenSet() const { return m_temperatureHasBeenSet; }
59 inline void SetTemperature(double value) {
60 m_temperatureHasBeenSet = true;
61 m_temperature = value;
62 }
63 inline SamplingParams& WithTemperature(double value) {
64 SetTemperature(value);
65 return *this;
66 }
68
70
74 inline int GetTopK() const { return m_topK; }
75 inline bool TopKHasBeenSet() const { return m_topKHasBeenSet; }
76 inline void SetTopK(int value) {
77 m_topKHasBeenSet = true;
78 m_topK = value;
79 }
80 inline SamplingParams& WithTopK(int value) {
81 SetTopK(value);
82 return *this;
83 }
85
87
91 inline double GetTopP() const { return m_topP; }
92 inline bool TopPHasBeenSet() const { return m_topPHasBeenSet; }
93 inline void SetTopP(double value) {
94 m_topPHasBeenSet = true;
95 m_topP = value;
96 }
97 inline SamplingParams& WithTopP(double value) {
98 SetTopP(value);
99 return *this;
100 }
102
104
108 inline int GetSeed() const { return m_seed; }
109 inline bool SeedHasBeenSet() const { return m_seedHasBeenSet; }
110 inline void SetSeed(int value) {
111 m_seedHasBeenSet = true;
112 m_seed = value;
113 }
114 inline SamplingParams& WithSeed(int value) {
115 SetSeed(value);
116 return *this;
117 }
119
121
125 inline const Aws::Vector<Aws::String>& GetStop() const { return m_stop; }
126 inline bool StopHasBeenSet() const { return m_stopHasBeenSet; }
127 template <typename StopT = Aws::Vector<Aws::String>>
128 void SetStop(StopT&& value) {
129 m_stopHasBeenSet = true;
130 m_stop = std::forward<StopT>(value);
131 }
132 template <typename StopT = Aws::Vector<Aws::String>>
133 SamplingParams& WithStop(StopT&& value) {
134 SetStop(std::forward<StopT>(value));
135 return *this;
136 }
137 template <typename StopT = Aws::String>
138 SamplingParams& AddStop(StopT&& value) {
139 m_stopHasBeenSet = true;
140 m_stop.emplace_back(std::forward<StopT>(value));
141 return *this;
142 }
144 private:
145 int m_maxTokens{0};
146
147 double m_temperature{0.0};
148
149 int m_topK{0};
150
151 double m_topP{0.0};
152
153 int m_seed{0};
154
156 bool m_maxTokensHasBeenSet = false;
157 bool m_temperatureHasBeenSet = false;
158 bool m_topKHasBeenSet = false;
159 bool m_topPHasBeenSet = false;
160 bool m_seedHasBeenSet = false;
161 bool m_stopHasBeenSet = false;
162};
163
164} // namespace Model
165} // namespace SageMakerTrainingSessionRuntime
166} // namespace Aws
AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const
AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API SamplingParams()=default
const Aws::Vector< Aws::String > & GetStop() const
AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API SamplingParams & operator=(Aws::Utils::Json::JsonView jsonValue)
AWS_SAGEMAKERTRAININGSESSIONRUNTIME_API SamplingParams(Aws::Utils::Json::JsonView jsonValue)
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue