Skip to content

Commit

Permalink
samples(discoveryengine): Add Model Prompt Spec and Model Spec to `se…
Browse files Browse the repository at this point in the history
…arch_sample()` (#11274)
  • Loading branch information
holtskinner committed Mar 5, 2024
1 parent f832838 commit af95f03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion discoveryengine/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==7.2.1
google-api-core==2.11.1
google-api-core==2.17.1
4 changes: 2 additions & 2 deletions discoveryengine/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-cloud-discoveryengine==0.11.1
google-api-core==2.11.1
google-cloud-discoveryengine==0.11.8
google-api-core==2.17.1
6 changes: 6 additions & 0 deletions discoveryengine/search_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ def search_sample(
include_citations=True,
ignore_adversarial_query=True,
ignore_non_summary_seeking_query=True,
model_prompt_spec=discoveryengine.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec(
preamble="YOUR_CUSTOM_PROMPT"
),
model_spec=discoveryengine.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec(
version="stable", # Options: stable, preview
),
),
)

Expand Down

0 comments on commit af95f03

Please sign in to comment.