Skip to content

Commit 4155814

Browse files
docs: Add Link to GenerateContentConfig docs and add example using safety_settings (#670)
* docs: Add Link to `GenerateContentConfig` docs and add example using `safety_settings` * Re-add comment --------- Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
1 parent af2ee80 commit 4155814

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/agents/llm-agents.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Beyond the core parameters, `LlmAgent` offers several options for finer control:
214214

215215
You can adjust how the underlying LLM generates responses using `generate_content_config`.
216216

217-
* **`generate_content_config` (Optional):** Pass an instance of `google.genai.types.GenerateContentConfig` to control parameters like `temperature` (randomness), `max_output_tokens` (response length), `top_p`, `top_k`, and safety settings.
217+
* **`generate_content_config` (Optional):** Pass an instance of [`google.genai.types.GenerateContentConfig`](https://googleapis.github.io/python-genai/genai.html#genai.types.GenerateContentConfig) to control parameters like `temperature` (randomness), `max_output_tokens` (response length), `top_p`, `top_k`, and safety settings.
218218

219219
=== "Python"
220220

@@ -225,7 +225,13 @@ You can adjust how the underlying LLM generates responses using `generate_conten
225225
# ... other params
226226
generate_content_config=types.GenerateContentConfig(
227227
temperature=0.2, # More deterministic output
228-
max_output_tokens=250
228+
max_output_tokens=250,
229+
safety_settings=[
230+
types.SafetySetting(
231+
category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
232+
threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
233+
)
234+
]
229235
)
230236
)
231237
```

0 commit comments

Comments
 (0)