-
Notifications
You must be signed in to change notification settings - Fork 1
DRAFT: Implement new methods #23
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
Closed
Closed
Conversation
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
This PR intends to match the SDK functionalities to this Python version. This is a comparison (Comparison made by Cursor): 1. Core Agent Features: - ✅ Agent initialization with options (port, API keys, system prompt) - ✅ Capability/tool management (add_capability, add_capabilities) - ✅ OpenAI integration for chat completions - ✅ HTTP server for handling requests - ✅ Error handling with custom handlers 2. API Methods: - ✅ process() - For handling chat completions - ✅ handle_tool_route() - For executing capabilities - ✅ start() and stop() - Server lifecycle management - ✅ All workspace operations (files, tasks, agents) - ✅ All task operations (create, update, complete, error) - ✅ Chat message handling - ✅ Human assistance requests - ✅ Integration calls 3. Tool/Capability System: - ✅ Schema validation (Pydantic in Python, Zod in TypeScript) - ✅ Tool conversion to OpenAI format - ✅ Async tool execution - ✅ Tool error handling 4. Configuration: - ✅ Environment variable support - ✅ Default values (port 7378, URLs) - ✅ API key validation - ✅ OpenAI model configuration 5. Client Implementation: - ✅ API client for OpenServ platform - ✅ Runtime client for agent operations - ✅ OpenAI client management The main differences are language-specific implementations: 1. Python uses Pydantic for schemas, TypeScript uses Zod 2. Python uses FastAPI for the server, TypeScript uses Express 3. Python's async/await syntax vs TypeScript's Promise-based async 4. Python's type hints vs TypeScript's type system But functionally, both SDKs provide the same capabilities and interface. The Python SDK fully implements all the features of the TypeScript SDK. ## Test coverage: Adding 75 tests, all are currently passing with an overall coverage of 89%. 1. **Test Results**: 75/75 tests passed (100% pass rate) 2. **Coverage by Module**: - `__init__.py`: 100% - `agent.py`: 77% - `capability.py`: 100% - `client.py`: 88% - `config.py`: 93% - `exceptions.py`: 100% - `logger.py`: 100% - `server.py`: 86% - `types.py`: 100%
Missing asyncio import in main agent o_O
In this PR: - [x] Added integration tests to test all the types - [x] Fixed some test issues and unused imports - [x] Added a library to requirements.txt
Add error handling to tasks
Letssss see if this fixes
Again, trying to fix why is the output not returnin
Trying to fix the implementation
This PR enhances type safety, file handling, and error consistency in the BaseClient, OpenServClient, and Agent classes. It also introduces a new ListFilesParams type and improves test coverage for file operations. Changes BaseClient • Added proper type hints for all parameters and return values • Improved header handling to support both default and custom headers • Enhanced file handling for multipart form data • Added comprehensive docstrings with type information OpenServClient • Added type hints for the post method to support both JSON and form data • Improved error handling and ensured response type consistency Agent • Added proper type hints for file operations • Improved docstrings with detailed parameter descriptions • Fixed file upload handling to properly include filenames ListFilesParams • Introduced a new dataclass for file listing parameters • Ensured consistency with other parameter types Test Suite • Added tests for both text and binary file uploads • Implemented type checking in assertions • Fixed API endpoint paths to align with implementation • Improved test coverage for all file operations
Fix cases, divided tests into unit and e2e
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.
Trying to fix it... again :D