-
Notifications
You must be signed in to change notification settings - Fork 143
Add batch processing text embedding #19
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?
Conversation
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.
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) |
Copilot
AI
Oct 14, 2025
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.
Debug print statement should be removed from production code. Use proper logging instead.
| text = arguments.get("text") | ||
| if not text: | ||
| return {"error": "`text` parameter is required."} |
Copilot
AI
Oct 14, 2025
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.
Duplicate validation logic. The validate_input method already handles this check, but it's not being called before run().
| 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") |
No description provided.