feat(agent-dashscope): add DashScope (Qwen) model factory

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
everywhere.z
2026-04-19 20:00:42 +08:00
parent ff9f6e22d0
commit 6840f2fc2a
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-react-agent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>liteflow-react-agent-dashscope</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-react-agent-core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,14 @@
package com.yomahub.liteflow.agent.dashscope;
import io.agentscope.core.model.DashScopeChatModel;
public final class DashScopeModelFactory {
private DashScopeModelFactory() {}
public static DashScopeChatModel of(String apiKey, String modelName) {
return DashScopeChatModel.builder()
.apiKey(apiKey)
.modelName(modelName)
.build();
}
}

View File

@@ -0,0 +1,8 @@
package com.yomahub.liteflow.agent.dashscope;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class DashScopeModelFactoryTest {
@Test void construct_ok() { assertNotNull(DashScopeModelFactory.of("k", "qwen3-max")); }
}