PR 11: Client integration - #12
Open
subtleGradient wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the call_model functionality into the OpenRouter client SDK, providing a high-level API for model interactions with automatic tool orchestration. The integration maintains full backward compatibility with existing SDK functionality.
- Adds
call_modelasync method to theOpenRouterclient class with comprehensive documentation - Implements backward compatibility test suite covering imports, namespaces, and integration patterns
- Ensures no conflicts with existing SDK structure through proper method delegation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_backward_compatibility.py | Comprehensive test suite verifying call_model integration, backward compatibility with existing SDK functionality, proper module exports, and context manager support |
| src/openrouter/sdk.py | Adds call_model method to OpenRouter client with detailed docstring and examples, includes import type hints for BaseTool and ResponseWrapper, and minor formatting improvements to assert statements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from openrouter.analytics import Analytics | ||
| from openrouter.api_keys import APIKeys | ||
| from openrouter.beta import Beta | ||
| from openrouter.call_model import BaseTool, ResponseWrapper |
There was a problem hiding this comment.
Import of 'BaseTool' is not used.
| import pytest | ||
|
|
||
| from openrouter import OpenRouter | ||
| from openrouter.call_model import BaseTool, ResponseWrapper, call_model |
There was a problem hiding this comment.
Import of 'BaseTool' is not used.
Import of 'call_model' is not used.
Suggested change
| from openrouter.call_model import BaseTool, ResponseWrapper, call_model | |
| from openrouter.call_model import ResponseWrapper |
- Add call_model() async method to OpenRouter SDK class - Comprehensive docstring with multiple usage examples - Delegates to call_model function from call_model module - Keyword-only parameters for tools, max_tool_rounds, options - Full backward compatibility maintained Integration: - Method signature matches FR-1.1.2 requirements - Passes all parameters to underlying call_model function - Returns ResponseWrapper for multiple consumption patterns - No modifications to existing SDK functionality (FR-1.7.1) Tests: - 17 comprehensive backward compatibility tests - Verify method exists and is callable - Verify signature and documentation - Test existing imports unchanged - Test beta namespace intact - Test no namespace collisions - Test module exports - All tests pass ✓ Implements: FR-1.1.1, FR-1.1.2, FR-1.7.1, FR-1.7.2, FR-1.7.3, NFR-2.3.2 Depends on: PR 4.1 (Main Entry Point)
subtleGradient
force-pushed
the
tom/call-model-10b-git-hygiene
branch
from
November 21, 2025 03:49
62e0678 to
d2103ce
Compare
subtleGradient
force-pushed
the
tom/call-model-11-client-integration
branch
from
November 21, 2025 03:49
cf46285 to
58da8c4
Compare
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.
Summary
Builds on #11.