Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
92fd3fd
feat: Introduce dedicated DTOs for Gemini API request and response st…
Aias00 Dec 16, 2025
b0b02b4
Update agentscope-extensions/agentscope-extensions-mem0/pom.xml
Aias00 Dec 16, 2025
16896c7
Update agentscope-core/src/main/java/io/agentscope/core/formatter/gem…
Aias00 Dec 16, 2025
364901f
Update agentscope-core/src/main/java/io/agentscope/core/model/GeminiC…
Aias00 Dec 16, 2025
d2bacf1
Update agentscope-core/src/main/java/io/agentscope/core/model/GeminiC…
Aias00 Dec 16, 2025
27ebc28
feat: Enhance Gemini integration by converting ThinkingBlock messages…
Aias00 Dec 16, 2025
ab9db03
feat: Add Gemini 3 compatibility adjustments, move API key to header,…
Aias00 Dec 16, 2025
5f0f0ab
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Dec 16, 2025
8444d7b
feat: Introduce accessToken authentication and configurable base URL …
Aias00 Dec 16, 2025
19d0c78
feat: Add GeminiChatExample demonstrating basic Agent setup with Goog…
Aias00 Dec 17, 2025
4ec28cb
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Dec 17, 2025
21dca17
refactor: Remove unnecessary whitespace in GeminiChatExample.java
Aias00 Dec 17, 2025
75375bb
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Dec 17, 2025
dea16ab
feat: Add thoughtSignature support and Gemini 3 provider integration
Aias00 Dec 17, 2025
f323fd6
feat: Enhance Gemini integration with schema cleaning and support for…
Aias00 Dec 18, 2025
764bc52
feat: Improve code readability with formatting adjustments and enhanc…
Aias00 Dec 25, 2025
83094c8
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Dec 25, 2025
3148701
feat: Update conversation history prompt and comment out unused Gemin…
Aias00 Dec 25, 2025
3f89137
feat(gemini): add support for custom system prompts in ReActAgent cre…
Aias00 Dec 25, 2025
c2deeb6
feat(gemini): enhance agent initialization with personalized prompts …
Aias00 Dec 25, 2025
efa68e7
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Dec 25, 2025
da39722
feat(gemini): simplify response formatting by removing unnecessary pr…
Aias00 Dec 25, 2025
bc49486
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Dec 25, 2025
a98f20f
feat(gemini): enhance signature handling and metadata integration in …
Aias00 Dec 25, 2025
da7880e
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Dec 25, 2025
4367218
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Dec 30, 2025
6bd25cc
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 4, 2026
65d8716
feat(gemini): add prompt feedback handling and system instruction sup…
Aias00 Jan 5, 2026
cbea7ab
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 5, 2026
809b2b6
refactor(gemini): remove unused ObjectMapper import and simplify logg…
Aias00 Jan 5, 2026
dd2a9a6
chore(gemini): update copyright year to 2026 and fix license URL
Aias00 Jan 5, 2026
79263fa
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Jan 5, 2026
ebdf77b
chore(gemini): update copyright year to 2026 and fix license URL
Aias00 Jan 5, 2026
4d6a4e3
feat(gemini): preserve tool call roles in message formatting
Aias00 Jan 6, 2026
fe54012
feat(gemini): preserve tool call roles in message formatting
Aias00 Jan 6, 2026
191b3af
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 6, 2026
082b355
feat(gemini): refactor function call creation and update test assertions
Aias00 Jan 6, 2026
d5d47ed
feat(gemini): update Gemini SDK integration and enhance documentation
Aias00 Jan 6, 2026
cebe6e9
feat(gemini): rename GeminiNativeProvider to GeminiProvider and refac…
Aias00 Jan 6, 2026
b71070f
refactor(gemini): clean up whitespace in GeminiProvider.java
Aias00 Jan 6, 2026
fd7866e
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Jan 12, 2026
af7d01a
test(genai): update formatter
Aias00 Jan 12, 2026
3122d67
test(genai): update converter
Aias00 Jan 12, 2026
b9cfd45
test(genai): update converter
Aias00 Jan 12, 2026
878c0f9
refactor(genai): simplify message formatting logic in GeminiChatForma…
Aias00 Jan 14, 2026
c4abb2f
Merge branch 'main' into feat/replace_genai_sdk
Aias00 Jan 14, 2026
37785d3
Merge branch 'feat/replace_genai_sdk' of https://github.com/Aias00/ag…
Aias00 Jan 14, 2026
d962a60
refactor(genai): enhance message formatting and improve response parsing
Aias00 Jan 14, 2026
d7e639b
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 16, 2026
5459c70
refactor(genai): streamline message formatting and enhance null handling
Aias00 Jan 16, 2026
e283287
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 16, 2026
d164b77
test(GeminiMessageConverter): add Base64 import for encoding support
Aias00 Jan 16, 2026
4448f47
feat(gemini): implement multi-agent message converter for history mer…
Aias00 Jan 16, 2026
b4aef30
refactor: simplify imports and enhance code readability across multip…
Aias00 Jan 19, 2026
105e142
refactor: replace fully qualified class names with imports for improv…
Aias00 Jan 19, 2026
0702a88
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 21, 2026
1147de4
refactor(tests): simplify imports and enhance readability in test files
Aias00 Jan 21, 2026
66d2531
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 22, 2026
17de421
refactor(ShellCommandTool): remove unused method and clean up code
Aias00 Jan 22, 2026
8b61ee0
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 23, 2026
fad6c3f
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 23, 2026
77b41bc
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Jan 24, 2026
0283275
Merge branch 'main' into feat/replace_genai_sdk
AlbumenJ Jan 26, 2026
bdceb0c
Merge branch 'feat/replace_genai_sdk' of https://github.com/Aias00/ag…
Aias00 Jan 26, 2026
7d0531d
refactor(Gemini API): improve serialization handling and enhance inte…
Aias00 Jan 26, 2026
187c3c6
refactor(Gemini API): improve serialization handling and enhance inte…
Aias00 Jan 26, 2026
97b1269
fix(Gemini API): improve structured output handling and tool call com…
Aias00 Jan 29, 2026
a4ca4c2
feat(Gemini API): align retry logic, finish reason handling, and stru…
Aias00 Jan 29, 2026
e2c3cb1
feat(Gemini API): enhance structured output handling and ensure conve…
Aias00 Feb 3, 2026
79eb366
Merge branch 'refs/heads/main' into feat/replace_genai_sdk
Aias00 Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions agentscope-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@
</exclusions>
</dependency>

<!-- Google Gemini Java SDK -->
<dependency>
<groupId>com.google.genai</groupId>
<artifactId>google-genai</artifactId>
</dependency>

<!-- Anthropic Java SDK -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.agentscope.core.state.StateModule;
import io.agentscope.core.tracing.TracerRegistry;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -479,7 +480,7 @@ protected void removeHook(Hook hook) {
* @return Sorted list of hooks
*/
protected List<Hook> getSortedHooks() {
return hooks.stream().sorted(java.util.Comparator.comparingInt(Hook::priority)).toList();
return hooks.stream().sorted(Comparator.comparingInt(Hook::priority)).toList();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,26 @@ ToolUseBlock build() {
}
}

// Build content string: prefer raw content, fall back to serialized args
String contentStr;
if (!rawContentStr.isEmpty()) {
contentStr = rawContentStr;
} else if (!finalArgs.isEmpty()) {
// Serialize the args map to JSON for validation
try {
contentStr = JsonUtils.getJsonCodec().toJson(finalArgs);
} catch (Exception e) {
contentStr = "{}";
}
} else {
contentStr = "{}";
}

return ToolUseBlock.builder()
.id(toolId != null ? toolId : generateId())
.name(name)
.input(finalArgs)
.content(rawContentStr.isEmpty() ? "{}" : rawContentStr)
.content(contentStr)
.metadata(metadata.isEmpty() ? null : metadata)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static ChatResponse parseMessage(Message message, Instant startTime) {
List<ContentBlock> contentBlocks = new ArrayList<>();

// Process content blocks
for (com.anthropic.models.messages.ContentBlock block : message.content()) {
for (var block : message.content()) {
// Text block
block.text()
.ifPresent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
package io.agentscope.core.formatter.anthropic;

import static com.anthropic.models.messages.ToolChoice.ofAny;
import static com.anthropic.models.messages.ToolChoice.ofAuto;
import static com.anthropic.models.messages.ToolChoice.ofTool;

import com.anthropic.core.JsonValue;
import com.anthropic.core.ObjectMappers;
import com.anthropic.models.messages.MessageCreateParams;
Expand All @@ -27,6 +31,7 @@
import io.agentscope.core.model.ToolSchema;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -86,27 +91,19 @@ private static JsonValue convertToJsonValue(Object parameters) {
private static void applyToolChoice(
MessageCreateParams.Builder builder, ToolChoice toolChoice) {
if (toolChoice instanceof ToolChoice.Auto) {
builder.toolChoice(
com.anthropic.models.messages.ToolChoice.ofAuto(
ToolChoiceAuto.builder().build()));
builder.toolChoice(ofAuto(ToolChoiceAuto.builder().build()));
} else if (toolChoice instanceof ToolChoice.None) {
// Anthropic doesn't have None, use Any instead
builder.toolChoice(
com.anthropic.models.messages.ToolChoice.ofAny(
ToolChoiceAny.builder().build()));
builder.toolChoice(ofAny(ToolChoiceAny.builder().build()));
} else if (toolChoice instanceof ToolChoice.Required) {
// Anthropic doesn't have a direct "required" option, use "any" which forces tool
// use
log.warn(
"Anthropic API doesn't support ToolChoice.Required directly, using 'any'"
+ " instead");
builder.toolChoice(
com.anthropic.models.messages.ToolChoice.ofAny(
ToolChoiceAny.builder().build()));
builder.toolChoice(ofAny(ToolChoiceAny.builder().build()));
} else if (toolChoice instanceof ToolChoice.Specific specific) {
builder.toolChoice(
com.anthropic.models.messages.ToolChoice.ofTool(
ToolChoiceTool.builder().name(specific.toolName()).build()));
builder.toolChoice(ofTool(ToolChoiceTool.builder().name(specific.toolName()).build()));
} else {
log.warn("Unknown tool choice type: {}", toolChoice);
}
Expand Down Expand Up @@ -203,7 +200,7 @@ private static void applyAdditionalQueryParams(
private static <T> T getOption(
GenerateOptions options,
GenerateOptions defaultOptions,
java.util.function.Function<GenerateOptions, T> getter) {
Function<GenerateOptions, T> getter) {
if (options != null) {
T value = getter.apply(options);
if (value != null) {
Expand Down
Loading
Loading