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

Simpler azure embedding #2751

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Simpler azure embedding #2751

wants to merge 7 commits into from

Conversation

pablodanswer
Copy link
Contributor

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Accepted Risk

[Any know risks or failure modes to point out to reviewers]

Related Issue(s)

[If applicable, link to the issue(s) this PR addresses]

Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2024 10:05pm

@pablodanswer pablodanswer marked this pull request as ready for review October 9, 2024 21:30
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces support for Azure OpenAI embedding models and simplifies the overall embedding configuration process across the Danswer application. Here are the key changes:

  • Added 'api_version' and 'deployment_name' fields to support Azure OpenAI embeddings in backend models and database schema.
  • Introduced Azure as a new EmbeddingProvider option in shared configurations.
  • Updated the EmbeddingModel class to handle Azure-specific parameters in the natural language processing module.
  • Modified the CloudEmbedding class in the model server to support Azure embedding integration.
  • Refactored frontend components to accommodate Azure embedding configuration, including new form fields and validation.
  • Simplified the UI for different provider types, particularly in the ChangeCredentialsModal and ProviderCreationModal components.

18 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings

Comment on lines 3 to 4
Revision ID: 5d12a446f5c0
Revises: 5d12a446f5c0
Copy link

Choose a reason for hiding this comment

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

syntax: Revision ID is duplicated in 'Revises' field

`}
value={modelName}
onChange={(e: any) => setModelName(e.target.value)}
placeholder="Paste your API URL here"
Copy link

Choose a reason for hiding this comment

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

syntax: Placeholder text for model name input is incorrect. It should be 'Enter model name' instead of 'Paste your API URL here'

Comment on lines 251 to 255
{deletionError && (
<Callout title="Error" color="red" className="mt-4">
{deletionError}
</Callout>
)}
Copy link

Choose a reason for hiding this comment

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

logic: Duplicate error display for deletionError. This block should be removed as it's already handled earlier

Comment on lines +279 to +285
<Subtitle className="mt-4 font-bold text-lg mb-2">
You can delete your configuration.
</Subtitle>
<Text className="mb-2">
This is only possible if you have already switched to a different
embedding type!
</Text>
Copy link

Choose a reason for hiding this comment

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

logic: The deletion section is now outside the conditional rendering block, making it available for all provider types including Azure. Verify if this is the intended behavior

Comment on lines +71 to +73
const [azureProvider, setAzureProvider] = useState<
EmbeddingDetails | undefined
>(undefined);
Copy link

Choose a reason for hiding this comment

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

style: Consider initializing azureProvider with null instead of undefined for consistency

}, [embeddingProviderDetails]);

const isAzureConfigured = !!azureProvider;
Copy link

Choose a reason for hiding this comment

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

style: Use explicit comparison (isAzureConfigured = azureProvider !== undefined) for clarity

Comment on lines 391 to 393
// currentValues={
// currentModel.provider_type === 'litetllm' ? currentModel : null
// }
Copy link

Choose a reason for hiding this comment

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

style: Remove commented out code before merging

@@ -25,7 +27,7 @@ export function LiteLLMModelForm({
normalize: false,
query_prefix: "",
passage_prefix: "",
provider_type: "LiteLLM",
provider_type: embeddingType === "azure" ? "Azure" : "LiteLLM",
Copy link

Choose a reason for hiding this comment

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

logic: The provider_type is now dynamically set based on the embeddingType prop. Verify that this change doesn't break any existing functionality that relies on the provider_type value.

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.

1 participant