From 0a7cb5ae3ec877c585123c6798099173f210ff66 Mon Sep 17 00:00:00 2001 From: Ziyi Lin Date: Thu, 27 Nov 2025 14:27:22 +0800 Subject: [PATCH] native image support for graalvm 25 Support native image compiling for agentscope runtime java. We found some reflection information is missing from native image agent collecting, so an extra configuration file is provided. Be noted, it is for GraalVM 25. Earlier GraalVM version needs the old reflection-config.json file. --- .../reachability-metadata.json | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 web/src/main/resources/META-INF/native-image/io.agentscope/agentscope-runtime-web/reachability-metadata.json diff --git a/web/src/main/resources/META-INF/native-image/io.agentscope/agentscope-runtime-web/reachability-metadata.json b/web/src/main/resources/META-INF/native-image/io.agentscope/agentscope-runtime-web/reachability-metadata.json new file mode 100644 index 00000000..9a4b3bb0 --- /dev/null +++ b/web/src/main/resources/META-INF/native-image/io.agentscope/agentscope-runtime-web/reachability-metadata.json @@ -0,0 +1,84 @@ +{ + "reflection": [ + { + "type": "com.alibaba.dashscope.aigc.generation.GenerationOutput$Choice", + "fields": [ + { + "name": "finishReason" + }, + { + "name": "index" + }, + { + "name": "message" + } + ], + "unsafeAllocated": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "com.alibaba.dashscope.aigc.generation.GenerationOutputTokenDetails", + "fields": [ + { + "name": "reasoningTokens" + } + ], + "unsafeAllocated": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "com.alibaba.dashscope.aigc.generation.GenerationUsage", + "fields": [ + { + "name": "inputTokens" + }, + { + "name": "outputTokens" + }, + { + "name": "outputTokensDetails" + }, + { + "name": "promptTokensDetails" + }, + { + "name": "totalTokens" + } + ], + "unsafeAllocated": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "com.alibaba.dashscope.aigc.generation.GenerationUsage$PromptTokensDetails", + "fields": [ + { + "name": "cachedTokens" + } + ], + "unsafeAllocated": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + } + ], + "resources": [ + ] +} \ No newline at end of file