FEAT: updated generate action plan endpoint to use web search - #56
Conversation
…tGPT5 to search teh web, also added one small edit missed when updating GHA
Coverage report for
|
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
There was a problem hiding this comment.
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.
KevinJBoyer
left a comment
There was a problem hiding this comment.
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 :-)
| action_plan_as_json = """ | ||
| { | ||
| "title": string, | ||
| "summary": string, | ||
| "content": string | ||
| } | ||
| """ |
There was a problem hiding this comment.
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"}], |
There was a problem hiding this comment.
I also added this code, so that it wouldn't be restricted to a particular domain if domain is null
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 ♻️