Skip to content

FEAT: updated generate action plan endpoint to use web search - #56

Merged
michelle-hadfield-nava merged 9 commits into
mainfrom
mHadfield/1247-update-action-plans-to-use-web-search
Oct 29, 2025
Merged

FEAT: updated generate action plan endpoint to use web search#56
michelle-hadfield-nava merged 9 commits into
mainfrom
mHadfield/1247-update-action-plans-to-use-web-search

Conversation

@michelle-hadfield-nava

@michelle-hadfield-nava michelle-hadfield-nava commented Oct 22, 2025

Copy link
Copy Markdown
Collaborator

Ticket

https://navalabs.atlassian.net/browse/DST-1247

Changes

Updated the generate action plan to use OpenAI's gpt-5 so that it can browse the web

Context for reviewers

Discussion during implementation (confirming PII strategy and getting prompt requirements)

Testing

Make a referrals request and then generate an action plan. Phoenix will indicate that the new OpenAI gpt5 prompt was executed. Verify results

Ensuring web search is enabled
Run locally with the prompt version UHJvbXB0VmVyc2lvbjoyMw==. The action plan will not render, although the response will include the latest 3 day forecast for Austin, TX

Preview environment for frontend

♻️ Environment destroyed ♻️

Preview environment for app

♻️ Environment destroyed ♻️

@github-actions

github-actions Bot commented Oct 22, 2025

Copy link
Copy Markdown

Coverage report for frontend

St.
Category Percentage Covered / Total
🔴 Statements 56.71% 283/499
🔴 Branches 50% 96/192
🔴 Functions 53.75% 43/80
🔴 Lines 57.08% 270/473

Test suite run success

67 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from 3f76aca

@michelle-hadfield-nava
michelle-hadfield-nava marked this pull request as ready for review October 24, 2025 19:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the generate action plan endpoint to use OpenAI's GPT-5 model with web search capabilities, replacing the previous Amazon Bedrock/Claude implementation.

Key Changes:

  • Migrated from Amazon Bedrock's Claude model to OpenAI GPT-5 with web search
  • Increased API timeout from 30 seconds to 120 seconds to accommodate web search latency
  • Added OpenAI API key configuration to infrastructure

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
infra/app/app-config/env-config/environment_variables.tf Adds OpenAI API key secret management configuration
frontend/src/util/fetchActionPlan.ts Increases timeout from 30s to 120s for web search operations
app/src/pipelines/generate_action_plan/pipeline_wrapper.py Replaces Bedrock generator with OpenAI web search component
app/src/common/components.py Implements new OpenAIWebSearchGeneratorLightweight component
app/src/app_config.py Updates prompt version and fixes typo in comment
app/README.md Adds documentation for OpenAI API key setup
.github/workflows/run-experiment.yml Clarifies that prompt version only applies to generate-referrals

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/common/components.py Outdated
Comment thread app/src/common/components.py Outdated
Comment thread app/src/common/components.py Outdated

@KevinJBoyer KevinJBoyer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good -- when the full web search component from my PRs is merged in, we can work together to update this PR to handle the merge conflicts, then I'll test and approve :-)

Comment on lines +21 to +27
action_plan_as_json = """
{
"title": string,
"summary": string,
"content": string
}
"""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this: gpt-5-mini was getting confused about the format of json_dumps and repeating it back in its response, so I instead explicitly describe the JSON here.

"input": prompt,
"reasoning": {"effort": reasoning_effort},
"tools": [{"type": "web_search", "filters": {"allowed_domains": [domain]}}],
"tools": [{"type": "web_search"}],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added this code, so that it wouldn't be restricted to a particular domain if domain is null

@michelle-hadfield-nava
michelle-hadfield-nava merged commit 904c079 into main Oct 29, 2025
29 of 30 checks passed
@michelle-hadfield-nava
michelle-hadfield-nava deleted the mHadfield/1247-update-action-plans-to-use-web-search branch October 29, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants