Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces batch processing capabilities for text embeddings using Azure OpenAI. The new TextEmbeddingTool allows processing both single strings and lists of strings for efficient embedding generation.
- Adds a new TextEmbeddingTool class that supports both single and batch text embedding processing
- Creates configuration files and registry entries for the new tool
- Updates the module initialization to include the new TextEmbeddingTool
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/tooluniverse/text_embedding_tool.py | Implements the main TextEmbeddingTool class with batch processing support |
| src/tooluniverse/default_config.py | Adds configuration path for text embedding tools |
| src/tooluniverse/data/text_embedding_tools.json | Defines tool schema and configuration for text embedding |
| src/tooluniverse/init.py | Updates module exports to include TextEmbeddingTool |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| api_key=os.getenv("AZURE_OPENAI_API_KEY"), | ||
| api_version="2024-10-21", | ||
| ) | ||
| print("ToolConfig for TextEmbeddingTool:", tool_config) |
There was a problem hiding this comment.
Debug print statement should be removed from production code. Use proper logging instead.
Comment on lines
+45
to
+47
| text = arguments.get("text") | ||
| if not text: | ||
| return {"error": "`text` parameter is required."} |
There was a problem hiding this comment.
Duplicate validation logic. The validate_input method already handles this check, but it's not being called before run().
Suggested change
| text = arguments.get("text") | |
| if not text: | |
| return {"error": "`text` parameter is required."} | |
| try: | |
| self.validate_input(**arguments) | |
| except ValueError as e: | |
| return {"error": str(e)} | |
| text = arguments.get("text") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.