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

Support fallback deployments to accompany fallback models #183

Merged
merged 7 commits into from
Aug 14, 2023

Conversation

zmeir
Copy link
Contributor

@zmeir zmeir commented Aug 7, 2023

This is useful for example in Azure OpenAI deployments where you have a different deployment per model, so the current fallback implementation doesn't work (still uses the same deployment for each fallback attempt)

zmeir and others added 3 commits August 7, 2023 16:18
This is useful for example in Azure OpenAI deployments where you have a different deployment per model, so the current fallback implementation doesn't work (still uses the same deployment for each fallback attempt)
@mrT23
Copy link
Collaborator

mrT23 commented Aug 9, 2023

@okotek

@mrT23 mrT23 requested a review from okotek August 9, 2023 05:51
@CodiumAI-Agent
Copy link

Question: write me a poem about this PR

Answer:
In the realm of code, where AI models play,
A pull request arrives, to brighten the day.
"Support fallback deployments," it proudly proclaims,
To enhance Azure OpenAI, and elevate its games.

No longer bound, to a single deployment id,
It adapts and adjusts, as the situation did.
A property it becomes, dynamically retrieved,
An elegant solution, cleverly conceived.

With each model a deployment, it pairs,
Ensuring each fallback, is free of snares.
If one fails, another takes the stage,
A dance choreographed, across the digital page.

In the settings template, a new field appears,
To list fallback deployments, easing our fears.
A symphony of changes, in Python's sweet song,
A pull request that rights, a deployment wrong.

So here's to the coder, who saw the need,
And crafted this PR, with impressive speed.
In the world of AI, they've made their mark,
A beacon of progress, in the coding dark.

@CodiumAI-Agent
Copy link

Question: is the PR complete? (answer as if you are Elon Musk)

Answer:
The PR appears to be complete as it successfully implements the feature of supporting fallback deployments to accompany fallback models. This is particularly useful for Azure OpenAI deployments where each model has a different deployment. The code changes include the addition of a new property deployment_id, modifications to the chat_completion and retry_with_fallback_models methods, and updates to the settings file. The PR also includes appropriate logging and error handling. However, it would be beneficial to include tests to ensure the new functionality works as expected.

pr_agent/algo/pr_processing.py Outdated Show resolved Hide resolved
@@ -14,6 +14,7 @@ key = "" # Acquire through https://platform.openai.com
#api_version = '2023-05-15' # Check Azure documentation for the current API version
#api_base = "" # The base URL for your Azure OpenAI resource. e.g. "https://<your resource name>.openai.azure.com"
#deployment_id = "" # The deployment name you chose when you deployed the engine
#fallback_deployments = [] # Match your fallback models from configuration.toml with the appropriate deployment_id
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#fallback_deployments = [] # Match your fallback models from configuration.toml with the appropriate deployment_id
#fallback_deployments = [] # For each fallback model specified in configuration.toml in the [config] section, specify the appropriate deployment_id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks for the clarification :)

@okotek
Copy link
Contributor

okotek commented Aug 9, 2023

/improve

pr_agent/algo/ai_handler.py Show resolved Hide resolved
pr_agent/algo/pr_processing.py Outdated Show resolved Hide resolved
pr_agent/algo/pr_processing.py Outdated Show resolved Hide resolved
pr_agent/algo/ai_handler.py Show resolved Hide resolved
@okotek okotek closed this Aug 13, 2023
@okotek okotek reopened this Aug 13, 2023
@okotek okotek merged commit 23a79bc into Codium-ai:main Aug 14, 2023
2 checks passed
@zmeir zmeir deleted the zmeir-fallback_deployments branch August 14, 2023 12:15
yochail pushed a commit to yochail/pr-agent that referenced this pull request Feb 11, 2024
Support fallback deployments to accompany fallback models
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