Skip to content

Commit bb1149e

Browse files
authored
refactor: Update Werewolf Game to Web Interation (#202)
1 parent f03b55c commit bb1149e

29 files changed

Lines changed: 2964 additions & 1765 deletions

agentscope-examples/werewolf/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
<artifactId>agentscope-core</artifactId>
4646
<version>${revision}</version>
4747
</dependency>
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter-webflux</artifactId>
51+
</dependency>
4852
</dependencies>
4953
</project>
5054

agentscope-examples/werewolf/src/main/java/io/agentscope/examples/werewolf/ExampleUtils.java

Lines changed: 0 additions & 105 deletions
This file was deleted.

agentscope-examples/werewolf/src/main/java/io/agentscope/examples/werewolf/WerewolfGameChinese.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

agentscope-examples/werewolf/src/main/java/io/agentscope/examples/werewolf/WerewolfGameConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class WerewolfGameConfig {
3636
public static final int MAX_DISCUSSION_ROUNDS = 3;
3737

3838
// Model configuration
39-
public static final String DEFAULT_MODEL = "qwen-plus";
39+
public static final String DEFAULT_MODEL = "qwen3-max";
4040

4141
private WerewolfGameConfig() {
4242
// Utility class

agentscope-examples/werewolf/src/main/java/io/agentscope/examples/werewolf/WerewolfGameEnglish.java

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2024-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.agentscope.examples.werewolf;
17+
18+
import java.io.IOException;
19+
import org.springframework.boot.SpringApplication;
20+
import org.springframework.boot.autoconfigure.SpringBootApplication;
21+
22+
/**
23+
* Spring Boot application for Werewolf game web interface.
24+
*/
25+
@SpringBootApplication(scanBasePackages = "io.agentscope.examples.werewolf")
26+
public class WerewolfWebApplication {
27+
28+
public static void main(String[] args) throws IOException {
29+
// Check API key
30+
String apiKey = System.getenv("DASHSCOPE_API_KEY");
31+
if (apiKey == null || apiKey.isEmpty()) {
32+
System.err.println("Error: DASHSCOPE_API_KEY environment variable not set.");
33+
System.err.println("Please set it before starting the game.");
34+
System.exit(1);
35+
}
36+
37+
System.out.println("\n" + "=".repeat(60));
38+
System.out.println(" Werewolf Game - Web Interface");
39+
System.out.println("=".repeat(60));
40+
41+
SpringApplication.run(WerewolfWebApplication.class, args);
42+
43+
System.out.println("\n" + "=".repeat(60));
44+
System.out.println(" Server started! Open http://localhost:8080 in your browser");
45+
System.out.println("=".repeat(60) + "\n");
46+
}
47+
}

0 commit comments

Comments
 (0)