Skip to content

PR 11: Client integration - #12

Open
subtleGradient wants to merge 1 commit into
tom/call-model-10b-git-hygienefrom
tom/call-model-11-client-integration
Open

PR 11: Client integration#12
subtleGradient wants to merge 1 commit into
tom/call-model-10b-git-hygienefrom
tom/call-model-11-client-integration

Conversation

@subtleGradient

Copy link
Copy Markdown
Owner

Summary

  • Integrate call_model method into OpenRouter client
  • Add backward compatibility tests
  • Ensure seamless integration with existing SDK

Builds on #11.

Copilot AI left a comment

Copy link
Copy Markdown

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 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_model async method to the OpenRouter client 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.

Comment thread src/openrouter/sdk.py
from openrouter.analytics import Analytics
from openrouter.api_keys import APIKeys
from openrouter.beta import Beta
from openrouter.call_model import BaseTool, ResponseWrapper

Copilot AI Nov 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'BaseTool' is not used.

Copilot uses AI. Check for mistakes.
import pytest

from openrouter import OpenRouter
from openrouter.call_model import BaseTool, ResponseWrapper, call_model

Copilot AI Nov 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
- 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
subtleGradient force-pushed the tom/call-model-10b-git-hygiene branch from 62e0678 to d2103ce Compare November 21, 2025 03:49
@subtleGradient
subtleGradient force-pushed the tom/call-model-11-client-integration branch from cf46285 to 58da8c4 Compare November 21, 2025 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants