-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: add Azure embedder support and update configuration handling #431
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,8 +79,8 @@ async def handle_websocket_chat(websocket: WebSocket): | |
| if hasattr(last_message, 'content') and last_message.content: | ||
| tokens = count_tokens(last_message.content, request.provider == "ollama") | ||
| logger.info(f"Request size: {tokens} tokens") | ||
| if tokens > 8000: | ||
| logger.warning(f"Request exceeds recommended token limit ({tokens} > 7500)") | ||
| if tokens > 9000: | ||
| logger.warning(f"Request exceeds recommended token limit ({tokens} > 9000)") | ||
|
Comment on lines
+82
to
+83
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The token limit |
||
| input_too_large = True | ||
|
|
||
| # Create a new RAG instance for this request | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new function
is_azure_embedderduplicates the logic found inis_ollama_embedder,is_google_embedder, andis_bedrock_embedder. To improve maintainability and reduce code duplication, consider creating a private helper function that takes the client name as an argument. This would centralize the checking logic.For example, you could have a helper:
Then this function could be simplified to
return _is_embedder_of_type("AzureAIClient").