Skip to content

Conversation

@Aias00
Copy link
Contributor

@Aias00 Aias00 commented Dec 16, 2025

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.2, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

Description

[Please describe the background, purpose, changes made, and how to test this PR]
Introduce dedicated DTOs for Gemini API request and response structures and update related components.
fixes #96

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Copy link
Contributor

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 replaces the Google GenAI Java SDK with dedicated DTOs and direct HTTP calls to the Gemini API, simplifying the implementation and removing dependencies on the Google SDK and Vertex AI support.

  • Custom DTOs introduced for all Gemini API request/response structures
  • Direct HTTP implementation using OkHttp with SSE streaming support
  • All formatters, converters, and parsers updated to use new DTOs

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
GeminiChatModel.java Replaced SDK client with OkHttpclient for direct API calls with streaming support
GeminiRequest.java, GeminiResponse.java New DTOs for API request/response structures
GeminiContent.java, GeminiPart.java DTOs for message content and parts
GeminiTool.java, GeminiToolConfig.java DTOs for tool definitions and configuration
GeminiGenerationConfig.java DTO for generation parameters
GeminiChatFormatter.java Updated to work with DTOs instead of SDK types
GeminiMessageConverter.java Updated conversion logic for new DTOs
GeminiMediaConverter.java Updated media handling to use DTO Blob type
GeminiToolsHelper.java Simplified tool conversion without SDK schema conversion
GeminiResponseParser.java Updated response parsing for new DTO structures
ModelProviderType.java Simplified Gemini config removing Vertex AI parameters
AgentScopeProducer.java Removed Vertex AI configuration logic
pom.xml (core) Removed google-genai dependency
pom.xml (mem0) Added jackson-datatype-jsr310 dependency
Test files Updated all tests to use new DTOs instead of SDK types

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

Aias00 and others added 5 commits December 16, 2025 13:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ini/GeminiMediaConverter.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…hatModel.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…hatModel.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AlbumenJ AlbumenJ marked this pull request as draft December 16, 2025 08:25
@Aias00
Copy link
Contributor Author

Aias00 commented Dec 17, 2025

gemini-2.0-flush
截屏2025-12-17 09 52 54

gemini-3-pro-preview
截屏2025-12-17 09 57 20

@Aias00 Aias00 marked this pull request as ready for review December 17, 2025 02:00
Signed-off-by: liuhy <liuhongyu@apache.org>
@Aias00 Aias00 changed the title feat: Introduce dedicated DTOs for Gemini API request and response structures and update related components. refactor: replace genAI model sdk by okHttp Dec 17, 2025
Copy link
Contributor

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

Copilot reviewed 38 out of 38 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

agentscope-extensions/agentscope-extensions-mem0/pom.xml:1

  • The jackson-datatype-jsr310 version 2.15.2 may be outdated. Consider using a more recent version that matches the Jackson version used elsewhere in the project, or verify if 2.15.2 is the intended version for compatibility reasons.

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

@AlbumenJ
Copy link
Collaborator

image

Please make sure all the E2E Tests pass

@AlbumenJ
Copy link
Collaborator

Your current logic for handling the Base URL differs from the GenAI SDK's approach, specifically regarding the handling of the GOOGLE_API_BASE_URL key.

… multi-agent thinking

Signed-off-by: liuhy <liuhongyu@apache.org>
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.

[Refactor] Use okhttp to replace GenAI Model SDK

2 participants