Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a new Orchestrator "prompt_flow" #1026

Merged
merged 33 commits into from
Jun 14, 2024

Conversation

tectonia
Copy link
Collaborator

@tectonia tectonia commented Jun 8, 2024

This pull request introduces a new orchestration strategy called Prompt Flow in the codebase. The changes include adding new environment variables, updating the orchestration strategy enumeration, creating a new PromptFlowOrchestrator class, and updating the orchestrator selection logic to include the new strategy. Additionally, the LLMHelper class has been updated to support the new strategy, and unit tests have been added to verify the changes. Lastly, the local deployment documentation has been updated to reflect these changes.

New Environment Variables:

  • .env.sample: Added new environment variables related to the Prompt Flow orchestration strategy.
  • code/backend/batch/utilities/helpers/env_helper.py: Updated the __load_config method to load the new environment variables.
  • infra/prompt-flow/create-prompt-flow.sh: Updates the script to set environment variables locally and on web app. Assigns Azure ML Data Scientist role to web app for listing keys and accessing the scoring endpoint.

Orchestration Strategy Changes:

New PromptFlowOrchestrator Class:

LLMHelper Class Changes:

Unit Tests:

Documentation Updates:

  • docs/LOCAL_DEPLOYMENT.md, docs/TEAMS_LOCAL_DEPLOYMENT.md: Updated the local deployment documentation to reflect the new orchestration strategy and environment variables. [1] [2]

Fixes local configuration of frontend

  • code/frontend/vite.config.ts: Updates the vite configuration so port is exposed locally when running from a dev container. This fixes an issue some users where experiencing.

Limitations:

Closing #979

@tectonia tectonia requested a review from adamdougal June 8, 2024 13:33
@tectonia tectonia self-assigned this Jun 8, 2024
@tectonia tectonia linked an issue Jun 8, 2024 that may be closed by this pull request
8 tasks
Copy link

github-actions bot commented Jun 8, 2024

Coverage

Coverage Report •
FileStmtsMissCoverMissing
code/backend/batch/utilities/helpers
   env_helper.py143695%248–250, 269–271
   llm_helper.py48785%42–43, 52, 63–64, 75, 96
code/backend/batch/utilities/orchestrator
   orchestration_strategy.py60100% 
   prompt_flow.py520100% 
   strategies.py15473%12, 15–16, 18
TOTAL256756378% 

Tests Skipped Failures Errors Time
288 0 💤 0 ❌ 0 🔥 47.995s ⏱️

@tectonia tectonia changed the title Add a new Orchestrator "prompt_flow" feat: Add a new Orchestrator "prompt_flow" Jun 8, 2024
code/backend/batch/utilities/helpers/llm_helper.py Outdated Show resolved Hide resolved
code/backend/batch/utilities/helpers/llm_helper.py Outdated Show resolved Hide resolved
code/backend/batch/utilities/helpers/llm_helper.py Outdated Show resolved Hide resolved
code/backend/batch/utilities/orchestrator/prompt_flow.py Outdated Show resolved Hide resolved
code/tests/utilities/orchestrator/test_prompt_flow.py Outdated Show resolved Hide resolved
code/tests/utilities/orchestrator/test_prompt_flow.py Outdated Show resolved Hide resolved
code/tests/utilities/orchestrator/test_prompt_flow.py Outdated Show resolved Hide resolved
code/backend/batch/utilities/orchestrator/prompt_flow.py Outdated Show resolved Hide resolved
infra/prompt-flow/create-prompt-flow.sh Show resolved Hide resolved
@tectonia tectonia requested a review from adamdougal June 14, 2024 11:13
adamdougal
adamdougal previously approved these changes Jun 14, 2024
Copy link
Collaborator

@adamdougal adamdougal left a comment

Choose a reason for hiding this comment

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

LGTM! Great work!

We need to make some changes to support citations but we can add that later.

@adamdougal adamdougal added this pull request to the merge queue Jun 14, 2024
Merged via the queue into main with commit ce9281a Jun 14, 2024
9 checks passed
@adamdougal adamdougal deleted the martyna/prompt-flow-orchestrator branch June 14, 2024 16:02
Copy link

🎉 This PR is included in version 1.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new Orchestrator "promptflow" that calls the prompt flow
2 participants