Skip to content

Commit 3d91916

Browse files
authored
Fix GenerationConfig to match the API. (#609)
* Fix GenerationConfig, this doesn't match the API Change-Id: I4e0c3b45125023e056c3d7e1549eafb47e42815a * format Change-Id: I161dd7b9b371e005b4385faeaa84f6d141e09b43
1 parent e9b0cde commit 3d91916

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

google/generativeai/types/generation_types.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class GenerationConfigDict(TypedDict, total=False):
8585
temperature: float
8686
response_mime_type: str
8787
response_schema: protos.Schema | Mapping[str, Any] # fmt: off
88+
presence_penalty: float
89+
frequency_penalty: float
8890

8991

9092
@dataclasses.dataclass
@@ -144,8 +146,6 @@ class GenerationConfig:
144146
Note: The default value varies by model, see the
145147
`Model.top_k` attribute of the `Model` returned the
146148
`genai.get_model` function.
147-
seed:
148-
Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.
149149
response_mime_type:
150150
Optional. Output response mimetype of the generated candidate text.
151151
@@ -161,10 +161,6 @@ class GenerationConfig:
161161
Optional.
162162
frequency_penalty:
163163
Optional.
164-
response_logprobs:
165-
Optional. If true, export the `logprobs` results in response.
166-
logprobs:
167-
Optional. Number of candidates of log probabilities to return at each step of decoding.
168164
"""
169165

170166
candidate_count: int | None = None
@@ -173,13 +169,10 @@ class GenerationConfig:
173169
temperature: float | None = None
174170
top_p: float | None = None
175171
top_k: int | None = None
176-
seed: int | None = None
177172
response_mime_type: str | None = None
178173
response_schema: protos.Schema | Mapping[str, Any] | type | None = None
179174
presence_penalty: float | None = None
180175
frequency_penalty: float | None = None
181-
response_logprobs: bool | None = None
182-
logprobs: int | None = None
183176

184177

185178
GenerationConfigType = Union[protos.GenerationConfig, GenerationConfigDict, GenerationConfig]

0 commit comments

Comments
 (0)