Skip to content

Conversation

@OhYee
Copy link
Contributor

@OhYee OhYee commented Dec 3, 2025

Change-Id: I42ea47385a174c9380ee3627b1509857aa13a051

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

Copilot AI review requested due to automatic review settings December 3, 2025 10:44
Change-Id: I42ea47385a174c9380ee3627b1509857aa13a051
Signed-off-by: OhYee <oyohyee@oyohyee.com>
@OhYee OhYee force-pushed the fix-google-adk-integration branch from 2133256 to fd9f65c Compare December 3, 2025 10:45
@OhYee OhYee merged commit b780a97 into main Dec 3, 2025
1 check passed
Copilot finished reviewing on behalf of OhYee December 3, 2025 10:48
Copy link

Copilot AI left a 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 fixes import and dependency issues in the Google ADK integration and optimizes the overall code structure by removing redundant custom wrapper implementations in favor of native library classes.

Key Changes:

  • Added missing alibabacloud_tea_openapi dependency to pyproject.toml
  • Moved ModelResponse import from internal exports to direct pydantic_ai imports in tests
  • Removed custom wrapper implementations in integration adapters, using native library classes instead (ChatOpenAI, LiteLlm, OpenAIChatModel)
  • Applied TYPE_CHECKING pattern for lazy litellm imports to improve startup performance

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Added missing alibabacloud_tea_openapi>=0.4.2 dependency used throughout the codebase
agentrun/model/init.py Removed incorrect exports of ModelResponse and CustomStreamWrapper from litellm
agentrun/init.py Removed incorrect exports of ModelResponse and CustomStreamWrapper from public API
tests/e2e/test_model.py Fixed import to use ModelResponse from pydantic_ai instead of internal module
tests/e2e/__test_model_async_template.py Fixed import to use ModelResponse from pydantic_ai instead of internal module
agentrun/model/api/data.py Applied TYPE_CHECKING pattern for lazy litellm imports to improve performance
agentrun/integration/google_adk/model_adapter.py Simplified to use Google ADK's native LiteLlm class; removed unused imports and custom wrapper
agentrun/integration/google_adk/tool_adapter.py Removed unused inspect and Any imports after code cleanup
agentrun/integration/langchain/model_adapter.py Removed custom AgentRunLangChainChatModel wrapper in favor of native ChatOpenAI
agentrun/integration/pydantic_ai/model_adapter.py Removed custom AgentRunPydanticAIModel wrapper in favor of native OpenAIChatModel
agentrun/integration/agentscope/model_adapter.py Removed unused imports (asyncio, inspect, json, List, Optional) and custom wrapper
agentrun/integration/agentscope/tool_adapter.py Removed unused ToolUseBlock import
examples/model.py Removed optional proxy_mode parameter from example code (field has default value)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


return LiteLlm(
model=info.model or "",
model=f"{info.provider or 'openai'}/{info.model}",
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The model string format f"{info.provider or 'openai'}/{info.model}" follows litellm's provider/model naming convention (e.g., "openai/gpt-4"). Verify that Google ADK's LiteLlm class expects this format. If info.provider is None and info.model is also None, this will produce "openai/None" which may not be a valid model identifier.

Copilot uses AI. Check for mistakes.
@OhYee OhYee deleted the fix-google-adk-integration branch December 5, 2025 02:04
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